:root {
  --page: #f7faf9;
  --panel: #ffffff;
  --panel-soft: #fbfefd;
  --line: #dce9e5;
  --line-soft: #edf4f2;
  --field: #f2f7f5;
  --field-hover: #edf5f1;
  --field-border: #cbded8;
  --text: #223d38;
  --muted: #6f8781;
  --primary: #62c13e;
  --primary-bright: #7dde58;
  --primary-dark: #3f962a;
  --orange: #ff7043;
  --orange-soft: #fff1ec;
  --danger: #b91c1c;
  --shadow: 0 12px 32px rgba(28, 63, 58, 0.08);
  --icon-home: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M4 11.5 12 5l8 6.5V20a1 1 0 0 1-1 1h-5v-6h-4v6H5a1 1 0 0 1-1-1v-8.5Z' fill='black'/%3E%3C/svg%3E");
  --icon-data: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M5 5h14a1 1 0 0 1 1 1v12.5a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1V6a1 1 0 0 1 1-1Zm2 3v2.5h10V8H7Zm0 5v3.5h4V13H7Zm6 0v3.5h4V13h-4Z' fill='black'/%3E%3C/svg%3E");
  --icon-archive: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M5 4h14a1 1 0 0 1 1 1v4H4V5a1 1 0 0 1 1-1Zm-1 7h16v8a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1v-8Zm5 2.5v2h6v-2H9Z' fill='black'/%3E%3C/svg%3E");
  --icon-calendar: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M7 3h2v3h6V3h2v3h2a1 1 0 0 1 1 1v12a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1V7a1 1 0 0 1 1-1h2V3Zm-1 8v7h12v-7H6Z' fill='black'/%3E%3C/svg%3E");
  --icon-homework: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M7 3h8l4 4v13a1 1 0 0 1-1 1H7a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2Zm7 1.8V8h3.2L14 4.8ZM8 12v2h8v-2H8Zm0 4v2h6v-2H8Z' fill='black'/%3E%3C/svg%3E");
  --icon-book: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M5 4.5A2.5 2.5 0 0 1 7.5 2H20v17H7.5A2.5 2.5 0 0 0 5 21.5v-17ZM8 6v2h8V6H8Zm0 4v2h6v-2H8Z' fill='black'/%3E%3C/svg%3E");
  --icon-teacher: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M12 4a4 4 0 1 1 0 8 4 4 0 0 1 0-8Zm-7 16c.6-3.3 3.4-5.5 7-5.5s6.4 2.2 7 5.5H5Zm14-12h3v10h-2V10h-1V8Z' fill='black'/%3E%3C/svg%3E");
  --icon-users: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M9 5a4 4 0 1 1 0 8 4 4 0 0 1 0-8Zm8 1.5a3 3 0 1 1 0 6 3 3 0 0 1 0-6ZM2.5 20c.6-3.2 3.2-5.2 6.5-5.2s5.9 2 6.5 5.2h-13Zm13.8 0a7.2 7.2 0 0 0-2.1-4.2c.8-.5 1.8-.8 2.8-.8 2.6 0 4.6 1.8 5 5h-5.7Z' fill='black'/%3E%3C/svg%3E");
  --icon-stats: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M5 19h14v2H3V4h2v15Zm2-2V9h3v8H7Zm5 0V5h3v12h-3Zm5 0v-6h3v6h-3Z' fill='black'/%3E%3C/svg%3E");
  --icon-refresh: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M17.7 7.3A8 8 0 1 0 20 13h-2.2a5.8 5.8 0 1 1-1.7-4.1L13 12h8V4l-3.3 3.3Z' fill='black'/%3E%3C/svg%3E");
  --icon-search: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M10.5 4a6.5 6.5 0 1 1 0 13 6.5 6.5 0 0 1 0-13Zm0 2a4.5 4.5 0 1 0 0 9 4.5 4.5 0 0 0 0-9Zm5.7 9.8 4.1 4.1-1.4 1.4-4.1-4.1 1.4-1.4Z' fill='black'/%3E%3C/svg%3E");
  --icon-filter: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M4 6h10v2H4V6Zm14-2h2v6h-2V4Zm-4 2h3v2h-3V6ZM4 16h3v2H4v-2Zm7-2h2v6h-2v-6Zm-3 2h3v2H8v-2Z' fill='black'/%3E%3C/svg%3E");
  --icon-plus: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M11 5h2v6h6v2h-6v6h-2v-6H5v-2h6V5Z' fill='black'/%3E%3C/svg%3E");
  --icon-reset: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M6 6h12v2H6V6Zm2 5h8v2H8v-2Zm3 5h2v3h-2v-3Z' fill='black'/%3E%3C/svg%3E");
  --icon-save: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M5 3h12l2 2v16H5a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1Zm3 2v5h7V5H8Zm0 10v4h8v-4H8Z' fill='black'/%3E%3C/svg%3E");
  --icon-send: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M3 11 21 3l-8 18-2-8-8-2Zm7.5.5 1.2 1.2 4.3-4.3-5.5 3.1Z' fill='black'/%3E%3C/svg%3E");
  --icon-close: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='m6.4 5 12.6 12.6-1.4 1.4L5 6.4 6.4 5Zm11.2 0L19 6.4 6.4 19 5 17.6 17.6 5Z' fill='black'/%3E%3C/svg%3E");
  --icon-eye: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M2.2 12s3.5-6 9.8-6 9.8 6 9.8 6-3.5 6-9.8 6-9.8-6-9.8-6Zm9.8 3a3 3 0 1 0 0-6 3 3 0 0 0 0 6Z' fill='black'/%3E%3C/svg%3E");
  --icon-eye-off: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='m3.3 2.3 18.4 18.4-1.4 1.4-3.1-3.1A11.8 11.8 0 0 1 12 18c-6.3 0-9.8-6-9.8-6a18.4 18.4 0 0 1 4.2-4.6L1.9 3.7l1.4-1.4ZM8 9.7a4 4 0 0 0 6.3 5.1L8 9.7Zm1.7-3.3A9 9 0 0 1 12 6c6.3 0 9.8 6 9.8 6a18.5 18.5 0 0 1-3.1 3.7l-1.4-1.4A16.1 16.1 0 0 0 19.2 12c-1.1-1.5-3.8-4-7.2-4-.5 0-1 .1-1.4.2L9.7 6.4Z' fill='black'/%3E%3C/svg%3E");
  --icon-edit: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M5 17.5V21h3.5L19.1 10.4l-3.5-3.5L5 17.5ZM17 5.5 18.5 4 22 7.5 20.5 9 17 5.5Z' fill='black'/%3E%3C/svg%3E");
  --icon-check: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='m9.2 16.6-4.1-4.1L3.7 14l5.5 5.5L21 7.7l-1.5-1.4L9.2 16.6Z' fill='black'/%3E%3C/svg%3E");
  --icon-trash: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M8 4h8l1 2h4v2H3V6h4l1-2Zm-2 6h12l-1 11H7L6 10Zm4 2v7h2v-7h-2Zm4 0v7h2v-7h-2Z' fill='black'/%3E%3C/svg%3E");
  --icon-clock: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M12 3a9 9 0 1 1 0 18 9 9 0 0 1 0-18Zm1 4h-2v6l5 3 1-1.7-4-2.3V7Z' fill='black'/%3E%3C/svg%3E");
  --icon-logout: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M4 4h8v3h-2V6H6v12h4v-1h2v3H4V4Zm11.5 3.5L20 12l-4.5 4.5-1.4-1.4 2.1-2.1H9v-2h7.2l-2.1-2.1 1.4-1.4Z' fill='black'/%3E%3C/svg%3E");
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  background: var(--page);
  color: var(--text);
  font: 14px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
}

button,
input,
textarea,
select {
  font: inherit;
}

button {
  min-height: 38px;
  border: 0;
  cursor: pointer;
}

.hidden {
  display: none !important;
}

.login-view {
  isolation: isolate;
  overflow: hidden;
  position: relative;
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at 17% 18%, rgba(98, 193, 62, 0.18), transparent 28%),
    radial-gradient(circle at 88% 14%, rgba(255, 112, 67, 0.1), transparent 24%),
    linear-gradient(180deg, #f7fff4 0%, #edfbe8 48%, #fff9f4 100%);
}

.login-view::before {
  content: "";
  position: absolute;
  right: 0;
  bottom: -1px;
  left: 0;
  z-index: 0;
  height: min(46vh, 420px);
  background: url("data:image/svg+xml,%3Csvg viewBox='0 0 2880 520' preserveAspectRatio='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill='%23effbec' d='M0 188C118 132 248 104 390 132C560 165 628 264 800 244C968 225 1038 101 1200 90C1302 83 1384 120 1440 154C1558 210 1688 238 1830 210C2000 177 2068 78 2240 98C2408 117 2478 241 2640 252C2742 259 2824 222 2880 188V520H0V188Z'/%3E%3Cpath fill='%23ddf5d6' d='M0 266C118 210 238 190 358 214C522 246 604 342 778 322C966 300 1034 174 1214 162C1320 155 1398 198 1440 226C1558 282 1678 302 1798 278C1962 246 2044 150 2218 170C2406 192 2474 318 2654 330C2760 337 2838 294 2880 266V520H0V266Z'/%3E%3Cpath fill='%2362c13e' fill-opacity='0.16' d='M0 338C134 282 258 270 392 294C566 326 644 408 816 386C990 364 1068 264 1232 254C1324 249 1396 279 1440 306C1574 362 1698 374 1832 350C2006 318 2084 236 2256 258C2430 280 2508 380 2672 390C2764 395 2836 365 2880 338V520H0V338Z'/%3E%3Cpath fill='%232f9f7b' fill-opacity='0.08' d='M0 420C168 354 322 374 462 402C640 438 732 474 902 432C1084 386 1196 328 1440 374C1608 440 1762 420 1902 392C2080 356 2172 320 2342 362C2524 408 2636 466 2880 420V520H0V420Z'/%3E%3C/svg%3E") left bottom / 200% 100% repeat-x;
  animation: loginWaveDrift 18s ease-in-out infinite alternate;
  pointer-events: none;
}

.login-view::after {
  content: "";
  position: absolute;
  top: -160px;
  right: -120px;
  z-index: 0;
  width: min(48vw, 540px);
  height: min(48vw, 540px);
  border-radius: 46% 54% 62% 38%;
  background:
    radial-gradient(circle at 42% 42%, rgba(255, 255, 255, 0.82), transparent 0 18%, rgba(255, 255, 255, 0) 19%),
    radial-gradient(circle at 50% 50%, rgba(98, 193, 62, 0.15), transparent 0 45%, rgba(98, 193, 62, 0) 46%);
  opacity: 0.9;
  pointer-events: none;
}

.login-corner-brand {
  position: absolute;
  top: 24px;
  left: 28px;
  z-index: 2;
}

.login-card-stack {
  position: relative;
  z-index: 2;
  width: min(440px, 100%);
}

.login-copyright {
  position: absolute;
  right: 24px;
  bottom: 18px;
  left: 24px;
  z-index: 2;
  color: rgba(47, 83, 77, 0.64);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  text-align: center;
}

.login-card-back {
  position: absolute;
  z-index: 0;
  inset: 0;
  transform: translate(5px, 6px);
  border-radius: 24px;
  background: linear-gradient(135deg, #7dde58, #62c13e 58%, #4caf2f);
  box-shadow: 0 20px 42px rgba(98, 193, 62, 0.22);
}

.login-panel {
  position: relative;
  z-index: 1;
  width: 100%;
  padding: 34px;
  border: 1px solid #ffffff;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 22px 52px rgba(34, 61, 56, 0.14);
  -webkit-backdrop-filter: blur(10px) saturate(1.08);
  backdrop-filter: blur(10px) saturate(1.08);
}

.login-title {
  margin-bottom: 26px;
  text-align: center;
}

.login-title h1 {
  color: #203238;
  font-size: 25px;
  letter-spacing: 0;
  line-height: 1.25;
}

.login-title h1::after {
  content: "";
  display: block;
  width: 40px;
  height: 3px;
  margin: 12px auto 0;
  border-radius: 999px;
  background: var(--primary);
}

.login-title p {
  margin-top: 6px;
  color: var(--muted);
}

.brand {
  display: flex;
  gap: 14px;
  align-items: center;
  margin-bottom: 26px;
}

.brand.compact {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 28px;
}

.brand-logo {
  display: block;
  max-width: 100%;
  height: auto;
  object-fit: contain;
  flex-shrink: 0;
}

.brand-logo-login-corner {
  width: 260px;
  max-height: 66px;
  padding: 4px 0;
  filter: drop-shadow(0 8px 14px rgba(98, 193, 62, 0.14));
}

.brand-logo-sidebar {
  width: 42px;
  height: 42px;
  border-radius: 999px;
  filter: drop-shadow(0 8px 14px rgba(98, 193, 62, 0.18));
}

.brand.compact h1 {
  line-height: 1.15;
}

.brand.compact p {
  margin-top: 3px;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  color: var(--text);
  font-size: 20px;
  font-weight: 900;
}

h2 {
  color: var(--text);
  font-size: 26px;
  font-weight: 900;
}

.brand p,
.content-header p {
  color: var(--muted);
}

label {
  display: grid;
  gap: 6px;
  margin-bottom: 14px;
}

label span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),
textarea,
select {
  min-width: 0;
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--field-border);
  border-radius: 14px;
  padding: 10px 13px;
  outline: none;
  background-color: var(--field);
  color: var(--text);
  transition: border-color 160ms ease, background-color 160ms ease, box-shadow 160ms ease;
}

input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):hover:not(:disabled):not([readonly]),
textarea:hover:not(:disabled):not([readonly]),
select:hover:not(:disabled) {
  border-color: #aecbc2;
  background-color: var(--field-hover);
}

input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):focus,
textarea:focus,
select:focus {
  border-color: var(--primary);
  background-color: #fff;
  box-shadow: 0 0 0 4px rgba(98, 193, 62, 0.16);
}

input::placeholder,
textarea::placeholder {
  color: #91a59f;
}

textarea {
  line-height: 1.65;
  resize: vertical;
}

select {
  height: 44px;
  padding: 0 42px 0 13px;
  -webkit-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='m5.5 7.5 4.5 4.5 4.5-4.5' fill='none' stroke='%236f8781' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 13px center;
  background-size: 16px 16px;
  line-height: 1.4;
  cursor: pointer;
}

select::-ms-expand {
  display: none;
}

input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):disabled,
textarea:disabled,
select:disabled {
  border-color: var(--line);
  background-color: #edf2f0;
  color: var(--muted);
  cursor: not-allowed;
}

.password-input-wrap {
  position: relative;
  width: 100%;
}

.password-input-wrap input {
  padding-right: 50px;
}

.password-toggle {
  position: absolute;
  top: 50%;
  right: 7px;
  display: grid;
  width: 36px;
  min-height: 36px;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 0;
  border-radius: 10px;
  transform: translateY(-50%);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.password-toggle::before {
  content: "";
  display: block;
  width: 19px;
  height: 19px;
  background: currentColor;
  -webkit-mask: var(--icon) center / contain no-repeat;
  mask: var(--icon) center / contain no-repeat;
  --icon: var(--icon-eye);
}

.password-toggle[aria-pressed="true"]::before {
  --icon: var(--icon-eye-off);
}

.password-toggle:hover {
  background: #edf9e9;
  color: var(--primary-dark);
}

.password-toggle:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

input[readonly] {
  background: #e9f0ed;
  color: var(--muted);
  cursor: default;
}

.primary,
.secondary,
.ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 14px;
  padding: 0 16px;
  font-weight: 800;
}

.tab::before,
.primary::before,
.secondary::before,
.ghost::before,
.link-button::before,
.summary-icon::before,
.kpi-icon::before {
  content: "";
  display: inline-block;
  flex: 0 0 auto;
  width: 17px;
  height: 17px;
  background: currentColor;
  -webkit-mask: var(--icon) center / contain no-repeat;
  mask: var(--icon) center / contain no-repeat;
}

.primary::before,
.secondary::before,
.ghost::before {
  --icon: var(--icon-check);
}

#loginButton::before {
  --icon: var(--icon-logout);
  transform: rotate(180deg);
}

#refreshButton::before {
  --icon: var(--icon-refresh);
}

#logoutButton::before {
  --icon: var(--icon-logout);
}

#resetArchiveFilterButton::before,
#resetStudentButton::before,
#cancelScheduleChangeButton::before,
#resetHomeworkButton::before,
#resetCourseButton::before,
#cancelCourseHourAdjustButton::before,
#resetTeacherButton::before,
#resetAccountButton::before {
  --icon: var(--icon-reset);
}

#studentForm .primary::before,
#courseForm .primary::before,
#teacherForm .primary::before {
  --icon: var(--icon-save);
}

#courseHourAdjustForm .primary::before {
  --icon: var(--icon-plus);
}

#submitStudentButton::before,
#scheduleChangeForm .primary::before,
#homeworkForm .primary::before,
#scheduleForm .primary::before,
#accountForm .primary::before {
  --icon: var(--icon-send);
}

#academicHandoverForm .primary::before {
  --icon: var(--icon-send);
}

#handoverArchiveSourceButton::before,
.link-button[data-handover-source]::before {
  --icon: var(--icon-archive);
}

.readonly-actions .secondary[data-edit-student]::before {
  --icon: var(--icon-edit);
}

.readonly-actions .secondary[data-quick-student-account]::before {
  --icon: var(--icon-plus);
}

.readonly-actions .ghost[data-close-archive-detail]::before {
  --icon: var(--icon-close);
}

.icon-home {
  --icon: var(--icon-home);
}

.icon-data {
  --icon: var(--icon-data);
}

.icon-archive {
  --icon: var(--icon-archive);
}

.icon-calendar {
  --icon: var(--icon-calendar);
}

.icon-homework {
  --icon: var(--icon-homework);
}

.icon-book {
  --icon: var(--icon-book);
}

.icon-teacher {
  --icon: var(--icon-teacher);
}

.icon-users {
  --icon: var(--icon-users);
}

.icon-stats {
  --icon: var(--icon-stats);
}

.icon-clock {
  --icon: var(--icon-clock);
}

.primary {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 8px 18px rgba(98, 193, 62, 0.24);
}

.primary:hover {
  background: var(--primary-dark);
}

.login-submit {
  display: block;
  width: 168px;
  min-height: 44px;
  margin: 20px auto 0;
  font-size: 15px;
}

.secondary {
  background: #edf9e9;
  color: var(--primary-dark);
}

.secondary:hover {
  background: #e2f5dc;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.52;
  box-shadow: none;
}

.ghost {
  background: transparent;
  color: var(--muted);
  text-align: left;
}

.message {
  min-height: 22px;
  margin-top: 12px;
  color: var(--danger);
}

#loginMessage {
  width: 100%;
  text-align: center;
}

.toast-host {
  position: fixed;
  top: 18px;
  left: 50%;
  z-index: 1000;
  display: grid;
  gap: 10px;
  width: min(520px, calc(100vw - 32px));
  transform: translateX(-50%);
  pointer-events: none;
}

.toast {
  display: grid;
  grid-template-columns: 30px 1fr;
  gap: 12px;
  align-items: center;
  min-height: 58px;
  padding: 14px 16px;
  border: 1px solid rgba(237, 244, 242, 0.96);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 16px 40px rgba(28, 63, 58, 0.16);
  color: #223d38;
  animation: toastIn 180ms ease-out;
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

.toast.leaving {
  animation: toastOut 180ms ease-in forwards;
}

.toast.success {
  border-left: 4px solid var(--primary);
}

.toast.error {
  border-left: 4px solid var(--danger);
}

.toast.notification {
  border-left: 4px solid var(--orange);
}

.toast-icon {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 999px;
  background: var(--primary);
  color: #fff;
  font-weight: 900;
}

.toast.error .toast-icon {
  background: var(--danger);
}

.toast.notification .toast-icon {
  background: var(--orange);
  -webkit-mask: url("./assets/tonzhi.svg") center / 16px 19px no-repeat;
  mask: url("./assets/tonzhi.svg") center / 16px 19px no-repeat;
}

.toast-text {
  color: #223d38;
  font-weight: 800;
  line-height: 1.35;
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateY(-12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes toastOut {
  from {
    opacity: 1;
    transform: translateY(0);
  }
  to {
    opacity: 0;
    transform: translateY(-12px);
  }
}

@keyframes loginWaveDrift {
  from {
    background-position: 0 bottom;
    transform: translateY(0);
  }
  to {
    background-position: 100% bottom;
    transform: translateY(8px);
  }
}

.dashboard {
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: 100vh;
}

.sidebar {
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  min-height: 0;
  padding: 22px;
  border-right: 1px solid var(--line);
  background: var(--panel);
}

.sidebar::before {
  content: "";
  display: block;
  width: 56px;
  height: 5px;
  margin-bottom: 20px;
  border-radius: 999px;
  background: var(--primary);
}

.tabs {
  display: grid;
  gap: 8px;
  min-height: 0;
  overflow-y: auto;
  padding-right: 4px;
  scrollbar-width: thin;
}

.tabs::-webkit-scrollbar {
  width: 6px;
}

.tabs::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: #dbe8d6;
}

#logoutButton {
  flex: 0 0 auto;
  width: 100%;
  margin-top: 18px;
  min-height: 42px;
  border: 1px solid rgba(255, 112, 67, 0.24);
  border-radius: 14px;
  background: var(--orange-soft);
  color: #c84f2b;
  text-align: center;
  font-weight: 900;
}

#logoutButton:hover {
  background: #ffe6dc;
  color: #a83d20;
}

.tab {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  border-radius: 12px;
  background: transparent;
  color: var(--text);
  padding: 0 14px;
  text-align: left;
  font-weight: 800;
}

.tab::before {
  width: 18px;
  height: 18px;
  opacity: 0.76;
}

.tab[data-tab="home"]::before {
  --icon: var(--icon-home);
}

.tab[data-tab="data"]::before {
  --icon: var(--icon-data);
}

.tab[data-tab="students"]::before {
  --icon: var(--icon-archive);
}

.tab[data-tab="createArchive"]::before {
  --icon: var(--icon-plus);
}

.tab[data-tab="schedules"]::before {
  --icon: var(--icon-calendar);
}

.tab[data-tab="scheduleManage"]::before {
  --icon: var(--icon-calendar);
}

.tab[data-tab="homework"]::before {
  --icon: var(--icon-homework);
}

.tab[data-tab="courses"]::before {
  --icon: var(--icon-book);
}

.tab[data-tab="teachers"]::before {
  --icon: var(--icon-teacher);
}

.tab[data-tab="studentAccounts"]::before {
  --icon: var(--icon-users);
}

.tab[data-tab="accounts"]::before {
  --icon: var(--icon-users);
}

.tab[data-tab="stats"]::before {
  --icon: var(--icon-stats);
}

.tab[data-tab="handover"]::before {
  --icon: var(--icon-users);
}

.tab.active,
.tab:hover {
  background: #edf9e9;
  color: var(--primary-dark);
}

.tab.active::before,
.tab:hover::before {
  opacity: 1;
}

.tab.active {
  box-shadow: inset 4px 0 0 var(--primary);
}

.content {
  min-width: 0;
  padding: 26px;
}

.content-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  margin-bottom: 18px;
  padding: 20px 22px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.header-actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
}

.notification-center {
  position: relative;
  display: flex;
  align-items: center;
  flex: 0 0 auto;
}

.notification-button {
  position: relative;
  display: grid;
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  padding: 0;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 8px 18px rgba(28, 63, 58, 0.07);
}

.notification-button:hover,
.notification-button[aria-expanded="true"] {
  border-color: rgba(98, 193, 62, 0.55);
  background: #f5fff2;
}

.notification-icon {
  display: block;
  width: 20px;
  height: 24px;
  background: var(--primary-dark);
  -webkit-mask: url("./assets/tonzhi.svg") center / contain no-repeat;
  mask: url("./assets/tonzhi.svg") center / contain no-repeat;
}

.notification-button:hover .notification-icon,
.notification-button[aria-expanded="true"] .notification-icon {
  background: var(--primary);
}

.notification-badge {
  position: absolute;
  top: -5px;
  right: -5px;
  display: grid;
  min-width: 19px;
  height: 19px;
  padding: 0 5px;
  place-items: center;
  border: 2px solid #fff;
  border-radius: 999px;
  background: var(--orange);
  color: #fff;
  font-size: 10px;
  font-weight: 900;
  line-height: 1;
}

.notification-panel {
  position: absolute;
  top: calc(100% + 12px);
  right: 0;
  z-index: 950;
  width: min(380px, calc(100vw - 32px));
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 22px 54px rgba(28, 63, 58, 0.18);
}

.notification-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 18px 13px;
  border-bottom: 1px solid var(--line-soft);
}

.notification-panel-head h3 {
  margin: 0;
  color: var(--text);
  font-size: 17px;
  font-weight: 900;
}

.notification-panel-head p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.notification-read-all {
  min-height: 30px;
  padding: 0 9px;
  border-radius: 8px;
  background: var(--orange-soft);
  color: #c84f2b;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.notification-read-all:hover {
  background: #ffe4d9;
}

.notification-list {
  max-height: min(430px, 60vh);
  overflow-y: auto;
}

.notification-item {
  display: flex;
  width: 100%;
  min-height: 70px;
  align-items: flex-start;
  gap: 11px;
  padding: 13px 18px;
  border-bottom: 1px solid var(--line-soft);
  background: #fff;
  color: var(--text);
  text-align: left;
}

.notification-item:last-child {
  border-bottom: 0;
}

.notification-item:hover {
  background: #f8fcf7;
}

.notification-item-dot {
  flex: 0 0 auto;
  width: 7px;
  height: 7px;
  margin-top: 6px;
  border-radius: 50%;
  background: transparent;
}

.notification-item.unread .notification-item-dot {
  background: var(--orange);
}

.notification-item-main {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.notification-item-main strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
  font-weight: 900;
}

.notification-item-main span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.notification-item-main small {
  color: #9aada8;
  font-size: 11px;
}

.notification-empty {
  padding: 38px 18px;
  color: var(--muted);
  text-align: center;
  font-size: 13px;
}

.profile-button {
  display: flex;
  min-height: 48px;
  align-items: center;
  gap: 10px;
  padding: 5px 6px 5px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 8px 18px rgba(28, 63, 58, 0.07);
}

.profile-center-label {
  color: var(--primary-dark);
  font-size: 13px;
  font-weight: 900;
  line-height: 1;
  white-space: nowrap;
}

.profile-button:hover {
  border-color: rgba(98, 193, 62, 0.55);
  box-shadow: 0 10px 22px rgba(98, 193, 62, 0.15);
}

.top-avatar {
  width: 40px;
  height: 40px;
  border-radius: 999px;
  background: #edf9e9;
  object-fit: cover;
}

.profile-dept {
  flex: 0 1 auto;
  display: inline-flex;
  min-width: 92px;
  max-width: min(260px, 30vw);
  min-height: 40px;
  align-items: center;
  justify-content: center;
  padding: 0 18px;
  border-radius: 999px;
  border: 1px solid rgba(255, 112, 67, 0.26);
  background: linear-gradient(135deg, #fff5ef, #ffe2d5);
  color: #c84f2b;
  font-size: 14px;
  font-weight: 900;
  line-height: 1;
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  box-shadow: 0 8px 18px rgba(255, 112, 67, 0.14);
}

.content-header h2::after {
  content: "";
  display: block;
  width: 46px;
  height: 4px;
  margin-top: 8px;
  border-radius: 999px;
  background: var(--orange);
}

.panel {
  display: grid;
  gap: 18px;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 900;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(24, 41, 37, 0.22);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}

body.modal-open {
  overflow: hidden;
}

.edit-modal-backdrop {
  align-items: center;
  overflow-y: auto;
}

.edit-dialog {
  display: flex;
  width: min(960px, 100%);
  max-height: calc(100vh - 36px);
  flex-direction: column;
  border: 1px solid rgba(255, 255, 255, 0.94);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 24px 64px rgba(28, 63, 58, 0.24);
}

.edit-dialog-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 22px 16px;
  border-bottom: 1px solid var(--line-soft);
}

.edit-dialog-header h3 {
  margin: 0;
  color: var(--text);
  font-size: 20px;
  font-weight: 900;
  line-height: 1.3;
}

.edit-dialog-header p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.edit-dialog-body {
  min-height: 0;
  overflow-y: auto;
  padding: 18px 22px 22px;
}

.edit-modal-form {
  margin: 0;
  box-shadow: none;
}

.homework-review-modal {
  align-items: center;
  overflow-y: auto;
}

.homework-review-dialog {
  display: flex;
  width: min(920px, 100%);
  max-height: calc(100vh - 36px);
  flex-direction: column;
  border: 1px solid rgba(255, 255, 255, 0.94);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 24px 64px rgba(28, 63, 58, 0.24);
}

.homework-review-body {
  min-height: 0;
  overflow-y: auto;
  padding: 18px 22px 22px;
}

.homework-review-section {
  padding: 16px 0;
  border-bottom: 1px solid var(--line-soft);
}

.homework-review-section:first-child {
  padding-top: 0;
}

.homework-review-section h4 {
  margin: 0 0 10px;
  color: var(--text);
  font-size: 15px;
  font-weight: 900;
}

.homework-review-text {
  padding: 14px;
  border: 1px solid var(--line-soft);
  border-radius: 14px;
  background: #f7fbf7;
}

.homework-review-images {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.homework-review-image {
  overflow: hidden;
  aspect-ratio: 4 / 3;
  border: 1px solid var(--line-soft);
  border-radius: 14px;
  background: #edf5ed;
  box-shadow: inset 0 2px 5px rgba(54, 101, 60, 0.08);
}

.homework-review-image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.homework-review-empty {
  padding: 18px;
  border-radius: 14px;
  background: #f5f8f5;
  color: var(--muted);
  text-align: center;
}

.homework-image-field {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #f8fbf7;
}

.homework-image-field-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.homework-image-field-head > div {
  display: grid;
  gap: 5px;
}

.homework-image-field-head small {
  color: var(--muted);
  font-size: 12px;
}

.homework-image-picker {
  display: inline-flex;
  min-height: 38px;
  margin: 0;
  align-items: center;
  justify-content: center;
  padding: 0 14px;
  border-radius: 12px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 800;
}

.homework-image-picker::before {
  --icon: var(--icon-plus);
}

.homework-image-preview {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.homework-image-preview-item {
  position: relative;
  overflow: visible;
  aspect-ratio: 1;
}

.homework-image-preview-item img {
  display: block;
  width: 100%;
  height: 100%;
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  background: #edf5ed;
  object-fit: cover;
}

.homework-image-preview-item button {
  position: absolute;
  top: -7px;
  right: -7px;
  width: 25px;
  min-height: 25px;
  padding: 0;
  border: 2px solid #fff;
  border-radius: 50%;
  background: var(--danger);
  color: #fff;
  font-size: 17px;
  font-weight: 900;
  line-height: 21px;
  box-shadow: 0 4px 10px rgba(120, 35, 35, 0.24);
}

.homework-review-revision {
  margin-top: 12px;
  padding: 16px;
  border: 1px solid rgba(200, 79, 43, 0.18);
  border-radius: 14px;
  background: #fff7f3;
}

.homework-review-revision p {
  margin: 0;
  color: #7b4333;
  line-height: 1.6;
  white-space: pre-wrap;
}

.homework-review-timeline {
  display: grid;
  gap: 0;
}

.homework-timeline-item {
  position: relative;
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  gap: 10px;
  padding-bottom: 18px;
}

.homework-timeline-item:last-child {
  padding-bottom: 0;
}

.homework-timeline-item::before {
  content: "";
  position: absolute;
  top: 13px;
  bottom: -1px;
  left: 6px;
  width: 2px;
  background: var(--line);
}

.homework-timeline-item:last-child::before {
  display: none;
}

.homework-timeline-marker {
  position: relative;
  z-index: 1;
  width: 13px;
  height: 13px;
  margin-top: 4px;
  border: 3px solid #fff;
  border-radius: 50%;
  background: #d89438;
  box-shadow: 0 0 0 1px var(--line);
}

.homework-timeline-item.revision_required .homework-timeline-marker {
  background: #c84f2b;
}

.homework-timeline-item.graded .homework-timeline-marker {
  background: var(--primary);
}

.homework-timeline-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.homework-timeline-head strong {
  color: var(--text);
  font-size: 13px;
}

.homework-timeline-head time,
.homework-timeline-copy small {
  color: var(--muted);
  font-size: 11px;
}

.homework-timeline-copy p {
  margin: 5px 0 0;
  color: var(--text-soft);
  font-size: 13px;
  line-height: 1.55;
  white-space: pre-wrap;
}

.homework-reject-button {
  background: #fff0ea;
  color: #b84628;
}

.homework-reject-button::before {
  --icon: var(--icon-close);
}

.homework-grade-form .actions {
  flex-wrap: wrap;
}

.status-pill.revision_required {
  background: #fee2e2;
  color: var(--danger);
}

.homework-review-result strong {
  color: var(--primary-dark);
  font-size: 28px;
}

.homework-review-result p {
  margin: 8px 0 0;
  color: var(--text-soft);
  line-height: 1.6;
}

.homework-grade-form {
  display: grid;
  gap: 14px;
  margin-top: 18px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #f8fbf7;
}

.homework-grade-form label {
  display: grid;
  gap: 7px;
}

.avatar-dialog {
  max-height: calc(100vh - 36px);
  overflow-y: auto;
  width: min(420px, 100%);
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, 0.92);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 24px 64px rgba(28, 63, 58, 0.24);
}

.password-section {
  margin-top: 22px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.compact-heading {
  margin-bottom: 14px;
}

.compact-heading h3 {
  margin: 0;
  font-size: 16px;
}

.compact-heading p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.account-username-heading {
  margin-top: 22px;
}

.password-form {
  display: grid;
  gap: 12px;
}

.password-form label {
  margin: 0;
}

.password-form .actions {
  justify-content: flex-end;
  margin-top: 2px;
}

.handover-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 20px 22px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: linear-gradient(135deg, #f7fff4, #ffffff 68%, #fff7f1);
  box-shadow: var(--shadow);
}

.handover-kicker {
  color: var(--orange);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.5px;
}

.handover-hero h3 {
  margin: 4px 0 0;
  color: var(--text);
  font-size: 22px;
  font-weight: 900;
  line-height: 1.25;
}

.handover-hero p {
  max-width: 720px;
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.handover-form {
  display: grid;
  gap: 14px;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.handover-route {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 30px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: end;
}

.handover-route label {
  margin: 0;
}

.handover-arrow {
  display: grid;
  min-height: 44px;
  place-items: center;
  color: var(--orange);
  font-size: 24px;
  font-weight: 900;
}

.handover-route .primary {
  min-height: 44px;
  white-space: nowrap;
}

.handover-notice {
  padding: 11px 13px;
  border-left: 3px solid var(--orange);
  background: #fff8f2;
  color: #8a512d;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.55;
}

.handover-account-note {
  display: grid;
  gap: 3px;
  padding: 12px 13px;
  border: 1px solid #e5f0e1;
  border-radius: 12px;
  background: #f7fcf5;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.handover-account-note strong {
  color: var(--primary-dark);
  font-size: 13px;
}

.handover-source-actions {
  display: flex;
  justify-content: flex-end;
  min-height: 34px;
}

.handover-source-actions .secondary {
  min-height: 34px;
  padding: 0 13px;
  border: 1px solid rgba(255, 112, 67, 0.22);
  background: var(--orange-soft);
  color: #c84f2b;
}

.handover-source-actions .secondary:hover {
  background: #ffe6dc;
}

.handover-summary {
  margin-top: 2px;
}

.handover-list-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  padding: 8px 2px 0;
}

.handover-list-head h3 {
  margin: 0;
  color: var(--text);
  font-size: 18px;
  font-weight: 900;
}

.handover-list-head p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.handover-select-all {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  color: var(--primary-dark);
  font-size: 13px;
  font-weight: 900;
  white-space: nowrap;
}

.handover-select-all input,
.handover-check-col input {
  width: 17px;
  height: 17px;
  margin: 0;
  accent-color: var(--primary);
}

.handover-list table {
  min-width: 900px;
}

.handover-check-col {
  width: 58px;
  text-align: center;
}

.handover-list td small {
  display: inline-block;
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: bottom;
  white-space: nowrap;
}

.handover-list td:nth-child(5) {
  min-width: 150px;
}

.handover-list td:nth-child(5) .status-pill,
.handover-list td:nth-child(5) small {
  margin-right: 6px;
  vertical-align: middle;
}

.avatar-dialog-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.avatar-dialog-header h3 {
  margin: 0;
  color: var(--text);
  font-size: 18px;
  font-weight: 900;
}

.icon-button {
  display: grid;
  width: 34px;
  min-height: 34px;
  place-items: center;
  border-radius: 999px;
  background: #edf9e9;
  color: var(--primary-dark);
  font-size: 20px;
  font-weight: 900;
  line-height: 1;
}

.icon-button:hover {
  background: #e2f5dc;
}

.avatar-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}

.avatar-option {
  display: grid;
  aspect-ratio: 1;
  min-height: 0;
  place-items: center;
  border: 2px solid transparent;
  border-radius: 18px;
  background: #f6fbf4;
}

.avatar-option:hover,
.avatar-option.active {
  border-color: var(--primary);
  background: #edf9e9;
}

.avatar-option.active {
  box-shadow: 0 0 0 4px rgba(98, 193, 62, 0.14);
}

.avatar-option img {
  width: 54px;
  height: 54px;
  border-radius: 999px;
  object-fit: cover;
}

.data-section {
  display: grid;
  gap: 10px;
}

.data-section h3 {
  margin: 0;
  color: var(--text);
  font-size: 18px;
  font-weight: 900;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 14px;
}

.admin-stats {
  display: grid;
  gap: 26px;
}

.admin-dashboard-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  padding: 4px 2px 0;
}

.admin-dashboard-eyebrow,
.admin-section-eyebrow,
.admin-card-eyebrow {
  display: block;
  color: var(--primary-dark);
  font-size: 11px;
  font-weight: 900;
}

.admin-dashboard-head h3 {
  margin: 6px 0 0;
  color: var(--text);
  font-size: 28px;
  font-weight: 900;
  line-height: 1.2;
}

.admin-dashboard-head p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.admin-dashboard-updated {
  display: grid;
  gap: 5px;
  min-width: 170px;
  padding: 12px 14px;
  border-left: 3px solid var(--orange);
  background: #fffaf0;
}

.admin-dashboard-updated span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.admin-dashboard-updated strong {
  color: var(--text);
  font-size: 13px;
  font-weight: 900;
}

.admin-primary-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(230px, 0.85fr);
  gap: 14px;
}

.admin-lead-card {
  position: relative;
  display: flex;
  min-height: 224px;
  align-items: stretch;
  justify-content: space-between;
  gap: 18px;
  overflow: hidden;
  padding: 26px 28px;
  border: 1px solid #cce8c5;
  border-left: 5px solid var(--primary);
  border-radius: 8px;
  background: #edf9e9;
  box-shadow: 0 14px 30px rgba(45, 95, 48, 0.08);
}

.admin-lead-copy {
  display: grid;
  align-content: space-between;
  min-width: 0;
}

.admin-lead-card h3 {
  margin: 8px 0 0;
  color: #1f4934;
  font-size: 20px;
  font-weight: 900;
}

.admin-lead-card p {
  margin: 5px 0 0;
  color: #5d8066;
  font-size: 13px;
  font-weight: 700;
}

.admin-lead-value {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-top: 10px;
}

.admin-lead-value strong {
  color: #17653b;
  font-size: 68px;
  font-weight: 900;
  line-height: 0.95;
}

.admin-lead-value span {
  color: #43845a;
  font-size: 18px;
  font-weight: 900;
}

.admin-lead-foot {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
  color: #5d8066;
  font-size: 12px;
  font-weight: 800;
}

.admin-lead-foot strong {
  color: #17653b;
  font-size: 15px;
  font-weight: 900;
}

.admin-lead-mark {
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 14px;
  flex: 0 0 132px;
  border-left: 1px solid rgba(23, 101, 59, 0.16);
  color: #5d8066;
  font-size: 12px;
  font-weight: 900;
}

.admin-lead-symbol {
  display: grid;
  gap: 8px;
  width: 74px;
}

.admin-lead-symbol i {
  display: block;
  height: 9px;
  border-radius: 999px;
  background: #65b978;
}

.admin-lead-symbol i:nth-child(2) {
  width: 54px;
  background: #f0b84a;
}

.admin-lead-symbol i:nth-child(3) {
  width: 38px;
  background: #8dcf8b;
}

.admin-overview-stats {
  display: grid;
  grid-template-rows: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.admin-overview-stat {
  display: grid;
  align-content: center;
  gap: 6px;
  min-width: 0;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--primary);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.admin-overview-stat:nth-child(2) {
  border-left-color: var(--orange);
}

.admin-overview-stat span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.admin-overview-stat strong {
  color: var(--text);
  font-size: 34px;
  font-weight: 900;
  line-height: 1;
}

.admin-overview-stat small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.admin-dashboard-section {
  display: grid;
  gap: 12px;
}

.admin-section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  padding: 0 2px;
}

.admin-section-heading h3 {
  margin: 5px 0 0;
  color: var(--text);
  font-size: 18px;
  font-weight: 900;
}

.admin-section-heading p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 14px;
}

.kpi-card {
  display: grid;
  min-height: 112px;
  align-content: space-between;
  gap: 8px;
  padding: 16px;
  border: 1px solid #eef1f4;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 10px 26px rgba(17, 24, 39, 0.045);
}

.admin-stats .kpi-card.green {
  border-top: 3px solid #0caf60;
  border-left: 1px solid #eef1f4;
}

.admin-stats .kpi-card.orange {
  border-top: 3px solid #f0b84a;
  border-left: 1px solid #eef1f4;
}

.kpi-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: #718096;
  font-size: 11px;
  font-weight: 600;
}

.kpi-help {
  display: grid;
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  place-items: center;
  border: 1px solid #a0aec0;
  border-radius: 999px;
  color: #a0aec0;
  font-size: 10px;
  font-weight: 800;
  line-height: 1;
}

.kpi-card-head span:not(.kpi-help) {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.kpi-card strong {
  display: block;
  color: #111827;
  font-size: 28px;
  font-weight: 900;
  line-height: 1.2;
}

.kpi-card-foot {
  min-height: 16px;
}

.kpi-trend {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: #a0aec0;
  font-size: 11px;
  font-weight: 700;
  line-height: 16px;
}

.kpi-trend.up {
  color: #0caf60;
}

.kpi-trend.down {
  color: #fd6a6a;
}

.trend-mark {
  position: relative;
  display: inline-block;
  width: 14px;
  height: 14px;
}

.trend-mark::before {
  content: "";
  position: absolute;
  inset: 4px 2px 4px 1px;
  border-top: 1.5px solid currentColor;
  border-right: 1.5px solid currentColor;
  transform: rotate(-45deg);
}

.kpi-trend.down .trend-mark::before {
  transform: rotate(135deg);
}

.kpi-trend.neutral .trend-mark::before {
  inset: 6px 2px;
  border-right: 0;
  transform: none;
}

.chart-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(280px, 1fr));
  gap: 14px;
}

.chart-panel {
  display: grid;
  gap: 14px;
  padding: 18px 20px 14px;
  border: 1px solid #eef1f4;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 10px 26px rgba(17, 24, 39, 0.045);
}

.chart-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.chart-head h3 {
  margin: 0;
  color: #111827;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 0.3px;
}

.chart-head span {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  padding: 0 10px;
  border: 1px solid #eef1f4;
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 2px 4px rgba(17, 24, 39, 0.04);
  color: #0caf60;
  font-size: 10px;
  font-weight: 700;
}

.bar-chart {
  display: grid;
  gap: 8px;
}

.line-chart {
  display: grid;
  gap: 8px;
}

.chart-svg {
  width: 100%;
  min-height: 226px;
}

.line-svg {
  width: 100%;
  min-height: 226px;
}

.chart-grid-line {
  stroke: #f1f2f4;
  stroke-width: 1;
}

.chart-axis {
  stroke: #323b49;
  stroke-width: 1.3;
}

.trend-line {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 3;
}

.trend-line.primary,
.trend-point.primary {
  fill: #0caf60;
  stroke: #0caf60;
}

.trend-line.accent,
.trend-point.accent,
.trend-focus.accent {
  fill: #ffde65;
  stroke: #ffde65;
}

.trend-point {
  stroke-width: 2;
}

.trend-focus {
  stroke: #fff;
  stroke-width: 3;
  filter: drop-shadow(0 2px 4px rgba(26, 32, 44, 0.14));
}

.metric-bar.primary {
  fill: #0caf60;
}

.metric-bar.accent {
  fill: #ffde65;
}

.chart-bubble rect {
  fill: #fff;
  filter: drop-shadow(2px 8px 18px rgba(26, 32, 44, 0.12));
}

.chart-bubble text {
  fill: #718096;
  font-size: 10px;
  font-weight: 700;
}

.x-label {
  fill: #a0aec0;
  font-size: 11px;
  font-weight: 600;
}

.y-label {
  fill: #a0aec0;
  font-size: 11px;
  font-weight: 600;
}

.line-legend {
  display: flex;
  gap: 14px;
  color: #718096;
  font-size: 12px;
  font-weight: 700;
}

.line-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.line-legend i {
  display: inline-block;
  width: 18px;
  height: 4px;
  border-radius: 999px;
}

.line-legend i.primary {
  background: #0caf60;
}

.line-legend i.accent {
  background: #ffde65;
}

.rank-chart {
  display: grid;
  gap: 12px;
  min-height: 226px;
  align-content: center;
}

.rank-row {
  display: grid;
  gap: 6px;
}

.rank-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: #111827;
  font-size: 12px;
}

.rank-meta span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rank-meta strong {
  flex: 0 0 auto;
  color: #718096;
  font-size: 12px;
  font-weight: 700;
}

.rank-track {
  overflow: hidden;
  height: 8px;
  border-radius: 999px;
  background: #f1f2f4;
}

.rank-fill {
  display: block;
  height: 100%;
  min-width: 3px;
  border-radius: inherit;
  background: #0caf60;
}

.rank-fill.tone-1 {
  background: #ffde65;
}

.rank-fill.tone-2 {
  background: #4bb5fe;
}

.rank-fill.tone-3 {
  background: #ff8635;
}

.rank-row small {
  color: #a0aec0;
  font-size: 11px;
  font-weight: 600;
}

.donut-chart {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 20px;
  align-items: center;
  min-height: 226px;
}

.donut-visual {
  position: relative;
  width: 150px;
  height: 150px;
}

.donut-visual svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.donut-base,
.donut-segment {
  fill: none;
  stroke-width: 16;
}

.donut-base {
  stroke: #f1f2f4;
}

.donut-segment {
  stroke-linecap: round;
}

.donut-center {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  text-align: center;
}

.donut-center strong {
  color: #111827;
  font-size: 24px;
  line-height: 1.1;
}

.donut-center span {
  margin-top: 4px;
  color: #a0aec0;
  font-size: 11px;
  font-weight: 700;
}

.donut-list {
  display: grid;
  gap: 10px;
}

.donut-item {
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.donut-item i {
  display: block;
  width: 8px;
  height: 8px;
  border-radius: 999px;
}

.donut-item span {
  overflow: hidden;
  color: #718096;
  font-size: 12px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.donut-item strong {
  color: #111827;
  font-size: 12px;
  font-weight: 800;
}

.summary-card {
  min-height: 118px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.summary-card-button {
  width: 100%;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.summary-card-button:hover {
  border-color: rgba(98, 193, 62, 0.62);
  box-shadow: 0 16px 34px rgba(28, 63, 58, 0.13);
  transform: translateY(-2px);
}

.summary-card-button:focus-visible,
.home-task-row[data-home-tab]:focus-visible {
  outline: 3px solid rgba(98, 193, 62, 0.34);
  outline-offset: 2px;
}

.summary-card:nth-child(2n) {
  border-top: 4px solid var(--orange);
}

.summary-card:nth-child(2n + 1) {
  border-top: 4px solid var(--primary);
}

.summary-card-head {
  display: flex;
  align-items: center;
  gap: 9px;
}

.summary-icon {
  display: grid;
  flex: 0 0 auto;
  width: 26px;
  height: 26px;
  place-items: center;
  border-radius: 9px;
  background: #edf9e9;
  color: var(--primary-dark);
}

.summary-icon::before {
  width: 14px;
  height: 14px;
}

.summary-card:nth-child(2n) .summary-icon {
  background: var(--orange-soft);
  color: var(--orange);
}

.summary-label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.summary-value {
  margin-top: 8px;
  color: var(--text);
  font-size: 32px;
  font-weight: 900;
  line-height: 1.1;
}

.summary-hint {
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 12px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.form-grid label {
  margin: 0;
}

.archive-filter {
  display: grid;
  grid-template-columns: minmax(260px, 2fr) repeat(3, minmax(140px, 1fr));
  gap: 10px;
  align-items: end;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
  box-shadow: none;
}

.archive-filter label {
  margin: 0;
}

.archive-filter .actions {
  grid-column: 1 / -1;
  justify-content: flex-end;
}

.account-filter {
  grid-template-columns: minmax(240px, 2fr) repeat(2, minmax(150px, 1fr)) auto;
}

.account-filter .actions {
  grid-column: auto;
  justify-content: flex-end;
  align-self: end;
}

.account-search-field {
  position: relative;
}

.account-search-field::before {
  position: absolute;
  bottom: 11px;
  left: 13px;
  z-index: 1;
  width: 18px;
  height: 18px;
  background: #82968f;
  content: '';
  -webkit-mask: var(--icon-search) center / contain no-repeat;
  mask: var(--icon-search) center / contain no-repeat;
  pointer-events: none;
}

#accountFilterForm .account-search-field input {
  padding-left: 40px;
}

.account-filter-summary {
  margin: -4px 2px 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.archive-list {
  margin-top: 2px;
}

.archive-list-head {
  display: flex;
  min-width: 0;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--line-soft);
}

.archive-status-tabs {
  display: flex;
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
}

.archive-status-tabs::-webkit-scrollbar {
  display: none;
}

.archive-status-tab {
  position: relative;
  flex: 0 0 auto;
  min-height: 46px;
  padding: 0 16px;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  transition: color 160ms ease, background-color 160ms ease;
}

.archive-status-tab::after {
  position: absolute;
  right: 10px;
  bottom: -1px;
  left: 10px;
  height: 2px;
  border-radius: 2px;
  background: transparent;
  content: '';
}

.archive-status-tab:hover {
  background: #f8fbfa;
  color: var(--text);
}

.archive-status-tab.active {
  color: var(--primary-dark);
  font-weight: 900;
}

.archive-status-tab.active::after {
  background: var(--primary);
}

.archive-status-tab span {
  display: inline-flex;
  min-width: 20px;
  min-height: 20px;
  margin-left: 5px;
  align-items: center;
  justify-content: center;
  padding: 0 6px;
  border-radius: 6px;
  background: #f1f5f4;
  color: #849791;
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
}

.archive-status-tab.active span {
  background: #edf9e9;
  color: var(--primary-dark);
}

.archive-list-summary {
  flex: 0 0 auto;
  padding: 0 4px 13px 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

#studentsPanel .archive-filter {
  display: block;
  padding: 0;
  overflow: hidden;
  border-radius: 8px;
  box-shadow: none;
}

.archive-filter-main {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) auto auto;
  gap: 0;
  align-items: stretch;
}

.archive-search-field {
  position: relative;
  display: block;
  min-width: 0;
  margin: 0;
}

.archive-search-field > span {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

.archive-search-field::before {
  position: absolute;
  top: 50%;
  left: 17px;
  z-index: 1;
  width: 20px;
  height: 20px;
  transform: translateY(-50%);
  background: #82968f;
  content: '';
  -webkit-mask: var(--icon-search) center / contain no-repeat;
  mask: var(--icon-search) center / contain no-repeat;
  pointer-events: none;
}

#studentsPanel .archive-search-field input {
  min-height: 52px;
  border: 0;
  border-radius: var(--admin-surface-radius) 0 0 var(--admin-surface-radius);
  padding: 0 16px 0 50px;
  background: #fff;
  box-shadow: none;
}

#studentsPanel .archive-search-field input:focus {
  background: #fff;
  box-shadow: inset 0 0 0 2px rgba(98, 193, 62, 0.22);
}

.archive-filter-toggle,
.archive-filter-reset {
  min-height: 52px;
  border-left: 1px solid var(--line-soft);
  border-radius: 0;
  padding: 0 17px;
  background: #fff;
  box-shadow: none;
  color: var(--muted);
}

#studentsPanel .archive-filter-reset {
  border-radius: 0 var(--admin-surface-radius) var(--admin-surface-radius) 0;
}

.archive-filter-toggle::before {
  --icon: var(--icon-filter);
}

.archive-filter-toggle:hover,
.archive-filter-toggle.active,
.archive-filter-reset:hover {
  background: #f7fbf6;
  color: var(--primary-dark);
}

.archive-filter-count {
  display: inline-flex;
  min-width: 20px;
  min-height: 20px;
  align-items: center;
  justify-content: center;
  padding: 0 6px;
  border-radius: 6px;
  background: var(--primary);
  color: #fff;
  font-size: 11px;
  font-weight: 900;
  line-height: 1;
}

.archive-filter-advanced {
  display: grid;
  grid-template-columns: repeat(5, minmax(140px, 1fr));
  gap: 10px;
  padding: 12px;
  border-top: 1px solid var(--line-soft);
  background: #fbfdfc;
}

.archive-filter-advanced label {
  margin: 0;
}

.archive-filter-advanced label span {
  font-size: 12px;
  font-weight: 700;
}

#studentsPanel .archive-filter-advanced input,
#studentsPanel .archive-filter-advanced select {
  min-height: 40px;
  height: 40px;
  border-radius: 7px;
  background-color: #fff;
}

.archive-status-select {
  display: none;
}

.archive-list table {
  min-width: 1080px;
}

.archive-list th {
  min-height: 54px;
  white-space: nowrap;
  line-height: 1.25;
}

.archive-list td {
  height: 72px;
  line-height: 1.4;
}

.archive-list {
  margin-top: 0;
  border-radius: 8px;
  box-shadow: none;
}

.archive-list th,
.archive-list td {
  padding: 11px 13px;
}

.archive-list th {
  background: #fbfcfc;
  color: #72867f;
  font-size: 12px;
  font-weight: 800;
}

.archive-list tbody tr {
  transition: background-color 150ms ease;
}

.archive-list tbody tr:hover td {
  background: #fbfefb;
}

.archive-list td:first-child {
  min-width: 190px;
}

.archive-student-primary {
  display: grid;
  gap: 2px;
}

.archive-student-primary strong {
  color: #1f3531;
  font-size: 14px;
  font-weight: 800;
}

.archive-student-primary small {
  color: #879a94;
  font-size: 11px;
  font-weight: 600;
}

.archive-list .student-meta-pills {
  gap: 4px;
  margin-top: 5px;
}

.archive-list .student-meta-pill {
  min-height: 20px;
  padding: 0 6px;
  border-radius: 5px;
  font-size: 10px;
  font-weight: 800;
}

.archive-list .status-pill {
  min-height: 24px;
  padding: 0 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 800;
}

.archive-list .archive-filing-col,
.archive-list .archive-status-col {
  text-align: center;
}

.archive-form-page {
  display: grid;
  gap: 14px;
}

.archive-form-head {
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: linear-gradient(135deg, #f7fbf4, #ffffff);
  box-shadow: var(--shadow);
}

.archive-form-head h3 {
  margin: 0;
  color: var(--text);
  font-size: 20px;
  font-weight: 900;
  line-height: 1.25;
}

.archive-form-head p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.course-hours-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: linear-gradient(135deg, #f7fbf4, #ffffff);
  box-shadow: var(--shadow);
}

.course-hours-head h3 {
  margin: 0;
  color: var(--text);
  font-size: 20px;
  font-weight: 900;
  line-height: 1.25;
}

.course-hours-head p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.archive-detail {
  margin-top: 4px;
}

.archive-readonly-modal {
  align-items: center;
  overflow-y: auto;
}

.archive-readonly-dialog {
  width: min(1120px, 100%);
  max-height: calc(100vh - 36px);
  margin: 0;
  overflow-y: auto;
}

.archive-readonly {
  display: grid;
  gap: 14px;
  margin-top: 4px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.readonly-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line-soft);
}

.readonly-eyebrow {
  color: var(--primary-dark);
  font-size: 12px;
  font-weight: 900;
}

.readonly-head h3 {
  margin: 4px 0 0;
  color: var(--text);
  font-size: 24px;
  font-weight: 900;
  line-height: 1.2;
}

.readonly-head p {
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.readonly-actions {
  display: flex;
  flex: 0 0 auto;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.readonly-actions .secondary,
.readonly-actions .ghost {
  min-height: 34px;
  border-radius: 12px;
  padding: 0 12px;
}

.readonly-summary,
.readonly-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 10px;
}

.readonly-summary {
  padding: 12px;
  border: 1px solid var(--line-soft);
  border-radius: 14px;
  background: var(--panel-soft);
}

.readonly-section {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line-soft);
  border-radius: 16px;
  background: linear-gradient(180deg, #ffffff, #fbfdfb);
}

.readonly-section h3 {
  margin: 0;
  padding: 0 0 10px;
  border-bottom: 1px solid var(--line-soft);
  color: var(--primary-dark);
  font-size: 14px;
  font-weight: 900;
  line-height: 1.35;
}

.readonly-field {
  display: grid;
  min-height: 62px;
  align-content: start;
  gap: 5px;
  padding: 10px 12px;
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  background: #fff;
}

.readonly-field.wide {
  grid-column: 1 / -1;
}

.readonly-field dt {
  display: flex;
  min-height: 18px;
  align-items: center;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.5;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.readonly-field dd {
  margin: 0;
  color: var(--text);
  font-size: 14px;
  font-weight: 800;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
}

.readonly-rich-text {
  font-weight: 600 !important;
  line-height: 1.75 !important;
}

.readonly-rich-text p {
  margin: 0 0 8px;
}

.readonly-rich-text p:last-child {
  margin-bottom: 0;
}

.readonly-rich-text ol,
.readonly-rich-text ul {
  margin: 0 0 8px;
  padding-left: 24px;
}

.readonly-rich-text li + li {
  margin-top: 4px;
}

.subject-feedback-readonly-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.subject-feedback-readonly-item {
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  background: var(--panel-soft);
}

.subject-feedback-readonly-item strong {
  color: var(--primary-dark);
  font-size: 13px;
  font-weight: 900;
}

.subject-feedback-readonly-item p {
  margin: 7px 0 0;
  color: var(--text);
  font-size: 14px;
  line-height: 1.65;
  white-space: pre-wrap;
  word-break: break-word;
}

.subject-feedback-readonly-empty {
  padding: 12px;
  border: 1px dashed var(--line);
  border-radius: 10px;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

.student-history-section {
  min-width: 0;
}

.student-history-notice {
  padding: 11px 12px;
  border: 1px dashed var(--line);
  border-radius: 10px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.student-history-notice.error {
  border-color: #e2aaa6;
  background: #fff8f7;
  color: #aa4740;
}

.student-timeline {
  display: grid;
  gap: 0;
  padding: 2px 0 2px 4px;
}

.student-timeline-item {
  position: relative;
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 12px;
  min-width: 0;
  padding-bottom: 16px;
}

.student-timeline-item:last-child {
  padding-bottom: 2px;
}

.student-timeline-item::before {
  position: absolute;
  top: 17px;
  bottom: 0;
  left: 8px;
  width: 1px;
  background: var(--line);
  content: '';
}

.student-timeline-item:last-child::before {
  display: none;
}

.student-timeline-marker {
  position: relative;
  z-index: 1;
  display: block;
  width: 11px;
  height: 11px;
  margin-top: 4px;
  border: 3px solid #fff;
  border-radius: 50%;
  background: var(--primary);
  box-shadow: 0 0 0 1px var(--primary);
}

.student-timeline-content {
  min-width: 0;
  padding: 0 0 2px;
}

.student-timeline-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.student-timeline-meta time {
  font-variant-numeric: tabular-nums;
}

.student-timeline-content h4 {
  margin: 4px 0 0;
  color: var(--text);
  font-size: 14px;
  font-weight: 900;
  line-height: 1.45;
}

.student-timeline-content > p {
  margin: 4px 0 0;
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.65;
  white-space: pre-wrap;
  word-break: break-word;
}

.student-timeline-route {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 7px;
  padding: 6px 9px;
  border: 1px solid #dbead4;
  border-radius: 9px;
  background: #f7fbf5;
  color: var(--primary-dark);
  font-size: 12px;
  font-weight: 800;
}

.student-timeline-route strong {
  color: var(--muted);
  font-size: 14px;
}

.student-timeline-details {
  display: flex;
  flex-wrap: wrap;
  gap: 5px 8px;
  margin-top: 7px;
}

.student-timeline-details span {
  max-width: 100%;
  padding: 4px 7px;
  border-radius: 7px;
  background: var(--panel-soft);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
}

.student-timeline-homework-action {
  display: inline-flex;
  margin-top: 8px;
}

.student-course-history-wrap {
  overflow-x: auto;
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  background: #fff;
}

.student-course-history {
  width: 100%;
  min-width: 1000px;
  border-collapse: collapse;
}

.student-course-history th,
.student-course-history td {
  padding: 10px 11px;
  border-bottom: 1px solid var(--line-soft);
  color: var(--text);
  font-size: 12px;
  line-height: 1.5;
  text-align: left;
  vertical-align: middle;
}

.student-course-history th {
  background: var(--panel-soft);
  color: var(--muted);
  font-weight: 900;
  white-space: nowrap;
}

.student-course-history td {
  font-weight: 700;
}

.student-course-history tr:last-child td {
  border-bottom: 0;
}

.student-course-history th:nth-child(6),
.student-course-history td:nth-child(6),
.student-course-history th:nth-child(7),
.student-course-history td:nth-child(7),
.student-course-history th:nth-child(8),
.student-course-history td:nth-child(8) {
  text-align: center;
}

.student-course-history-status {
  display: inline-flex;
  min-width: 58px;
  justify-content: center;
  padding: 4px 7px;
  border-radius: 7px;
  background: #f3f7f4;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  white-space: nowrap;
}

.student-course-history-status.present,
.student-course-history-status.scheduled {
  background: #eef8eb;
  color: #3f8f36;
}

.student-course-history-status.late {
  background: #fff7e9;
  color: #a66b1f;
}

.student-course-history-status.absent,
.student-course-history-status.canceled {
  background: #fff0ef;
  color: #b64d45;
}

.student-course-history-status.leave {
  background: #eef5ff;
  color: #4c78ae;
}

.rich-text-field {
  display: grid;
  gap: 8px;
  margin: 0;
}

.field-label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.rich-text-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  min-height: 34px;
  padding: 6px;
  border: 1px solid var(--line-soft);
  border-bottom: 0;
  border-radius: 14px 14px 0 0;
  background: var(--panel-soft);
}

.rich-text-tool {
  display: inline-flex;
  width: 34px;
  min-height: 30px;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  font-size: 13px;
  font-weight: 900;
}

.rich-text-tool.wide-tool {
  width: auto;
  min-width: 76px;
  padding: 0 10px;
  white-space: nowrap;
}

.writing-insert-select {
  width: auto;
  min-width: 94px;
  height: 32px;
  min-height: 32px;
  padding: 0 26px 0 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  outline: none;
  background-color: var(--field);
  background-position: right 7px center;
  background-size: 14px 14px;
  color: var(--text);
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.writing-insert-select:hover:not(:disabled),
.writing-insert-select:focus-visible {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(98, 193, 62, 0.12);
  color: var(--primary-dark);
}

.writing-insert-select:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.rich-text-tool:hover:not(:disabled),
.rich-text-tool:focus-visible {
  border-color: var(--primary);
  background: #f5fff1;
  color: var(--primary-dark);
}

.rich-text-tool:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.rich-text-editor {
  min-height: 180px;
  padding: 13px 14px;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: 0 0 14px 14px;
  outline: none;
  background: var(--field);
  color: var(--text);
  font-size: 14px;
  line-height: 1.75;
  word-break: break-word;
  white-space: pre-wrap;
}

.rich-text-editor.compact-editor {
  min-height: 132px;
  max-height: 320px;
}

.rich-text-editor:focus {
  border-color: var(--primary);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(98, 193, 62, 0.16);
}

.rich-text-editor:empty::before {
  content: attr(data-placeholder);
  color: #a1b2ad;
  pointer-events: none;
}

.rich-text-editor p {
  min-height: 1.75em;
  margin: 0 0 6px;
}

.rich-text-editor p:last-child {
  margin-bottom: 0;
}

.rich-text-editor ol,
.rich-text-editor ul {
  margin: 0 0 6px;
  padding-left: 24px;
}

.rich-text-editor li + li {
  margin-top: 3px;
}

.writing-preview {
  color: var(--text);
  font-size: 13px;
  line-height: 1.65;
  word-break: break-word;
}

.writing-preview p {
  margin: 0 0 5px;
}

.writing-preview p:last-child,
.writing-preview ol:last-child,
.writing-preview ul:last-child {
  margin-bottom: 0;
}

.writing-preview ol,
.writing-preview ul {
  margin: 0 0 5px;
  padding-left: 21px;
}

.writing-preview sup,
.writing-preview sub,
.readonly-rich-text sup,
.readonly-rich-text sub {
  font-size: 0.78em;
  line-height: 0;
}

.readonly-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line-soft);
  border-radius: 14px;
  background: #fff;
}

.readonly-table {
  width: 100%;
  min-width: 560px;
  table-layout: fixed;
  border-collapse: collapse;
}

.readonly-table th,
.readonly-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line-soft);
  color: var(--text);
  text-align: left;
  vertical-align: middle;
}

.readonly-table th {
  background: var(--panel-soft);
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.readonly-table td {
  font-size: 13px;
  font-weight: 700;
}

.readonly-table th:not(:first-child),
.readonly-table td:not(:first-child) {
  text-align: center;
}

.readonly-table tr:last-child td {
  border-bottom: 0;
}

.student-section-title {
  padding-top: 6px;
  border-top: 1px solid var(--line-soft);
  color: var(--primary-dark);
  font-size: 13px;
  font-weight: 900;
}

.student-section-title:first-of-type {
  padding-top: 0;
  border-top: 0;
}

.service-tags-field {
  display: grid;
  gap: 8px;
  margin: 0;
}

.payment-status-field {
  display: grid;
  gap: 8px;
  margin: 0;
}

.payment-status-field > span,
.payment-status-field > small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.payment-status-field > small {
  font-weight: 600;
}

.payment-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.payment-option {
  display: inline-flex;
  min-height: 36px;
  align-items: center;
  gap: 7px;
  margin: 0;
  padding: 6px 12px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
}

.payment-option:has(input:checked) {
  border-color: var(--primary);
  background: #f3fbef;
  color: var(--primary-dark);
}

.payment-option input:checked + span {
  color: var(--primary-dark);
}

.payment-option input {
  width: 16px;
  min-height: 16px;
  margin: 0;
}

.gift-course-remark-field {
  grid-column: span 2;
}

.service-tags-field > span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.service-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.service-tag-option {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  gap: 6px;
  margin: 0;
  padding: 6px 10px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
}

.service-tag-option input {
  width: 16px;
  min-height: 16px;
}

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

.subject-feedback-editor {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel-soft);
}

.subject-feedback-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.subject-feedback-head > div {
  display: grid;
  gap: 3px;
}

.subject-feedback-head strong {
  color: var(--text);
  font-size: 13px;
  font-weight: 900;
}

.subject-feedback-head span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

#addSubjectFeedbackButton {
  flex: 0 0 auto;
  min-height: 34px;
  padding: 0 13px;
}

#addSubjectFeedbackButton::before {
  --icon: var(--icon-plus);
}

.subject-feedback-list {
  display: grid;
  gap: 10px;
}

.subject-feedback-row {
  display: grid;
  grid-template-columns: minmax(150px, 0.32fr) minmax(0, 1fr) 34px;
  gap: 12px;
  align-items: end;
  padding: 12px;
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  background: #fff;
}

.subject-feedback-row label {
  min-width: 0;
  margin: 0;
}

.subject-feedback-row textarea {
  min-height: 86px;
  resize: vertical;
}

.subject-feedback-remove {
  align-self: end;
  margin-bottom: 0;
}

.subject-feedback-remove::before {
  content: none;
}

.subject-feedback-empty {
  padding: 12px;
  border: 1px dashed var(--line);
  border-radius: 10px;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

.student-subject-row {
  display: grid;
  align-items: end;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  background: var(--panel-soft);
}

.student-subject-row {
  grid-template-columns: 42px repeat(2, minmax(0, 1fr));
}

.student-subject-row strong {
  padding-bottom: 9px;
  color: var(--text);
  font-size: 13px;
}

.student-subject-row label span {
  font-size: 11px;
}

.student-subject-row input {
  min-width: 0;
}

.role-hint {
  padding: 12px 14px;
  border: 1px solid rgba(98, 193, 62, 0.2);
  border-radius: 14px;
  background: #f3fbef;
  color: #3f6f35;
  font-size: 13px;
  font-weight: 800;
}

.change-request-form {
  border-color: rgba(255, 112, 67, 0.24);
  background: #fffdfb;
}

.change-request-form .role-hint {
  border-color: rgba(255, 112, 67, 0.22);
  background: var(--orange-soft);
  color: #b94a28;
}

.schedule-week-heading {
  padding-top: 0;
}

.schedule-board-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 12px 16px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.schedule-board-toolbar label {
  display: grid;
  gap: 5px;
  min-width: 150px;
}

.schedule-board-toolbar label span,
.schedule-board-legend {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.schedule-board-toolbar input,
.schedule-board-toolbar select {
  min-height: 38px;
  border-color: var(--field-border);
  background-color: var(--field);
}

.schedule-board-legend {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 38px;
  margin-left: auto;
}

.schedule-board-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.legend-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--primary);
}

.legend-dot.history {
  background: #a0aec0;
}

.monthly-schedule {
  --month-time-width: 92px;
  --month-day-width: 152px;
  overflow-x: auto;
  border-radius: 10px;
}

.month-grid {
  min-width: calc(var(--month-time-width) + var(--month-day-width) * var(--month-day-count));
}

.month-grid-head,
.month-grid-row {
  display: grid;
  grid-template-columns: var(--month-time-width) repeat(var(--month-day-count), minmax(var(--month-day-width), 1fr));
}

.month-grid-head {
  position: sticky;
  top: 0;
  z-index: 5;
  min-height: 64px;
  border-bottom: 1px solid var(--line);
  background: var(--panel-soft);
}

.month-corner,
.month-time-cell {
  display: grid;
  align-content: center;
  gap: 2px;
  padding: 9px 12px;
  background: #fbfefd;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.month-day-head {
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 2px;
  min-height: 64px;
  border-left: 1px solid var(--line-soft);
  color: var(--muted);
}

.month-day-head.today {
  background: #f3fbef;
  color: var(--primary-dark);
}

.month-day-head strong {
  color: var(--text);
  font-size: 17px;
  font-weight: 900;
}

.month-day-head span {
  font-size: 11px;
  font-weight: 800;
}

.month-grid-row {
  min-height: 126px;
  border-bottom: 1px solid var(--line-soft);
}

.month-grid-row:last-child {
  border-bottom: 0;
}

.month-time-cell {
  position: sticky;
  left: 0;
  z-index: 3;
  min-height: 126px;
  border-right: 1px solid var(--line);
}

.month-time-cell strong {
  color: var(--text);
  font-size: 14px;
}

.month-time-cell span {
  color: var(--muted);
  font-size: 11px;
}

.month-course-cell {
  display: grid;
  align-content: start;
  gap: 6px;
  min-width: 0;
  min-height: 126px;
  padding: 8px;
  border-left: 1px solid var(--line-soft);
  background: #fff;
}

.month-course-cell.today {
  background: #fbfff8;
}

.month-empty-mark {
  align-self: center;
  justify-self: center;
  color: #c9d8d3;
  font-size: 18px;
}

.month-course-card {
  display: grid;
  gap: 3px;
  min-width: 0;
  padding: 8px 9px;
  border: 1px solid rgba(98, 193, 62, 0.28);
  border-left: 3px solid var(--primary);
  border-radius: 7px;
  background: #f7fff4;
  box-shadow: 0 5px 14px rgba(28, 63, 58, 0.07);
}

.month-course-card.history {
  border-color: rgba(160, 174, 192, 0.28);
  border-left-color: #a0aec0;
  background: #f8faf9;
}

.month-course-time,
.month-course-subject,
.month-course-place {
  overflow: hidden;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.month-course-time {
  color: var(--orange);
}

.month-course-student {
  overflow: hidden;
  color: var(--text);
  font-size: 13px;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.month-course-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 3px 6px;
  padding-top: 3px;
}

.month-course-actions .link-button {
  min-height: 21px;
  margin: 0;
  padding: 0 3px;
  font-size: 11px;
}

.month-course-actions .attendance-select {
  height: 24px;
  min-height: 24px;
  min-width: 68px;
  margin: 0;
  font-size: 10px;
}

.teacher-home-schedule {
  display: grid;
  gap: 0;
}

.weekly-schedule {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--panel);
  box-shadow: var(--shadow);
  --week-time-width: 88px;
  --week-day-width: 156px;
}

.week-grid {
  min-width: calc(var(--week-time-width) + var(--week-day-width) * 7);
}

.week-grid-head,
.week-period {
  display: grid;
  grid-template-columns: var(--week-time-width) repeat(7, minmax(var(--week-day-width), 1fr));
}

.week-grid-head {
  position: sticky;
  top: 0;
  z-index: 4;
  border-bottom: 1px solid var(--line);
  background: var(--panel-soft);
}

.week-grid-head::before {
  content: "时间";
  display: flex;
  min-height: 58px;
  align-items: center;
  padding: 0 14px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.week-day-head {
  display: grid;
  align-content: center;
  gap: 2px;
  min-height: 58px;
  padding: 10px 12px;
  border-left: 1px solid var(--line-soft);
  background: var(--panel-soft);
}

.week-day-head.today {
  background: #f3fbef;
}

.week-day-head strong {
  color: var(--text);
  font-size: 15px;
  font-weight: 900;
}

.week-day-head.today strong {
  color: var(--primary-dark);
}

.week-day-head span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.week-period {
  border-bottom: 1px solid var(--line-soft);
}

.week-period:last-child {
  border-bottom: 0;
}

.week-period-title {
  display: grid;
  align-content: start;
  gap: 4px;
  min-height: 210px;
  padding: 18px 14px;
  background: #fbfefd;
}

.week-period-title strong {
  color: var(--text);
  font-size: 16px;
  font-weight: 900;
}

.week-period-title span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.week-period-grid {
  display: contents;
}

.week-day-cell {
  display: grid;
  align-content: start;
  gap: 10px;
  min-height: 210px;
  padding: 12px;
  border-left: 1px solid var(--line-soft);
  background: linear-gradient(180deg, #ffffff 0%, #fbfefd 100%);
}

.week-day-cell.today {
  background: linear-gradient(180deg, #f8fff5 0%, #fbfefd 100%);
}

.week-empty-text {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.week-course {
  z-index: 2;
  display: grid;
  gap: 4px;
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid rgba(98, 193, 62, 0.28);
  border-left: 4px solid var(--primary);
  border-radius: 12px;
  background: #f7fff4;
  box-shadow: 0 10px 24px rgba(28, 63, 58, 0.1);
}

.week-course.history {
  border-color: rgba(160, 174, 192, 0.25);
  border-left-color: #a0aec0;
  background: #f8faf9;
}

.week-course-time {
  color: var(--orange);
  font-size: 12px;
  font-weight: 900;
}

.week-course-title,
.week-course-student {
  overflow: hidden;
  color: var(--text);
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.week-course-title {
  font-size: 13px;
}

.week-course-student {
  font-size: 14px;
}

.week-course-meta,
.week-course-footer {
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.week-course-footer {
  display: flex;
  align-items: center;
  gap: 8px;
}

.week-course-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 8px;
  padding-top: 4px;
}

.week-course-actions .link-button {
  min-height: 22px;
  margin: 0;
  font-size: 12px;
}

.week-course-actions .attendance-select {
  height: 26px;
  min-height: 26px;
  min-width: 72px;
  margin: 0;
  font-size: 11px;
}

.wide {
  grid-column: 1 / -1;
}

.actions {
  display: flex;
  gap: 10px;
}

.table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: none;
}

table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
}

th,
td {
  border-bottom: 1px solid var(--line-soft);
  padding: 11px 13px;
  text-align: left;
  vertical-align: middle;
}

th {
  background: #fbfcfc;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

td {
  color: var(--text);
}

tbody tr {
  transition: background-color 150ms ease;
}

tbody tr:hover td {
  background: #fbfefb;
}

small {
  color: var(--muted);
}

.muted-text {
  color: var(--muted);
  font-size: 13px;
}

.section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px 8px;
}

.section-heading h3 {
  margin: 0;
  color: var(--text);
  font-size: 18px;
  font-weight: 900;
}

.section-heading p {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.status-pill {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  justify-content: center;
  padding: 0 8px;
  border-radius: 6px;
  background: #edf9e9;
  color: var(--primary-dark);
  font-size: 11px;
  font-weight: 900;
  white-space: nowrap;
}

.status-pill.pending,
.status-pill.submitted {
  background: var(--orange-soft);
  color: #c84f2b;
}

.status-pill.graded,
.status-pill.approved,
.status-pill.present {
  background: #edf9e9;
  color: var(--primary-dark);
}

.status-pill.late {
  background: var(--orange-soft);
  color: #c84f2b;
}

.status-pill.leave {
  background: #f4f7f6;
  color: var(--muted);
}

.status-pill.rejected,
.status-pill.absent {
  background: #fee2e2;
  color: var(--danger);
}

.status-pill.filing {
  background: #fff4df;
  color: #a45a00;
}

.status-pill.archive-draft {
  background: #eef5ff;
  color: #2b5fa8;
}

.status-pill.archive-pending {
  background: #fff4df;
  color: #a45a00;
}

.status-pill.archive-accepted {
  background: #edf9e9;
  color: #3f8f2e;
}

.status-pill.archive-scheduled {
  background: #e8f7f5;
  color: #16756c;
}

.status-pill.archive-sealed {
  background: #eef1f3;
  color: #65727a;
}

.status-pill.login-locked {
  margin-top: 6px;
  background: #fee2e2;
  color: var(--danger);
}

.account-lock-note {
  display: block;
  margin-top: 4px;
  color: var(--danger);
  font-weight: 800;
}

.student-meta-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}

.student-meta-pill {
  display: inline-flex;
  min-height: 22px;
  align-items: center;
  justify-content: center;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 900;
  line-height: 1;
  white-space: nowrap;
}

.student-meta-pill.studying {
  background: #edf9e9;
  color: var(--primary-dark);
}

.student-meta-pill.graduated {
  background: var(--orange-soft);
  color: #c84f2b;
}

.student-meta-pill.service {
  background: #f4f7f6;
  color: var(--muted);
}

.schedule-history-wrap {
  margin-bottom: 14px;
}

tr:last-child td {
  border-bottom: 0;
}

.home-task-row[data-home-tab] {
  cursor: pointer;
  transition: background-color 160ms ease;
}

.home-task-row[data-home-tab]:hover td {
  background: #f7fcf5;
}

.home-task-section {
  display: grid;
  gap: 12px;
}

.home-task-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  padding: 0 2px;
}

.home-section-eyebrow {
  display: block;
  color: var(--primary-dark);
  font-size: 11px;
  font-weight: 900;
}

.home-task-heading h3 {
  margin: 5px 0 0;
  color: #0a1629;
  font-size: 18px;
  font-weight: 800;
}

.home-task-heading p {
  margin: 0;
  color: #718096;
  font-size: 12px;
  font-weight: 600;
}

.home-task-wrap {
  overflow: hidden;
  border-color: #eef1f4;
  background: #fff;
  box-shadow: 0 8px 24px rgba(17, 24, 39, 0.04);
}

.home-task-table {
  min-width: 0;
  table-layout: fixed;
}

.home-task-table th,
.home-task-table td {
  padding: 13px 16px;
}

.home-task-table th:nth-child(1),
.home-task-table td:nth-child(1) {
  width: 31%;
}

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

.home-task-table th:nth-child(3),
.home-task-table td:nth-child(3) {
  width: 51%;
}

.home-task-table td:first-child {
  color: #0a1629;
  font-size: 14px;
  font-weight: 800;
}

.home-task-table td:nth-child(2) {
  color: #111827;
  font-size: 20px;
  font-weight: 800;
  line-height: 1.2;
}

.home-task-table td:nth-child(3) {
  color: #718096;
  font-size: 12px;
  font-weight: 600;
}

.home-task-table tbody tr:last-child td {
  border-bottom: 0;
}

.row-actions {
  min-width: 132px;
  white-space: normal;
}

.link-button {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  gap: 4px;
  margin: 0 10px 4px 0;
  padding: 0;
  background: transparent;
  color: var(--primary-dark);
  font-weight: 800;
  line-height: 1;
}

.link-button::before {
  width: 14px;
  height: 14px;
  --icon: var(--icon-edit);
}

.link-button[data-view-student]::before {
  --icon: var(--icon-archive);
}

.link-button[data-submit-student]::before,
.link-button[data-change-schedule-id]::before,
.link-button[data-review-homework-id]::before,
.link-button[data-request-unseal-student]::before {
  --icon: var(--icon-send);
}

.link-button[data-quick-student-account]::before {
  --icon: var(--icon-plus);
}

.link-button[data-unlock-account-login]::before {
  --icon: var(--icon-check);
}

.link-button[data-adjust-course-hours]::before {
  --icon: var(--icon-clock);
}

.link-button[data-accept-student]::before,
.link-button[data-unseal-student]::before,
.link-button[data-attendance="present"]::before {
  --icon: var(--icon-check);
}

.link-button[data-attendance="late"]::before,
.link-button[data-attendance="leave"]::before {
  --icon: var(--icon-clock);
}

.link-button[data-delete-student]::before,
.link-button[data-delete-teacher]::before,
.link-button[data-delete-account]::before,
.link-button[data-seal-student]::before,
.link-button.danger::before,
.link-button[data-attendance="absent"]::before {
  --icon: var(--icon-trash);
}

.link-button:hover {
  color: var(--orange);
}

.link-button.danger {
  color: var(--danger);
}

@media (max-width: 900px), (max-height: 680px) {
  .login-view {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    gap: 18px;
    min-height: 100svh;
    padding: 28px 18px 18px;
  }

  .login-view::before {
    height: min(34vh, 300px);
  }

  .login-view::after {
    top: -120px;
    right: -150px;
    width: 380px;
    height: 380px;
  }

  .login-corner-brand {
    position: static;
    align-self: center;
  }

  .login-card-stack {
    margin-top: auto;
    margin-bottom: auto;
    transform: translateY(-18px);
  }

  .login-copyright {
    position: relative;
    right: auto;
    bottom: auto;
    left: auto;
    width: 100%;
    margin: 0;
    padding-top: 4px;
  }

  .brand-logo-login-corner {
    width: 226px;
    max-height: 58px;
  }
}

@media (max-width: 900px) {
  .toast-host {
    top: 12px;
    right: 12px;
    left: 12px;
    width: auto;
    transform: none;
  }

  .login-card-stack {
    width: min(380px, 100%);
  }

  .login-panel {
    padding: 28px 22px 24px;
    border-radius: 22px;
  }

  .login-card-back {
    border-radius: 22px;
    transform: translate(4px, 5px);
  }

  .login-title {
    margin-bottom: 22px;
  }

  .login-title h1 {
    font-size: 23px;
  }

  .dashboard {
    display: block;
  }

  .sidebar {
    border-right: 0;
    border-bottom: 1px solid var(--line);
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px 12px;
    position: sticky;
    top: 0;
    z-index: 20;
    height: auto;
    min-height: 0;
    padding: 12px 14px 10px;
    box-shadow: 0 8px 22px rgba(28, 63, 58, 0.08);
  }

  .sidebar::before {
    display: none;
  }

  .brand.compact {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    margin-bottom: 0;
  }

  .brand-logo-sidebar {
    width: 34px;
    height: 34px;
  }

  .brand.compact h1 {
    font-size: 16px;
    line-height: 1.2;
  }

  .brand.compact p {
    max-width: 130px;
    overflow: hidden;
    font-size: 12px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .tabs {
    grid-column: 1 / -1;
    display: flex;
    gap: 8px;
    margin: 0;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 2px 0 4px;
    scrollbar-width: none;
  }

  #logoutButton {
    grid-column: 2;
    grid-row: 1;
    align-self: center;
    margin-top: 0;
  }

  .tabs::-webkit-scrollbar {
    display: none;
  }

  .tab {
    flex: 0 0 auto;
    justify-content: center;
    min-height: 34px;
    border-radius: 999px;
    padding: 0 14px;
    text-align: center;
    white-space: nowrap;
  }

  .tab.active {
    box-shadow: inset 0 -3px 0 var(--primary);
  }

  .ghost {
    min-height: 34px;
    padding: 0 12px;
    border-radius: 999px;
    background: #f2f7f0;
    text-align: center;
    white-space: nowrap;
  }

  .content {
    padding: 14px;
  }

  .form-grid {
    grid-template-columns: 1fr;
    gap: 10px;
    padding: 14px;
    border-radius: 16px;
  }

  .archive-filter {
    grid-template-columns: 1fr;
  }

  .archive-list-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 0;
  }

  .archive-status-tabs {
    width: 100%;
  }

  .archive-status-tab {
    min-height: 44px;
    padding: 0 12px;
  }

  .archive-list-summary {
    padding: 10px 4px 11px;
  }

  .archive-filter-main {
    grid-template-columns: 1fr auto auto;
  }

  .archive-filter-advanced {
    grid-template-columns: 1fr;
  }

  .handover-hero {
    align-items: flex-start;
    flex-direction: column;
    padding: 16px;
    border-radius: 16px;
  }

  .handover-form {
    padding: 14px;
    border-radius: 16px;
  }

  .handover-route {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .handover-arrow {
    min-height: 24px;
    transform: rotate(90deg);
  }

  .handover-route .primary {
    width: 100%;
  }

  .handover-list-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }

  .archive-readonly {
    padding: 14px;
    border-radius: 16px;
  }

  .archive-readonly-dialog {
    max-height: calc(100vh - 24px);
  }

  .readonly-head {
    flex-direction: column;
  }

  .readonly-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .readonly-summary,
  .readonly-grid {
    grid-template-columns: 1fr;
  }

  .readonly-field.wide {
    grid-column: 1 / -1;
  }

  .student-timeline-item {
    grid-template-columns: 16px minmax(0, 1fr);
    gap: 9px;
  }

  .student-timeline-item::before {
    left: 7px;
  }

  .student-timeline-details {
    display: grid;
    grid-template-columns: 1fr;
  }

  .student-timeline-details span {
    width: 100%;
  }

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

  .gift-course-remark-field {
    grid-column: auto;
  }

  .subject-feedback-head {
    align-items: stretch;
    flex-direction: column;
  }

  #addSubjectFeedbackButton {
    width: 100%;
  }

  .subject-feedback-row {
    grid-template-columns: minmax(0, 1fr) 34px;
    gap: 10px;
  }

  .subject-feedback-content-field {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .subject-feedback-remove {
    grid-column: 2;
    grid-row: 1;
  }

  .subject-feedback-readonly-list {
    grid-template-columns: 1fr;
  }

  .student-subject-row {
    grid-template-columns: 38px repeat(2, minmax(0, 1fr));
  }

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

  .admin-dashboard-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
  }

  .admin-dashboard-updated {
    width: 100%;
  }

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

  .admin-lead-card {
    min-height: 196px;
    padding: 22px 20px;
  }

  .admin-lead-value strong {
    font-size: 54px;
  }

  .admin-lead-mark {
    flex-basis: 96px;
  }

  .admin-section-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 5px;
  }

  .kpi-grid,
  .chart-grid {
    grid-template-columns: 1fr;
  }

  .kpi-card {
    min-height: 104px;
    padding: 14px;
  }

  .chart-panel {
    padding: 16px 12px 12px;
  }

  .chart-svg,
  .line-svg {
    min-height: 210px;
  }

  .donut-chart {
    grid-template-columns: 1fr;
    justify-items: center;
  }

  .donut-list {
    width: 100%;
  }

  .summary-card {
    min-height: 96px;
    padding: 14px;
    border-radius: 16px;
  }

  .summary-value {
    font-size: 26px;
  }

  .content-header {
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 14px;
    padding: 16px;
    border-radius: 16px;
  }

  .content-header h2 {
    font-size: 22px;
  }

  .content-header .secondary {
    width: auto;
  }

  .header-actions {
    width: 100%;
    justify-content: space-between;
  }

  .profile-button {
    min-width: 0;
    max-width: calc(100% - 76px);
  }

  .profile-dept {
    min-width: 0;
    max-width: 150px;
    min-height: 34px;
    padding: 0 12px;
    font-size: 13px;
  }

  .profile-center-label {
    font-size: 12px;
  }

  .panel {
    gap: 14px;
  }

  .weekly-schedule {
    --week-time-width: 76px;
    --week-day-width: 138px;
    border-radius: 16px;
  }

  .monthly-schedule {
    --month-time-width: 76px;
    --month-day-width: 132px;
    border-radius: 10px;
  }

  .schedule-board-legend {
    width: 100%;
    margin-left: 0;
  }

  .week-grid-head::before,
  .week-period-title,
  .week-day-head,
  .week-day-cell {
    padding-right: 10px;
    padding-left: 10px;
  }

  .table-wrap {
    border-radius: 8px;
  }

  th,
  td {
    padding: 10px 12px;
  }
}

/* Daily schedule view: keep each time slot readable while exposing the complete course record. */
.schedule-day-navigation {
  display: flex;
  align-items: end;
  gap: 8px;
}

.schedule-day-navigation .secondary {
  min-height: 38px;
  padding: 0 12px;
  white-space: nowrap;
}

.schedule-board-date {
  min-width: 158px;
}

.schedule-board-keyword {
  min-width: 220px;
  flex: 1 1 240px;
}

.schedule-board-academic {
  min-width: 150px;
}

.schedule-board-subject,
.schedule-board-campus {
  min-width: 118px;
}

.schedule-day-strip {
  display: grid;
  grid-template-columns: repeat(7, minmax(92px, 1fr));
  gap: 8px;
}

.schedule-day-chip {
  display: grid;
  justify-items: center;
  gap: 2px;
  min-height: 50px;
  padding: 7px 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: var(--muted);
  cursor: pointer;
}

.schedule-day-chip strong {
  color: var(--text);
  font-size: 14px;
}

.schedule-day-chip span {
  font-size: 11px;
  font-weight: 800;
}

.schedule-day-chip:hover,
.schedule-day-chip:focus-visible {
  border-color: rgba(98, 193, 62, 0.55);
  background: #f7fff4;
}

.schedule-day-chip.active {
  border-color: var(--primary);
  background: var(--primary);
  color: #fff;
  box-shadow: 0 5px 12px rgba(98, 193, 62, 0.2);
}

.schedule-day-chip.active strong,
.schedule-day-chip.active span {
  color: #fff;
}

.schedule-day-chip.weekend:not(.active) {
  background: #edf5fb;
}

.daily-schedule-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  background: #fbfefd;
}

.daily-schedule-head > div:first-child {
  display: grid;
  gap: 3px;
}

.daily-schedule-head strong {
  color: var(--text);
  font-size: 16px;
  font-weight: 900;
}

.daily-schedule-head span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.daily-schedule-total {
  display: flex;
  align-items: baseline;
  gap: 5px;
  color: var(--muted);
}

.daily-schedule-total strong {
  color: var(--primary-dark);
  font-size: 20px;
}

.daily-schedule-list {
  overflow-x: auto;
}

.daily-schedule-slot {
  display: grid;
  grid-template-columns: 92px minmax(920px, 1fr);
  min-height: 96px;
  border-bottom: 1px solid var(--line-soft);
}

.daily-schedule-slot:last-child {
  border-bottom: 0;
}

.daily-schedule-slot.lunch {
  background: #fbfef8;
}

.daily-slot-time {
  display: grid;
  align-content: center;
  gap: 3px;
  padding: 12px;
  border-right: 1px solid var(--line);
  background: #fbfefd;
}

.daily-schedule-slot.lunch .daily-slot-time {
  background: #e8f5dc;
}

.daily-slot-time strong {
  color: var(--text);
  font-size: 14px;
}

.daily-slot-time span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.daily-slot-courses {
  display: grid;
  align-content: center;
  gap: 7px;
  padding: 8px 10px;
}

.daily-slot-empty {
  color: #a7bab5;
  font-size: 12px;
  font-weight: 800;
}

.quick-schedule-inline {
  min-height: 26px;
  margin-left: 8px;
  padding: 0 9px;
  border: 1px dashed #bfd5ce;
  border-radius: 4px;
  background: transparent;
  color: #72928a;
  font-size: 11px;
  font-weight: 900;
  cursor: pointer;
}

.quick-schedule-inline:hover,
.quick-schedule-inline:focus-visible {
  border-color: var(--primary);
  background: #f3fbef;
  color: var(--primary-dark);
}

.daily-course-row {
  display: grid;
  grid-template-columns: 190px minmax(170px, 1.35fr) 125px 135px 135px 100px max-content;
  align-items: center;
  gap: 12px;
  min-height: 78px;
  padding: 9px 12px;
  border: 1px solid rgba(98, 193, 62, 0.24);
  border-left: 3px solid var(--primary);
  border-radius: 6px;
  background: #f8fff5;
}

.daily-course-row.history {
  border-color: rgba(160, 174, 192, 0.3);
  border-left-color: #a0aec0;
  background: #fafbfc;
}

.daily-course-main,
.daily-course-field,
.daily-course-status {
  display: grid;
  align-content: center;
  gap: 3px;
  min-width: 0;
}

.daily-course-main {
  gap: 4px;
}

.daily-course-main strong {
  overflow: hidden;
  color: var(--text);
  font-size: 14px;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.daily-course-main span,
.daily-course-main small,
.daily-course-field span,
.daily-course-field small,
.daily-course-status small {
  overflow: hidden;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.daily-course-field {
  padding-left: 12px;
  border-left: 1px solid var(--line-soft);
}

.daily-course-field strong {
  overflow: hidden;
  color: var(--text);
  font-size: 12px;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.daily-course-time strong {
  color: var(--orange);
}

.daily-course-status {
  justify-items: start;
}

.daily-course-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 4px 8px;
}

.daily-course-actions .link-button {
  min-height: 24px;
  padding: 0 3px;
  font-size: 11px;
}

.attendance-select {
  flex: 0 0 auto;
  width: auto;
  min-width: 72px;
  height: 28px;
  min-height: 28px;
  border-radius: 6px;
  padding: 0 26px 0 8px;
  background-color: #fff;
  font-size: 11px;
  font-weight: 800;
}

@media (max-width: 900px) {
  .schedule-board-toolbar {
    align-items: stretch;
  }

  .schedule-day-navigation {
    width: 100%;
    align-items: end;
  }

  .schedule-day-navigation .schedule-board-date {
    flex: 1;
  }

  .schedule-board-keyword,
  .schedule-board-academic,
  .schedule-board-teacher,
  .schedule-board-grade,
  .schedule-board-subject,
  .schedule-board-campus {
    min-width: calc(50% - 8px);
  }

  .schedule-day-strip {
    overflow-x: auto;
    grid-template-columns: repeat(7, 82px);
  }

  .daily-schedule-head {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (max-width: 480px) {
  .schedule-day-navigation .secondary {
    padding: 0 8px;
    font-size: 11px;
  }

  .schedule-board-keyword,
  .schedule-board-academic,
  .schedule-board-teacher,
  .schedule-board-grade,
  .schedule-board-subject,
  .schedule-board-campus {
    min-width: 100%;
  }
}

/* Keep the schedule filters aligned as a deliberate two-row toolbar. */
.schedule-board-toolbar {
  display: grid;
  grid-template-columns: minmax(360px, 1.4fr) minmax(260px, 1fr);
  align-items: end;
  gap: 12px;
}

.schedule-board-toolbar > label {
  min-width: 0;
  margin-bottom: 0;
}

.schedule-day-navigation {
  display: grid;
  grid-template-columns: 76px minmax(140px, 1fr) 76px 54px;
  align-items: end;
  gap: 8px;
  min-width: 0;
}

.schedule-day-navigation .schedule-board-date {
  min-width: 0;
  margin-bottom: 0;
}

.schedule-day-navigation > .secondary,
.schedule-day-navigation .schedule-board-date input {
  height: 38px;
  min-height: 38px;
  box-sizing: border-box;
}

.schedule-filter-fields label {
  margin-bottom: 0;
}

.schedule-day-navigation .secondary {
  width: 100%;
  min-width: 0;
  padding: 0 8px;
  white-space: nowrap;
}

.schedule-filter-fields {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  align-items: end;
  gap: 12px;
}

.schedule-board-legend {
  grid-column: 1 / -1;
  justify-content: flex-start;
  min-height: 26px;
  margin-left: 0;
}

.daily-schedule-slot {
  align-items: stretch;
  min-height: 96px;
}

.daily-slot-time {
  align-content: start;
  padding-top: 18px;
}

.daily-slot-time em {
  display: inline-flex;
  width: max-content;
  margin-top: 4px;
  padding: 2px 5px;
  border-radius: 4px;
  background: #eef5f1;
  color: var(--muted);
  font-size: 10px;
  font-style: normal;
  font-weight: 900;
}

.daily-schedule-slot.lunch .daily-slot-time em {
  background: #dceecb;
}

.daily-slot-courses {
  align-content: start;
  min-height: 78px;
}

.daily-course-row {
  min-width: 920px;
}

@media (max-width: 1200px) and (min-width: 901px) {
  .schedule-board-toolbar {
    grid-template-columns: minmax(320px, 1.2fr) minmax(220px, 1fr);
  }

  .schedule-filter-fields {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .schedule-board-legend {
    grid-column: 1 / -1;
  }
}

@media (max-width: 900px) {
  .schedule-board-toolbar {
    grid-template-columns: 1fr;
  }

  .schedule-day-navigation,
  .schedule-board-keyword,
  .schedule-board-legend {
    grid-column: 1 / -1;
  }

  .schedule-board-toolbar > label {
    width: auto;
  }

  .schedule-filter-fields {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 480px) {
  .schedule-day-navigation {
    grid-template-columns: 64px minmax(0, 1fr) 64px 48px;
    gap: 5px;
  }

  .schedule-filter-fields {
    grid-template-columns: 1fr;
  }
}

/* Final schedule filter override: date and search controls stay adjacent. */
.schedule-board-toolbar {
  grid-template-columns: max-content minmax(280px, 360px);
  column-gap: 12px;
}

.schedule-board-toolbar > .schedule-date-filter,
.schedule-board-toolbar > .schedule-board-keyword {
  grid-row: 1;
}

.schedule-date-filter {
  width: max-content;
}

#schedulesPanel .schedule-board-keyword input {
  width: 100%;
  padding-left: 42px;
  background: #fff;
}

#schedulesPanel .schedule-board-keyword::before {
  top: 50%;
  bottom: auto;
  transform: translateY(3px);
}

@media (max-width: 900px) {
  .schedule-board-toolbar {
    grid-template-columns: 1fr;
  }

  .schedule-board-toolbar > .schedule-date-filter,
  .schedule-board-toolbar > .schedule-board-keyword {
    grid-row: auto;
  }

  .schedule-date-filter,
  .schedule-board-keyword {
    width: 100%;
  }
}

/* Dense timetable cards: each slot fills a row before wrapping to the next row. */
.daily-schedule-slot {
  grid-template-columns: 92px minmax(0, 1fr);
}

.daily-slot-courses {
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  align-content: start;
  align-items: stretch;
  gap: 6px;
  padding: 6px 8px;
}

.daily-course-row {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  min-width: 0;
  min-height: 0;
  align-content: start;
  gap: 5px 8px;
  padding: 7px 8px;
  border-top: 2px solid var(--student-accent, var(--primary));
  border-left: 1px solid var(--student-border, rgba(98, 193, 62, 0.3));
  background: var(--student-surface, #f8fff5);
}

.daily-course-row .daily-course-main,
.daily-course-row .daily-course-actions {
  grid-column: 1 / -1;
}

.daily-course-row .daily-course-main {
  padding-bottom: 4px;
  border-bottom: 1px solid var(--student-border, rgba(98, 193, 62, 0.22));
}

.daily-course-row .daily-course-main strong {
  font-size: 14px;
}

.daily-course-row .daily-course-field {
  padding-left: 6px;
  border-left-color: var(--student-border, var(--line-soft));
}

.daily-course-row .daily-course-field strong {
  font-size: 11px;
  white-space: normal;
  line-height: 1.25;
}

.daily-course-row .daily-course-status {
  align-self: center;
  grid-column: 1 / -1;
  padding-top: 0;
}

.daily-course-row .daily-course-actions {
  justify-content: flex-start;
  grid-column: 2;
  align-self: center;
  padding-top: 0;
  border-top: 0;
}

.daily-course-row.has-actions .daily-course-status {
  grid-column: 1;
}

.daily-course-row.has-actions .daily-course-actions {
  justify-content: flex-end;
}

.daily-course-row.history {
  background: var(--student-surface, #fafbfc);
}

.daily-course-row.student-color-0 {
  --student-accent: #4a9b68;
  --student-border: #b8dcc5;
  --student-surface: #f1faf4;
}

.daily-course-row.student-color-1 {
  --student-accent: #4d83bd;
  --student-border: #bdd3e9;
  --student-surface: #f1f7fd;
}

.daily-course-row.student-color-2 {
  --student-accent: #d28a32;
  --student-border: #ead0a8;
  --student-surface: #fff8eb;
}

.daily-course-row.student-color-3 {
  --student-accent: #c86a67;
  --student-border: #e7c1bf;
  --student-surface: #fff4f3;
}

.daily-course-row.student-color-4 {
  --student-accent: #3f9b9a;
  --student-border: #b4dddd;
  --student-surface: #effafa;
}

.daily-course-row.student-color-5 {
  --student-accent: #7a78ac;
  --student-border: #cecee3;
  --student-surface: #f6f5fc;
}

.daily-course-row.student-color-6 {
  --student-accent: #b07743;
  --student-border: #dfc6ac;
  --student-surface: #fbf5ef;
}

@media (max-width: 900px) {
  .daily-schedule-slot {
    grid-template-columns: 76px minmax(0, 1fr);
  }

  .daily-slot-courses {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  }
}

@media (max-width: 480px) {
  .rich-text-toolbar {
    gap: 5px;
    padding: 5px;
  }

  .rich-text-tool {
    width: 32px;
    min-height: 32px;
  }

  .rich-text-tool.wide-tool,
  .writing-insert-select {
    flex: 1 1 112px;
    min-width: 0;
  }

  .header-actions {
    gap: 7px;
  }

  .notification-panel {
    position: fixed;
    top: 118px;
    right: 12px;
    left: 12px;
    width: auto;
  }

  .notification-button {
    width: 42px;
    min-width: 42px;
    height: 42px;
    min-height: 42px;
  }

  .notification-icon {
    width: 19px;
    height: 23px;
  }

  .profile-dept {
    max-width: 104px;
    padding: 0 8px;
  }

  .profile-button {
    max-width: 112px;
    padding-left: 8px;
  }

  .profile-center-label {
    display: none;
  }

  .login-view {
    padding: 22px 14px 16px;
  }

  .brand-logo-login-corner {
    width: 206px;
    max-height: 52px;
  }

  .login-card-stack {
    width: min(348px, 100%);
    transform: translateY(-14px);
  }

  .login-panel {
    padding: 26px 18px 22px;
  }

  .login-submit {
    width: 100%;
  }

  .avatar-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
  }

  .avatar-dialog {
    padding: 16px;
    border-radius: 18px;
  }

  .edit-dialog {
    max-height: calc(100vh - 24px);
    border-radius: 18px;
  }

  .homework-review-dialog {
    max-height: calc(100vh - 24px);
    border-radius: 18px;
  }

  .homework-review-body {
    padding: 14px 16px 16px;
  }

  .homework-review-images {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .homework-image-field-head {
    align-items: stretch;
    flex-direction: column;
  }

  .homework-image-preview {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .edit-dialog-header {
    padding: 16px 16px 14px;
  }

  .edit-dialog-header h3 {
    font-size: 18px;
  }

  .edit-dialog-body {
    padding: 14px 16px 16px;
  }

  .avatar-option {
    border-radius: 16px;
  }

  .avatar-option img {
    width: 48px;
    height: 48px;
  }
}

/* Keep the profile control dimension stable and give its dialog enough width. */
@media (min-width: 901px) {
  .profile-button {
    width: 132px;
    min-width: 132px;
    flex: 0 0 132px;
    border-color: transparent;
    transition: background-color 160ms ease, box-shadow 160ms ease;
  }

  .profile-button:hover,
  .profile-button:focus-visible {
    border-color: transparent;
    background: #f8fbff;
    box-shadow: 0 10px 22px rgba(30, 94, 255, 0.1);
    transform: none;
  }

  .avatar-dialog {
    width: min(760px, calc(100vw - 48px));
    padding: 24px;
    border-radius: var(--admin-surface-radius);
  }

  .avatar-grid {
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 12px;
  }

  .avatar-option {
    border-radius: 14px;
  }

  .password-form {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-items: end;
  }

  .password-form .actions {
    grid-column: 1 / -1;
  }
}

/* Last override for schedule filters: keep the final cascade deterministic. */
.schedule-board-toolbar {
  grid-template-columns: max-content minmax(280px, 360px);
  column-gap: 12px;
}

.schedule-board-toolbar > .schedule-date-filter,
.schedule-board-toolbar > .schedule-board-keyword {
  grid-row: 1;
}

.schedule-date-filter {
  width: max-content;
}

#schedulesPanel .schedule-board-keyword {
  width: auto;
  min-width: 0;
}

#schedulesPanel .schedule-board-main-row .schedule-board-keyword {
  flex: 0 1 360px;
  width: 360px;
  min-width: 280px;
}

#schedulesPanel .schedule-board-keyword input {
  width: 100%;
  padding-left: 42px;
}

#schedulesPanel .schedule-board-keyword::before {
  top: auto;
  bottom: 10px;
  transform: none;
}

@media (max-width: 900px) {
  .schedule-board-toolbar {
    grid-template-columns: 1fr;
  }

  .schedule-board-toolbar > .schedule-date-filter,
  .schedule-board-toolbar > .schedule-board-keyword {
    grid-row: auto;
  }

  .schedule-date-filter,
  #schedulesPanel .schedule-board-keyword {
    width: 100%;
  }

  #schedulesPanel .schedule-board-main-row .schedule-board-keyword {
    flex-basis: 100%;
    width: 100%;
    min-width: 0;
  }
}

/* Final schedule filter layout: one date control and one search control on the first row. */
.schedule-date-filter {
  display: flex;
  min-width: 0;
  align-items: end;
  gap: 10px;
}

.schedule-date-mode {
  display: grid;
  flex: 0 0 auto;
  grid-template-columns: repeat(2, minmax(64px, 1fr));
  height: 38px;
  overflow: hidden;
  border: 1px solid var(--field-border);
  border-radius: 8px;
  background: var(--field);
}

.schedule-date-mode .secondary {
  min-height: 36px;
  border-radius: 0;
  padding: 0 10px;
  font-size: 12px;
  white-space: nowrap;
}

.schedule-date-mode .secondary::before {
  display: none;
}

.schedule-date-mode .secondary.active {
  background: var(--primary);
  color: #fff;
}

.schedule-date-fields {
  display: flex;
  min-width: 0;
  align-items: end;
  gap: 8px;
}

.schedule-date-fields .schedule-board-date {
  width: 148px;
  min-width: 0;
  margin: 0;
}

.schedule-date-fields .schedule-board-date input {
  width: 148px;
}

.schedule-date-separator {
  align-self: end;
  margin-bottom: 11px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.schedule-board-keyword {
  min-width: 0;
}

.daily-schedule-range {
  display: grid;
  gap: 12px;
  padding: 12px;
  background: #f8fbfa;
}

.daily-range-day {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.daily-range-day-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  background: #fbfefd;
}

.daily-range-day-head strong {
  color: var(--text);
  font-size: 14px;
  font-weight: 900;
}

.daily-range-day-head span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.daily-range-day .daily-schedule-list {
  overflow-x: auto;
}

.daily-range-empty {
  padding: 48px 20px;
  color: var(--muted);
  text-align: center;
  font-weight: 800;
}

@media (max-width: 1200px) and (min-width: 901px) {
  .schedule-board-toolbar {
    grid-template-columns: minmax(390px, 1.2fr) minmax(220px, 0.8fr);
  }

  .schedule-date-fields .schedule-board-date,
  .schedule-date-fields .schedule-board-date input {
    width: 132px;
  }
}

@media (max-width: 900px) {
  .schedule-date-filter {
    width: 100%;
  }
}

@media (max-width: 600px) {
  .schedule-date-filter {
    align-items: stretch;
    flex-direction: column;
  }

  .schedule-date-mode {
    width: max-content;
  }

  .schedule-date-fields {
    width: 100%;
  }

  .schedule-date-fields .schedule-board-date,
  .schedule-date-fields .schedule-board-date input {
    width: 100%;
  }
}

/* Monthly schedule follows the office timetable: one block per teacher and two half-month grids. */
.schedule-empty-state {
  display: grid;
  gap: 6px;
  justify-items: center;
  padding: 48px 20px;
  border: 1px dashed var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--muted);
}

.schedule-empty-state strong {
  color: var(--text);
}

.teacher-month-block {
  display: grid;
  gap: 0;
  min-width: max-content;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 6px 18px rgba(28, 63, 58, 0.05);
}

.teacher-month-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 54px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--line);
  background: #fbfefd;
}

.teacher-month-heading > div {
  display: flex;
  align-items: baseline;
  gap: 12px;
}

.teacher-month-heading strong {
  color: var(--text);
  font-size: 16px;
  font-weight: 900;
}

.teacher-month-heading span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.teacher-month-halves {
  display: flex;
  gap: 16px;
  padding: 12px;
}

.teacher-month-half {
  flex: 0 0 calc(var(--month-time-width) + var(--month-day-width) * 16);
}

.teacher-month-half-label {
  padding: 0 0 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.monthly-schedule {
  --month-time-width: 78px;
  --month-day-width: 82px;
  display: grid;
  gap: 16px;
  border-radius: 0;
}

.teacher-month-half .month-grid {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 7px;
}

.teacher-month-half .month-grid-head,
.teacher-month-half .month-grid-row {
  grid-template-columns: var(--month-time-width) repeat(16, var(--month-day-width));
}

.teacher-month-half .month-grid-head {
  min-height: 48px;
}

.teacher-month-half .month-day-head {
  min-height: 48px;
  padding: 6px 4px;
}

.teacher-month-half .month-day-head strong {
  font-size: 14px;
}

.teacher-month-half .month-day-head.weekend,
.teacher-month-half .month-course-cell.weekend {
  background: #edf5fb;
}

.teacher-month-half .month-day-head.today {
  background: #f3fbef;
}

.teacher-month-half .month-grid-row {
  min-height: 78px;
}

.teacher-month-half .month-time-cell,
.teacher-month-half .month-course-cell {
  min-height: 78px;
}

.teacher-month-half .month-time-cell {
  padding: 7px 9px;
}

.teacher-month-half .month-time-cell.lunch {
  background: #e8f5dc;
}

.teacher-month-half .month-course-cell {
  gap: 4px;
  padding: 5px;
}

.teacher-month-half .month-course-cell.today {
  background: #f8fff4;
}

.teacher-month-half .month-course-cell.weekend.today {
  background: #f1faed;
}

.teacher-month-half .month-course-card {
  gap: 2px;
  padding: 6px;
  border-radius: 4px;
  box-shadow: none;
}

.teacher-month-half .month-course-student {
  display: grid;
  gap: 1px;
  white-space: normal;
  line-height: 1.25;
}

.teacher-month-half .month-course-student small {
  overflow: hidden;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.teacher-month-half .month-course-subject,
.teacher-month-half .month-course-place {
  font-size: 10px;
}

.teacher-month-half .month-course-actions {
  display: none;
}

/* Keep schedule navigation compact and make the keyword field read as a search control. */
.schedule-day-navigation {
  grid-template-columns: 48px 156px 48px 54px;
  align-items: end;
  justify-content: start;
}

.schedule-day-navigation .schedule-board-date {
  width: 156px;
}

.schedule-day-navigation .schedule-board-date input {
  width: 156px;
}

.schedule-day-navigation .schedule-day-arrow {
  display: inline-grid;
  place-items: center;
  width: 48px;
  padding: 0;
  font-size: 21px;
  font-weight: 900;
  line-height: 1;
}

.schedule-board-keyword {
  position: relative;
}

.schedule-board-keyword::before {
  position: absolute;
  bottom: 10px;
  left: 13px;
  z-index: 1;
  width: 17px;
  height: 17px;
  background: #82968f;
  content: '';
  -webkit-mask: var(--icon-search) center / contain no-repeat;
  mask: var(--icon-search) center / contain no-repeat;
  pointer-events: none;
}

.schedule-board-keyword input {
  padding-left: 40px;
  background: #fff;
}

@media (max-width: 900px) {
  .schedule-day-navigation {
    grid-template-columns: 48px 156px 48px 54px;
  }
}

@media (max-width: 480px) {
  .schedule-day-navigation {
    grid-template-columns: 42px minmax(0, 1fr) 42px 48px;
  }

  .schedule-day-navigation .schedule-board-date,
  .schedule-day-navigation .schedule-board-date input {
    width: 100%;
  }

  .schedule-day-navigation .schedule-day-arrow {
    width: 42px;
  }
}

.quick-schedule-cell {
  align-self: stretch;
  min-height: 50px;
  border: 1px dashed #c8dbd5;
  border-radius: 4px;
  background: transparent;
  color: #7b9992;
  font-size: 11px;
  font-weight: 900;
  cursor: pointer;
}

.quick-schedule-cell:hover,
.quick-schedule-cell:focus-visible {
  border-color: var(--primary);
  background: #f3fbef;
  color: var(--primary-dark);
}

.teacher-month-half .month-course-cell.placeholder,
.teacher-month-half .month-day-head.placeholder {
  background: #fafcfc;
}

.schedule-board-teacher {
  min-width: 150px;
}

.schedule-board-legend .legend-dot.weekend {
  border-radius: 2px;
  background: #b8d5e9;
}

@media (max-width: 900px) {
  .teacher-month-heading > div {
    align-items: flex-start;
    flex-direction: column;
    gap: 2px;
  }

  .teacher-month-halves {
    align-items: stretch;
    flex-direction: column;
  }

  .teacher-month-half {
    flex-basis: auto;
  }
}

@media (max-width: 900px) {
  .profile-button {
    width: auto;
    min-width: 0;
    flex: 0 1 auto;
  }

  .avatar-dialog {
    width: min(720px, calc(100vw - 24px));
    padding: 18px;
    border-radius: 16px;
  }

  .avatar-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

  .password-form {
    grid-template-columns: 1fr;
  }

  .password-form .actions {
    grid-column: auto;
  }
}

@media (max-width: 480px) {
  .avatar-dialog {
    width: calc(100vw - 24px);
    padding: 16px;
  }

  .avatar-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
  }
}

/* Solid status labels inspired by the compact reference badge. */
.status-pill {
  min-height: 24px;
  padding: 0 8px;
  border-radius: 4px;
  background: #eef3ff;
  color: #1e5eff;
  font-size: 14px;
  font-weight: 400;
  line-height: 20px;
}

.status-pill.pending,
.status-pill.submitted,
.status-pill.late,
.status-pill.filing,
.status-pill.archive-pending {
  background: #fff4df;
  color: #b86b00;
}

.status-pill.graded,
.status-pill.approved,
.status-pill.present,
.status-pill.archive-accepted {
  background: #e8f7ef;
  color: #168653;
}

.status-pill.leave,
.status-pill.archive-sealed {
  background: #eaecf5;
  color: #5a607f;
}

.status-pill.rejected,
.status-pill.absent,
.status-pill.login-locked {
  background: #ffe9e9;
  color: #d44747;
}

.status-pill.archive-draft {
  background: #eef3ff;
  color: #1e5eff;
}

.status-pill.archive-scheduled {
  background: #e6f7f6;
  color: #147c78;
}

.student-meta-pill {
  min-height: 24px;
  padding: 0 8px;
  border-radius: 4px;
  color: #1e5eff;
  font-size: 12px;
  font-weight: 400;
  line-height: 24px;
}

.student-meta-pill.studying {
  background: #e8f7ef;
  color: #168653;
}

.student-meta-pill.graduated {
  background: #eaecf5;
  color: #5a607f;
}

.student-meta-pill.service {
  background: #eaecf5;
  color: #5a607f;
}

.status-pill.login-locked {
  margin-top: 6px;
}

@media (prefers-reduced-motion: reduce) {
  .login-view::before {
    animation: none;
  }
}

/* Shared admin surface language: keep major blocks on one radius scale. */
:root {
  --admin-surface-radius: 14px;
}

.content-header,
.form-grid,
.archive-filter,
.handover-hero,
.handover-form,
.archive-form-head,
.summary-card,
.kpi-card,
.chart-panel,
.admin-lead-card,
.admin-overview-stat,
.table-wrap {
  border-radius: var(--admin-surface-radius);
}

@media (min-width: 901px) {
  .dashboard {
    grid-template-columns: 244px minmax(0, 1fr);
  }

  .sidebar {
    top: 15px;
    height: calc(100vh - 30px);
    margin: 15px 0 15px 24px;
    padding: 22px 14px 16px;
    border: 0;
    border-radius: 24px;
    background: #fff;
    box-shadow: 0 6px 58px rgba(196, 203, 214, 0.1);
  }

  .sidebar::before {
    display: none;
  }

  .tabs {
    gap: 4px;
  }

  .tabs::-webkit-scrollbar-thumb {
    background: #e2e8ee;
  }

  .brand.compact {
    margin: 0 10px 24px;
  }

  .tab {
    min-height: 44px;
    border-radius: 10px;
    color: #718096;
  }

  .tab.active,
  .tab:hover {
    background: rgba(98, 193, 62, 0.11);
  }

  .content {
    padding: 20px 28px 32px 26px;
  }

  .content-header {
    min-height: 48px;
    margin-bottom: 28px;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
  }

  .content-header h2 {
    color: #0a1629;
    font-size: 32px;
    font-weight: 700;
    line-height: 1.2;
  }

  .content-header h2::after {
    display: none;
  }

  .content-header p {
    margin-top: 6px;
  }

  .header-actions {
    gap: 10px;
  }

  #refreshButton,
  .notification-button,
  .profile-dept,
  .profile-button {
    min-height: 48px;
    border: 0;
    border-radius: var(--admin-surface-radius);
    background: #fff;
    box-shadow: 0 6px 58px rgba(196, 203, 214, 0.1);
  }

  #refreshButton {
    padding: 0 16px;
    color: #718096;
  }

  #refreshButton:hover,
  .notification-button:hover,
  .notification-button[aria-expanded="true"],
  .profile-button:hover {
    border: 0;
    background: #f2f8fc;
  }

  .notification-button {
    width: 48px;
    height: 48px;
    min-width: 48px;
    padding: 0;
  }

  .profile-dept {
    min-width: 92px;
    padding: 0 15px;
    color: #718096;
    font-size: 13px;
  }

  .profile-button {
    padding: 5px 6px 5px 14px;
  }

  .profile-center-label {
    color: #0a1629;
    font-weight: 700;
  }

  .top-avatar {
    background: #eaf3f8;
  }

  .admin-stats {
    gap: 22px;
  }

  .admin-dashboard-head {
    padding: 0 2px;
  }

  .admin-dashboard-head h3 {
    color: #0a1629;
    font-size: 30px;
    font-weight: 700;
  }

  .admin-dashboard-updated {
    min-width: 190px;
    min-height: 48px;
    align-content: center;
    padding: 7px 14px;
    border: 0;
    border-radius: var(--admin-surface-radius);
    background: #f2f8fc;
    box-shadow: 0 6px 58px rgba(196, 203, 214, 0.1);
  }

  .admin-primary-grid,
  .kpi-grid,
  .chart-grid {
    gap: 12px;
  }

  .admin-lead-card {
    min-height: 176px;
    padding: 22px 24px;
    border: 1px solid #eef1f4;
    border-left: 3px solid var(--primary);
    background: #fff;
    box-shadow: 0 8px 24px rgba(17, 24, 39, 0.04);
  }

  .admin-lead-card h3 {
    color: #0a1629;
    font-size: 18px;
  }

  .admin-lead-value strong {
    color: #111827;
    font-size: 56px;
  }

  .admin-lead-value span,
  .admin-lead-foot strong {
    color: var(--primary-dark);
  }

  .admin-lead-mark {
    flex-basis: 112px;
    color: #718096;
  }

  .admin-overview-stats {
    gap: 12px;
  }

  .admin-overview-stat {
    padding: 16px 18px;
    box-shadow: 0 8px 24px rgba(17, 24, 39, 0.04);
  }

  .admin-dashboard-section {
    gap: 10px;
  }

  .admin-section-heading h3 {
    color: #0a1629;
    font-size: 17px;
  }

  .kpi-card,
  .chart-panel {
    border-color: #eef1f4;
    box-shadow: 0 8px 24px rgba(17, 24, 39, 0.04);
  }

  .kpi-card {
    min-height: 108px;
    padding: 15px 16px;
  }

  .chart-panel {
    padding: 16px 18px 13px;
  }

  .chart-head span {
    border-radius: 8px;
    box-shadow: none;
  }
}

@media (min-width: 901px) {
  /* Keep the original navigation and header treatment. */
  .dashboard {
    grid-template-columns: 260px 1fr;
  }

  .sidebar {
    top: 0;
    height: 100vh;
    margin: 0;
    padding: 22px;
    border-right: 1px solid var(--line);
    border-radius: 0;
    background: var(--panel);
    box-shadow: none;
  }

  .sidebar::before {
    display: block;
    width: 56px;
    height: 5px;
    margin-bottom: 20px;
    border-radius: 999px;
    background: var(--primary);
    content: "";
  }

  .tabs {
    gap: 8px;
  }

  .tabs::-webkit-scrollbar-thumb {
    background: #dbe8d6;
  }

  .brand.compact {
    margin: 0 0 28px;
  }

  .tab {
    min-height: 42px;
    border-radius: 12px;
    color: var(--text);
  }

  .tab.active,
  .tab:hover {
    background: #edf9e9;
  }

  .content {
    padding: 26px;
  }

  .content-header {
    min-height: 0;
    margin-bottom: 18px;
    padding: 20px 22px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: var(--panel);
    box-shadow: var(--shadow);
  }

  .content-header h2 {
    color: var(--text);
    font-size: 26px;
    font-weight: 900;
    line-height: normal;
  }

  .content-header h2::after {
    display: block;
    width: 46px;
    height: 4px;
    margin-top: 8px;
    border-radius: 999px;
    background: var(--orange);
    content: "";
  }

  .header-actions {
    gap: 12px;
  }

  #refreshButton {
    min-height: 38px;
    padding: 0 16px;
    border: 0;
    border-radius: 999px;
    background: #edf9e9;
    box-shadow: none;
    color: var(--primary-dark);
  }

  #refreshButton:hover {
    background: #e2f5dc;
  }

  .notification-button {
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: #fff;
    box-shadow: 0 8px 18px rgba(28, 63, 58, 0.07);
  }

  .notification-button:hover,
  .notification-button[aria-expanded="true"] {
    border-color: rgba(98, 193, 62, 0.55);
    background: #f5fff2;
  }

  .profile-button {
    min-height: 48px;
    padding: 5px 6px 5px 14px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: #fff;
    box-shadow: 0 8px 18px rgba(28, 63, 58, 0.07);
  }

  .profile-center-label {
    color: var(--primary-dark);
    font-weight: 900;
  }

  .profile-button:hover {
    border-color: rgba(98, 193, 62, 0.55);
    background: #fff;
    box-shadow: 0 10px 22px rgba(98, 193, 62, 0.15);
  }

  .top-avatar {
    background: #edf9e9;
  }

  .profile-dept {
    min-height: 40px;
    padding: 0 18px;
    border: 1px solid rgba(255, 112, 67, 0.26);
    border-radius: 999px;
    background: linear-gradient(135deg, #fff5ef, #ffe2d5);
    box-shadow: 0 8px 18px rgba(255, 112, 67, 0.14);
    color: #c84f2b;
    font-size: 14px;
    font-weight: 900;
  }
}

/* Home information hierarchy: compact KPI cards and readable action rows. */
#homeSummary.summary-grid,
#homeStatsSummary.summary-grid {
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 12px;
}

#homeStaffStats {
  gap: 14px;
}

#homeStaffStats > h3 {
  margin: 0;
  color: #0a1629;
  font-size: 18px;
  font-weight: 800;
}

#homeStaffStats > .table-wrap {
  border-color: #eef1f4;
  background: #fff;
  box-shadow: 0 8px 24px rgba(17, 24, 39, 0.04);
}

#homeStaffStats table {
  min-width: 0;
  table-layout: fixed;
}

#homeStaffStats th,
#homeStaffStats td {
  padding: 13px 16px;
}

#homeStaffStats th:nth-child(1),
#homeStaffStats td:nth-child(1) {
  width: 31%;
}

#homeStaffStats th:nth-child(2),
#homeStaffStats td:nth-child(2) {
  width: 18%;
}

#homeStaffStats th:nth-child(3),
#homeStaffStats td:nth-child(3) {
  width: 51%;
}

#homeStaffStats td:first-child {
  color: #0a1629;
  font-weight: 800;
}

#homeStaffStats td:nth-child(2) {
  color: #111827;
  font-size: 16px;
  font-weight: 800;
}

#homeStaffStats td:nth-child(3) {
  color: #718096;
  font-size: 12px;
  font-weight: 600;
}

#homeSummary .summary-card,
#homeStatsSummary .summary-card {
  position: relative;
  min-height: 124px;
  padding: 17px 18px 16px;
  border: 1px solid #eef1f4;
  border-left: 3px solid var(--primary);
  border-radius: var(--admin-surface-radius);
  background: #fff;
  box-shadow: 0 8px 24px rgba(17, 24, 39, 0.04);
}

#homeSummary .summary-card:nth-child(2n),
#homeStatsSummary .summary-card:nth-child(2n) {
  border-top: 0;
  border-left-color: var(--orange);
}

#homeSummary .summary-card:nth-child(3n),
#homeStatsSummary .summary-card:nth-child(3n) {
  border-left-color: #3f8cff;
}

#homeSummary .summary-card:nth-child(4n),
#homeStatsSummary .summary-card:nth-child(4n) {
  border-left-color: #43d1a2;
}

#homeSummary .summary-card-button:hover,
#homeStatsSummary .summary-card-button:hover {
  border-color: rgba(98, 193, 62, 0.46);
  border-left-color: var(--primary);
  box-shadow: 0 12px 28px rgba(17, 24, 39, 0.08);
  transform: translateY(-1px);
}

#homeSummary .summary-card:nth-child(2n).summary-card-button:hover,
#homeStatsSummary .summary-card:nth-child(2n).summary-card-button:hover {
  border-left-color: var(--orange);
}

#homeSummary .summary-card:nth-child(3n).summary-card-button:hover,
#homeStatsSummary .summary-card:nth-child(3n).summary-card-button:hover {
  border-left-color: #3f8cff;
}

#homeSummary .summary-card:nth-child(4n).summary-card-button:hover,
#homeStatsSummary .summary-card:nth-child(4n).summary-card-button:hover {
  border-left-color: #43d1a2;
}

#homeSummary .summary-icon,
#homeStatsSummary .summary-icon {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: #edf9e9;
}

#homeSummary .summary-card:nth-child(2n) .summary-icon,
#homeStatsSummary .summary-card:nth-child(2n) .summary-icon {
  background: #fff1ec;
  color: var(--orange);
}

#homeSummary .summary-card:nth-child(3n) .summary-icon,
#homeStatsSummary .summary-card:nth-child(3n) .summary-icon {
  background: #eef5ff;
  color: #3f8cff;
}

#homeSummary .summary-card:nth-child(4n) .summary-icon,
#homeStatsSummary .summary-card:nth-child(4n) .summary-icon {
  background: #e8f7f5;
  color: #16756c;
}

#homeSummary .summary-label,
#homeStatsSummary .summary-label {
  color: #718096;
  font-size: 12px;
  font-weight: 700;
}

#homeSummary .summary-value,
#homeStatsSummary .summary-value {
  margin-top: 10px;
  color: #111827;
  font-size: 30px;
  font-weight: 800;
  line-height: 1;
}

#homeSummary .summary-hint,
#homeStatsSummary .summary-hint {
  margin-top: 9px;
  overflow: hidden;
  color: #718096;
  font-size: 11px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 900px) {
  #homeSummary.summary-grid,
  #homeStatsSummary.summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .home-task-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }

  .home-task-table {
    table-layout: auto;
  }

  #homeStaffStats table {
    table-layout: auto;
  }

  .home-task-table th,
  .home-task-table td {
    padding: 12px;
  }

  .home-task-table th:nth-child(1),
  .home-task-table td:nth-child(1) {
    width: 34%;
  }

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

  .home-task-table th:nth-child(3),
  .home-task-table td:nth-child(3) {
    width: 48%;
  }
}

@media (max-width: 480px) {
  #homeSummary.summary-grid,
  #homeStatsSummary.summary-grid {
    grid-template-columns: 1fr;
  }

  #homeSummary .summary-card,
  #homeStatsSummary .summary-card {
    min-height: 112px;
  }

  .home-task-table th,
  .home-task-table td {
    padding: 11px 10px;
  }

  .home-task-table td:first-child {
    font-size: 13px;
  }

  .home-task-table td:nth-child(2) {
    font-size: 18px;
  }

  .home-task-table td:nth-child(3) {
    font-size: 11px;
  }

  #homeStaffStats th,
  #homeStaffStats td {
    padding: 11px 10px;
  }
}

/* Final profile control override: hover must never change header geometry. */
@media (min-width: 901px) {
  #topProfileButton.profile-button {
    width: 132px;
    height: 48px;
    min-width: 132px;
    min-height: 48px;
    max-height: 48px;
    flex: 0 0 132px;
    box-sizing: border-box;
    border: 1px solid #e1eaf3;
    border-radius: 999px;
    background: #fff;
    box-shadow: 0 6px 18px rgba(196, 203, 214, 0.1);
    transition: background-color 160ms ease, box-shadow 160ms ease;
    transform: none;
  }

  #topProfileButton.profile-button:hover,
  #topProfileButton.profile-button:focus,
  #topProfileButton.profile-button:focus-visible,
  #topProfileButton.profile-button:active {
    width: 132px;
    height: 48px;
    min-width: 132px;
    min-height: 48px;
    max-height: 48px;
    border: 1px solid #e1eaf3;
    border-radius: 999px;
    background: #f8fbff;
    box-shadow: 0 8px 20px rgba(196, 203, 214, 0.14);
    transform: none;
  }

  #topProfileButton .top-avatar {
    display: block;
    width: 40px;
    height: 40px;
    min-width: 40px;
    min-height: 40px;
    flex: 0 0 40px;
    box-sizing: border-box;
    padding: 0;
    border: 0;
    border-radius: 999px;
    background: #eaf3f8;
  }
}

/* Final cascade for schedule filters. */
.schedule-board-main-row {
  display: flex;
  min-width: 0;
  grid-column: 1 / -1;
  align-items: end;
  gap: 12px;
}

.schedule-board-main-row .schedule-date-filter {
  flex: 0 0 auto;
}

.schedule-board-main-row .schedule-board-keyword {
  flex: 0 1 360px;
  width: 360px;
  min-width: 280px;
  margin: 0;
}

.schedule-board-toolbar {
  grid-template-columns: 1fr;
  gap: 12px;
}

.schedule-date-filter {
  width: max-content;
}

#schedulesPanel .schedule-board-keyword {
  width: 100%;
  min-width: 0;
}

#schedulesPanel .schedule-board-main-row .schedule-board-keyword {
  flex: 0 1 360px;
  width: 360px;
  min-width: 280px;
}

#schedulesPanel .schedule-board-keyword input {
  width: 100%;
  padding-left: 42px;
}

#schedulesPanel .schedule-board-keyword::before {
  top: auto;
  bottom: 10px;
  transform: none;
}

@media (max-width: 900px) {
  .schedule-board-toolbar {
    grid-template-columns: 1fr;
  }

  .schedule-board-main-row {
    align-items: stretch;
    flex-wrap: wrap;
  }

  .schedule-board-main-row .schedule-date-filter,
  .schedule-board-main-row .schedule-board-keyword {
    width: 100%;
  }

  .schedule-board-main-row .schedule-board-keyword {
    flex-basis: 100%;
    width: 100%;
    min-width: 0;
  }
}
