:root {
  --bg: #f4f7fb;
  --panel: #ffffff;
  --text: #172033;
  --muted: #667085;
  --line: #d9e0ea;
  --primary: #0f766e;
  --primary-dark: #115e59;
  --blue: #1d4ed8;
  --gold: #c97a20;
  --soft: #eef6f4;
  --danger: #b42318;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: Tahoma, Arial, sans-serif;
  line-height: 1.5;
}

a {
  color: inherit;
  text-decoration: none;
}

.icon-sprite {
  height: 0;
  overflow: hidden;
  position: absolute;
  width: 0;
}

.icon {
  display: inline-block;
  flex: 0 0 auto;
  fill: none;
  height: 1.05em;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
  vertical-align: -0.16em;
  width: 1.05em;
}

.page-loader {
  align-items: center;
  background: rgba(244, 247, 251, .86);
  backdrop-filter: blur(6px);
  display: flex;
  inset: 0;
  justify-content: center;
  opacity: 1;
  position: fixed;
  transition: opacity .22s ease, visibility .22s ease;
  visibility: visible;
  z-index: 9999;
}

.page-loader.is-hidden {
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
}

.page-loader-panel {
  align-items: center;
  background: #fff;
  border: 1px solid rgba(15, 118, 110, .18);
  border-radius: 8px;
  box-shadow: 0 18px 42px rgba(18, 48, 71, .18);
  color: #123047;
  display: inline-flex;
  gap: 12px;
  padding: 14px 18px;
}

.page-loader-spinner {
  animation: page-loader-spin .75s linear infinite;
  border: 3px solid #dbeafe;
  border-top-color: var(--primary);
  border-radius: 50%;
  height: 28px;
  width: 28px;
}

.page-loader-text {
  font-size: 14px;
  font-weight: 700;
}

@keyframes page-loader-spin {
  to {
    transform: rotate(360deg);
  }
}

a .icon,
button .icon,
.button .icon,
.secondary-link .icon,
.status-pill .icon,
.notice-subject .icon,
.eyebrow .icon {
  margin-right: 7px;
}

.topbar {
  align-items: center;
  background: #123047;
  box-shadow: 0 8px 24px rgba(18, 48, 71, .16);
  color: #fff;
  display: flex;
  justify-content: space-between;
  min-height: 64px;
  padding: 0 clamp(18px, 4vw, 56px);
  position: sticky;
  top: 0;
  z-index: 10;
}

.brand {
  align-items: center;
  display: inline-flex;
  gap: 10px;
  font-size: 18px;
  font-weight: 700;
}

.brand span {
  display: grid;
  gap: 1px;
}

.brand strong {
  font-size: 17px;
  line-height: 1.1;
}

.brand small {
  color: rgba(255, 255, 255, .78);
  font-size: 11px;
  font-weight: 400;
}

.school-logo-mini {
  background: rgba(255, 255, 255, .95);
  border-radius: 999px;
  height: 38px;
  object-fit: contain;
  padding: 3px;
  width: 38px;
}

.topbar nav {
  display: flex;
  gap: 10px;
  font-size: 14px;
}

.topbar nav a {
  align-items: center;
  border-radius: 999px;
  display: inline-flex;
  padding: 7px 10px;
}

.topbar nav a:hover {
  background: rgba(255, 255, 255, .12);
}

.page {
  margin: 0;
  max-width: none;
  padding: 24px clamp(14px, 2vw, 28px) 42px;
  width: 100%;
}

.split {
  align-items: start;
  display: grid;
  gap: 32px;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 440px);
}

.hero-shell {
  align-items: stretch;
  display: grid;
  gap: 28px;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 450px);
  margin-bottom: 28px;
}

.hero-copy {
  background: linear-gradient(135deg, #ffffff 0%, #f4fbf9 100%);
  border: 1px solid #e0ebe8;
  border-radius: 12px;
  min-height: 300px;
  padding: clamp(24px, 4vw, 42px);
  position: relative;
  overflow: hidden;
}

.hero-copy::after {
  background: linear-gradient(135deg, rgba(201, 122, 32, .16), rgba(15, 118, 110, .13));
  border-radius: 999px;
  content: "";
  height: 220px;
  position: absolute;
  right: -80px;
  top: -90px;
  width: 220px;
}

.school-logo-hero {
  background: rgba(255, 255, 255, .86);
  border: 1px solid rgba(15, 118, 110, .16);
  border-radius: 999px;
  box-shadow: 0 12px 26px rgba(16, 42, 67, .14);
  height: 88px;
  object-fit: contain;
  padding: 8px;
  position: absolute;
  right: 28px;
  top: 28px;
  width: 88px;
  z-index: 1;
}

.hero-copy > *:not(.school-logo-hero) {
  position: relative;
  z-index: 2;
}

.document-info-card {
  background: #fff;
  border: 1px solid #e7e9ee;
  border-radius: 10px;
  box-shadow: 0 10px 24px rgba(16, 42, 67, .12);
  overflow: hidden;
}

.document-info-title {
  background: linear-gradient(135deg, #123047 0%, #0f766e 100%);
  border-bottom: 1px solid #d7dce3;
  color: #fff;
  font-weight: 700;
  padding: 18px 20px;
}

.document-info-title span {
  display: block;
  font-size: 18px;
  line-height: 1.2;
}

.document-info-title small {
  color: rgba(255, 255, 255, .78);
  display: block;
  font-size: 12px;
  font-weight: 400;
  margin-top: 4px;
}

.document-info-body {
  padding: 18px 20px;
}

.document-info-body details {
  border-radius: 6px;
  margin-bottom: 10px;
}

.document-info-body summary {
  color: var(--blue);
  cursor: pointer;
  font-weight: 700;
  list-style: none;
  padding: 13px 10px;
}

.document-info-body summary::-webkit-details-marker {
  display: none;
}

.document-info-detail {
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--text);
  margin: 0 12px 12px;
  padding: 12px;
}

.document-info-detail p {
  color: var(--muted);
  margin: 6px 0 0;
}

.document-info-body hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 18px 0;
}

.request-jump-button {
  background: var(--blue);
}

.hero-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 26px;
}

.secondary-link {
  align-items: center;
  color: var(--primary-dark);
  display: inline-flex;
  font-weight: 700;
}

.request-panel {
  max-width: none;
}

.eyebrow {
  color: var(--primary);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: .02em;
  text-transform: uppercase;
}

.hero-copy > .eyebrow {
  align-items: center;
  background: #e7f7ef;
  border: 1px solid #bde7d0;
  border-radius: 999px;
  color: var(--primary-dark);
  display: inline-flex;
  font-size: 16px;
  padding: 7px 12px;
  text-transform: none;
}

h1 {
  font-size: clamp(28px, 4vw, 44px);
  line-height: 1.15;
  margin: 8px 0 12px;
  max-width: 640px;
}

h2 {
  font-size: 20px;
  margin: 0 0 16px;
}

.lead {
  color: var(--muted);
  font-size: 18px;
  max-width: 560px;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 12px 28px rgba(23, 32, 51, .08);
  padding: 24px;
}

.panel-heading,
.form-footer {
  align-items: center;
  display: flex;
  justify-content: space-between;
  gap: 16px;
}

.panel-heading {
  border-bottom: 1px solid var(--line);
  margin-bottom: 22px;
  padding-bottom: 16px;
}

.panel-heading .eyebrow {
  color: var(--primary-dark);
  display: block;
  font-size: 13px;
  letter-spacing: .08em;
  line-height: 1.1;
  margin-bottom: 0;
}

.panel-heading h2 {
  font-size: 24px;
  line-height: 1.15;
  margin: 6px 0 0;
}

.form-footer {
  margin-top: 18px;
}

.status-pill {
  align-items: center;
  background: #e7f7ef;
  border: 1px solid #bde7d0;
  border-radius: 999px;
  color: #067647;
  display: inline-flex;
  font-size: 12px;
  font-weight: 700;
  padding: 6px 10px;
}

label {
  display: block;
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 0;
}

input,
select,
textarea {
  background: #fff;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  display: block;
  font: inherit;
  margin-top: 6px;
  min-height: 42px;
  padding: 10px 12px;
  width: 100%;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, .14);
  outline: none;
}

input[readonly] {
  background: #f1f5f9;
}

button,
.button {
  align-items: center;
  background: var(--primary);
  border: 0;
  border-radius: 8px;
  color: #fff;
  cursor: pointer;
  display: inline-flex;
  justify-content: center;
  font: inherit;
  font-weight: 700;
  padding: 11px 16px;
}

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

.inline {
  display: grid;
  gap: 8px;
  grid-template-columns: 1fr auto;
}

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

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

.message {
  color: var(--muted);
  margin-bottom: 0;
}

.alert {
  background: #fef3f2;
  border: 1px solid #fecdca;
  border-radius: 6px;
  color: var(--danger);
  padding: 10px 12px;
}

.section {
  margin-top: 36px;
}

.content-grid {
  align-items: start;
  display: grid;
  gap: 24px;
  grid-template-columns: minmax(0, 1fr) 380px;
}

.stats {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.dashboard-head {
  align-items: end;
  display: flex;
  gap: 24px;
  justify-content: space-between;
  margin-bottom: 18px;
}

.stats-inline {
  display: contents;
}

.notice-list {
  display: grid;
  gap: 18px;
}

.notice,
.stat {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
}

.notice {
  border: 0;
  box-shadow: 0 10px 24px rgba(16, 42, 67, .12);
  padding: 20px;
}

.notice h2 {
  border-bottom: 1px solid var(--line);
  font-size: 20px;
  margin-bottom: 12px;
  padding-bottom: 8px;
}

.notice-subject {
  align-items: start;
  background: #f8fafc;
  border-radius: 8px;
  display: flex;
  font-weight: 700;
  margin-bottom: 18px;
  padding: 10px 12px;
}

.notice-detail {
  color: var(--text);
  line-height: 1.65;
}

.notice-detail p {
  margin: 0 0 12px;
}

.notice-detail a,
.notice-detail u {
  color: #e11d48;
  font-weight: 700;
}

.notice-updated {
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
  margin: 16px 0 0;
  padding-bottom: 14px;
}

.process-strip {
  background: #123047;
  border-radius: 12px;
  color: #fff;
  display: grid;
  gap: 1px;
  grid-column: 1 / -1;
  grid-template-columns: repeat(3, 1fr);
  overflow: hidden;
}

.process-strip div {
  align-items: center;
  background: rgba(255, 255, 255, .06);
  display: flex;
  gap: 12px;
  padding: 16px;
}

.process-strip strong {
  align-items: center;
  background: #f6c76b;
  border-radius: 999px;
  color: #123047;
  display: inline-flex;
  height: 28px;
  justify-content: center;
  width: 28px;
}

.notice p,
.muted {
  color: var(--muted);
}

.stat span {
  color: var(--muted);
  display: block;
  font-size: 14px;
}

.stat strong {
  display: block;
  font-size: 28px;
  margin-top: 4px;
}

.actions {
  margin-top: 20px;
}

.auth-page {
  align-items: center;
  display: flex;
  justify-content: center;
  min-height: calc(100vh - 170px);
  padding: 38px 0;
}

.auth-card {
  max-width: 440px;
  padding: 32px;
  width: 100%;
}

.auth-head {
  margin-bottom: 24px;
  text-align: center;
}

.auth-head img {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
  box-shadow: 0 12px 26px rgba(16, 42, 67, .14);
  height: 82px;
  object-fit: contain;
  padding: 7px;
  width: 82px;
}

.auth-head .eyebrow {
  color: var(--primary-dark);
  margin: 14px 0 4px;
}

.auth-head h1 {
  font-size: 32px;
  margin: 0;
  max-width: none;
}

.auth-head p {
  color: var(--muted);
  margin: 8px 0 0;
}

.auth-card label {
  margin-top: 14px;
}

.auth-card input {
  background: #f8fbff;
}

.auth-submit {
  margin-top: 20px;
  width: 100%;
}

.admin-shell {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  margin: 0;
  max-width: none;
  min-height: calc(100vh - 64px);
  padding: 20px clamp(12px, 1.7vw, 24px) 32px;
  width: 100%;
}

.admin-sidebar {
  align-self: start;
  background: #102a43;
  border-radius: 14px;
  box-shadow: 0 14px 30px rgba(16, 42, 67, .16);
  color: #fff;
  min-height: calc(100vh - 104px);
  overflow: hidden;
  position: sticky;
  top: 88px;
}

.admin-profile {
  border-bottom: 1px solid rgba(255, 255, 255, .12);
  display: grid;
  gap: 5px;
  padding: 22px;
  text-align: center;
}

.admin-profile img {
  background: #fff;
  border-radius: 999px;
  height: 74px;
  justify-self: center;
  object-fit: contain;
  padding: 6px;
  width: 74px;
}

.admin-profile strong {
  margin-top: 8px;
}

.admin-profile span {
  color: rgba(255, 255, 255, .72);
  font-size: 13px;
}

.admin-menu {
  display: grid;
  gap: 4px;
  padding: 14px;
}

.admin-menu a {
  align-items: center;
  border-radius: 10px;
  color: rgba(255, 255, 255, .88);
  display: flex;
  gap: 9px;
  font-weight: 700;
  padding: 12px 14px;
}

.admin-menu a .icon {
  margin-right: 0;
}

.admin-menu a:hover {
  background: rgba(255, 255, 255, .1);
  color: #fff;
}

.admin-content {
  min-width: 0;
  padding-left: 18px;
  width: 100%;
}

.admin-content > section,
.admin-content > section > .request-table-card,
.admin-content .dashboard,
.admin-content .request-table-card {
  width: 100%;
}

.admin-content-wide {
  padding-left: 18px;
}

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

.admin-page-head h1 {
  margin-bottom: 0;
}

.admin-actions {
  white-space: nowrap;
}

.admin-actions button {
  align-items: center;
  background: #fff;
  border: 1px solid var(--line);
  color: var(--text);
  display: inline-flex;
  font-size: 12px;
  justify-content: center;
  margin: 2px;
  padding: 7px 9px;
}

.admin-actions button:hover {
  background: #eff6ff;
  color: var(--blue);
}

.admin-content .table-wrap {
  border-radius: 12px;
  box-shadow: 0 12px 28px rgba(23, 32, 51, .08);
}

.admin-content table {
  min-width: 980px;
}

.admin-request-card {
  margin-top: 0;
}

.admin-manage-card {
  margin-top: 0;
}

.admin-manage-card .request-table-header {
  align-items: center;
}

.admin-manage-card .table-scroll {
  border: 0;
  border-radius: 0;
  overflow-x: auto;
}

.admin-manage-card .request-table {
  min-width: 0;
  table-layout: fixed;
  width: 100% !important;
}

.admin-manage-card .dataTables_wrapper {
  padding: 20px 24px 24px;
}

.admin-manage-card th,
.admin-manage-card td {
  overflow-wrap: anywhere;
}

.admin-manage-card td {
  line-height: 1.45;
}

.admin-manage-card .admin-actions {
  display: flex;
  gap: 6px;
  white-space: normal;
}

.admin-manage-card .admin-actions button {
  margin: 0;
}

#adminStudentTable th:nth-child(1),
#adminStudentTable td:nth-child(1),
#adminStudentTable th:nth-child(2),
#adminStudentTable td:nth-child(2),
#adminStudentTable th:nth-child(3),
#adminStudentTable td:nth-child(3) {
  width: 58px;
}

#adminStudentTable th:nth-child(4),
#adminStudentTable td:nth-child(4) {
  width: 88px;
}

#adminStudentTable th:nth-child(6),
#adminStudentTable td:nth-child(6) {
  width: 62px;
}

#adminStudentTable th:nth-child(9),
#adminStudentTable td:nth-child(9) {
  width: 96px;
}

#adminStudentTable th:nth-child(10),
#adminStudentTable td:nth-child(10),
#adminNoticeTable th:nth-child(6),
#adminNoticeTable td:nth-child(6),
#adminUserTable th:nth-child(6),
#adminUserTable td:nth-child(6) {
  width: 96px;
}

.student-manage-card .request-table {
  min-width: 1340px;
  table-layout: auto;
  width: 100% !important;
}

.student-manage-card th:first-child,
.student-manage-card td:first-child,
.student-manage-card th:nth-child(2),
.student-manage-card td:nth-child(2),
.student-manage-card th:nth-child(3),
.student-manage-card td:nth-child(3),
.student-manage-card th:nth-child(4),
.student-manage-card td:nth-child(4) {
  width: 58px;
}

.student-manage-card th:nth-child(5),
.student-manage-card td:nth-child(5) {
  min-width: 110px;
}

.student-manage-card th:nth-child(6),
.student-manage-card td:nth-child(6) {
  min-width: 210px;
}

.student-manage-card th:nth-child(8),
.student-manage-card td:nth-child(8),
.student-manage-card th:nth-child(9),
.student-manage-card td:nth-child(9) {
  min-width: 170px;
}

.student-manage-card th:last-child,
.student-manage-card td:last-child {
  min-width: 160px;
  width: 160px;
}

.student-manage-card td {
  overflow-wrap: normal;
  word-break: normal;
}

.student-manage-card .admin-actions {
  display: flex;
  flex-wrap: nowrap;
  gap: 6px;
  justify-content: center;
  white-space: nowrap;
}

.student-manage-card .admin-actions button {
  margin: 0;
  min-width: 48px;
  padding: 8px 10px;
}

#adminNoticeTable th:nth-child(3),
#adminNoticeTable td:nth-child(3),
#adminUserTable th:nth-child(3),
#adminUserTable td:nth-child(3) {
  width: 118px;
}

#adminNoticeTable th:nth-child(4),
#adminNoticeTable td:nth-child(4),
#adminNoticeTable th:nth-child(5),
#adminNoticeTable td:nth-child(5),
#adminUserTable th:nth-child(4),
#adminUserTable td:nth-child(4),
#adminUserTable th:nth-child(5),
#adminUserTable td:nth-child(5) {
  width: 150px;
}

#activityLogTable th:nth-child(1),
#activityLogTable td:nth-child(1) {
  width: 150px;
}

#activityLogTable th:nth-child(2),
#activityLogTable td:nth-child(2) {
  width: 170px;
}

#activityLogTable th:nth-child(3),
#activityLogTable td:nth-child(3) {
  width: 92px;
}

#activityLogTable th:nth-child(4),
#activityLogTable td:nth-child(4) {
  width: 150px;
}

#activityLogTable th:nth-child(6),
#activityLogTable td:nth-child(6) {
  width: 120px;
}

#activityLogTable th:nth-child(7),
#activityLogTable td:nth-child(7) {
  width: 150px;
}

.block {
  display: block;
}

.log-details summary {
  color: var(--blue);
  cursor: pointer;
  font-weight: 700;
}

.log-details label {
  color: var(--muted);
  display: block;
  font-size: 12px;
  font-weight: 700;
  margin-top: 10px;
}

.log-details pre {
  background: #0f172a;
  border-radius: 8px;
  color: #e2e8f0;
  font-size: 12px;
  line-height: 1.45;
  margin: 6px 0 0;
  max-height: 240px;
  overflow: auto;
  padding: 10px;
  white-space: pre-wrap;
}

.admin-request-card .request-table {
  min-width: 1340px;
  table-layout: auto;
  width: 100% !important;
}

.admin-request-card .table-scroll {
  overflow-x: auto;
}

.admin-request-card th:nth-child(1),
.admin-request-card td:nth-child(1) {
  width: 44px;
}

.admin-request-card th:nth-child(2),
.admin-request-card td:nth-child(2) {
  width: 92px;
}

.admin-request-card th:nth-child(3),
.admin-request-card td:nth-child(3) {
  width: 82px;
}

.admin-request-card th:nth-child(4),
.admin-request-card td:nth-child(4) {
  width: 62px;
}

.admin-request-card th:nth-child(7),
.admin-request-card td:nth-child(7) {
  width: 56px;
}

.admin-request-card th:nth-child(5),
.admin-request-card td:nth-child(5) {
  min-width: 180px;
}

.admin-request-card th:nth-child(6),
.admin-request-card td:nth-child(6) {
  min-width: 220px;
}

.admin-request-card th:nth-child(8),
.admin-request-card td:nth-child(8) {
  width: 130px;
}

.admin-request-card th:nth-child(9),
.admin-request-card td:nth-child(9) {
  min-width: 180px;
}

.admin-request-card th:nth-child(10),
.admin-request-card td:nth-child(10) {
  min-width: 160px;
  width: 160px;
}

.admin-request-card td {
  overflow-wrap: normal;
  word-break: normal;
}

.admin-request-card td:nth-child(5),
.admin-request-card td:nth-child(6),
.admin-request-card td:nth-child(9) {
  white-space: normal;
}

.admin-request-card .admin-actions {
  display: flex;
  flex-wrap: nowrap;
  gap: 6px;
  justify-content: center;
  white-space: nowrap;
}

.admin-request-card .admin-actions button {
  margin: 0;
  min-width: 48px;
  padding: 8px 10px;
}

.admin-actions .action-view {
  background: #eff6ff;
  border-color: #bfdbfe;
  color: #1d4ed8;
}

.admin-actions .action-edit {
  background: #ecfdf5;
  border-color: #a7f3d0;
  color: #047857;
}

.admin-actions .action-delete {
  background: #fff1f2;
  border-color: #fecdd3;
  color: #be123c;
}

.bulk-actions .action-delete {
  background: #fff1f2;
  border: 1px solid #fecdd3;
  color: #be123c;
}

.admin-actions .action-restore {
  background: #f0fdf4;
  border-color: #bbf7d0;
  color: #15803d;
}

.trash-toggle {
  background: #fff7ed;
  border: 1px solid #fed7aa;
  border-radius: 10px;
  color: #c2410c;
  font-weight: 800;
  margin-top: 8px;
  min-height: 40px;
  padding: 9px 12px;
}

.trash-toggle.is-trash {
  background: #0f172a;
  border-color: #0f172a;
  color: #fff;
}

.student-import-panel {
  background: #f8fafc;
  border-bottom: 1px solid var(--line);
  display: grid;
  gap: 14px;
  grid-template-columns: minmax(260px, 420px) 1fr;
  padding: 18px 24px;
}

.student-import-panel form {
  align-items: end;
  display: grid;
  gap: 10px;
}

.student-import-panel input[type="file"] {
  background: #fff;
  margin-top: 6px;
}

.import-help {
  background: #fff;
  border: 1px solid #dbe5ef;
  border-radius: 10px;
  color: #334155;
  padding: 14px;
}

.import-help p {
  margin: 6px 0 0;
}

.sample-link {
  display: inline-flex;
  justify-content: center;
  text-decoration: none;
}

.bulk-actions {
  align-items: center;
  border-bottom: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 14px 24px;
}

.danger-button {
  background: #be123c;
  color: #fff;
}

.danger-button:hover {
  background: #9f1239;
}

.checkbox-label {
  align-items: center;
  display: flex;
  flex-direction: row;
  gap: 10px;
}

.checkbox-label input[type="checkbox"],
.student-row-check {
  height: 18px;
  min-height: 18px;
  width: 18px;
}

.student-manage-card #adminStudentTable th:first-child,
.student-manage-card #adminStudentTable td:first-child {
  text-align: center;
  width: 54px;
}

.modal-backdrop {
  align-items: center;
  background: rgba(15, 23, 42, .52);
  display: flex;
  inset: 0;
  justify-content: center;
  padding: 22px;
  position: fixed;
  z-index: 100;
}

.modal-backdrop[hidden] {
  display: none;
}

.modal-panel {
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 24px 60px rgba(15, 23, 42, .28);
  max-height: calc(100vh - 44px);
  max-width: 720px;
  overflow-y: auto;
  padding: 24px;
  width: 100%;
}

.modal-head {
  align-items: start;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  margin-bottom: 20px;
  padding-bottom: 14px;
}

.modal-head h2 {
  margin: 4px 0 0;
}

.modal-close {
  background: #f1f5f9;
  color: var(--text);
  font-size: 22px;
  height: 38px;
  line-height: 1;
  padding: 0;
  width: 38px;
}

.modal-close .icon {
  margin-right: 0;
}

.button-light {
  background: #f8fafc;
  border: 1px solid var(--line);
  color: var(--text);
}

.button-light:hover {
  background: #e2e8f0;
}

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

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

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 10px 12px;
  text-align: left;
  vertical-align: top;
}

th {
  background: #eef4f8;
  font-size: 13px;
}

.badge {
  background: #e6fffb;
  border-radius: 999px;
  color: var(--primary-dark);
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  padding: 4px 8px;
}

.request-table-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 14px 32px rgba(16, 42, 67, .1);
  margin-top: 28px;
  overflow: hidden;
  padding: 0;
}

.request-table-card .dataTables_wrapper {
  font-size: 14px;
  padding: 18px 24px 22px;
}

.request-table-card .dataTables_length,
.request-table-card .dataTables_filter {
  align-items: center;
  display: flex;
  margin: 0 0 16px;
}

.request-table-card .dt-toolbar,
.request-table-card .dt-footer {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: space-between;
}

.request-table-card .dt-toolbar {
  margin-bottom: 14px;
}

.request-table-card .dt-footer {
  margin-top: 12px;
}

.request-table-card .dt-buttons {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

#requestDataTable_wrapper .dt-buttons {
  display: none;
}

.request-table-card .dt-button,
.request-table-card button.dt-button {
  align-items: center;
  background: #fff !important;
  border: 1px solid #cbd5e1 !important;
  border-radius: 8px !important;
  box-shadow: none !important;
  color: #123047 !important;
  display: inline-flex;
  font-weight: 800;
  gap: 6px;
  justify-content: center;
  line-height: 1.2;
  margin: 0 !important;
  min-height: 42px;
  padding: 10px 12px !important;
}

.request-table-card .dt-button:hover,
.request-table-card button.dt-button:hover {
  background: #eff6ff !important;
  border-color: #bfdbfe !important;
  color: var(--blue) !important;
}

.request-table-card .dt-button .icon {
  margin-right: 2px;
}

.request-table-card .dataTables_length select,
.request-table-card .dataTables_filter input {
  display: inline-block;
  margin: 0 8px;
  min-height: 42px;
  width: auto;
}

.request-table-card .dataTables_filter input {
  background: #fff;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  min-width: 260px;
  padding: 10px 12px;
}

.request-table-card .dataTables_length select {
  border-radius: 10px;
  font-weight: 700;
  padding: 8px 28px 8px 10px;
}

.request-table-card .dataTables_info {
  color: var(--muted);
  padding-top: 14px;
}

.request-table-card .dataTables_paginate {
  padding-top: 10px;
}

.request-table-card .dataTables_paginate .paginate_button {
  background: #fff !important;
  border: 1px solid #d7dee8 !important;
  border-radius: 8px !important;
  color: #334155 !important;
  margin-left: 4px;
  padding: 8px 12px !important;
}

.request-table-card .dataTables_paginate .paginate_button.current {
  background: var(--blue) !important;
  border-color: var(--blue) !important;
  color: #fff !important;
}

.request-table-card .dataTables_paginate .paginate_button:hover {
  background: #eff6ff !important;
  border-color: #bfdbfe !important;
  color: var(--blue) !important;
}

.request-table-card .dataTables_paginate .paginate_button.current:hover {
  color: #fff !important;
}

.request-table-card table.dataTable thead th {
  border-bottom: 1px solid var(--line);
}

.request-table-card table.dataTable.no-footer {
  border-bottom: 1px solid var(--line);
}

.request-table-header {
  align-items: end;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(135deg, #fbfdff 0%, #f2f8f6 100%);
  display: flex;
  gap: 18px;
  justify-content: space-between;
  margin-bottom: 0;
  padding: 22px 24px 18px;
}

.request-table-header h2 {
  margin: 4px 0 0;
}

.table-mode-note {
  color: var(--muted);
  font-size: 13px;
  margin: 6px 0 0;
}

.year-filter {
  align-items: end;
  display: grid;
  gap: 6px;
  min-width: 190px;
}

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

.year-filter select {
  background: #fff;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  font-weight: 700;
  margin-top: 0;
  min-height: 42px;
}

.table-tools {
  align-items: end;
  display: flex;
  gap: 12px;
}

.table-tools label {
  color: var(--muted);
  font-weight: 700;
}

.table-tools select {
  min-width: 86px;
}

.table-tools input {
  min-width: 260px;
}

.table-scroll {
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow-x: auto;
  scrollbar-color: #94a3b8 #e2e8f0;
  scrollbar-width: thin;
}

.table-scroll::-webkit-scrollbar {
  height: 10px;
}

.table-scroll::-webkit-scrollbar-track {
  background: #e2e8f0;
  border-radius: 999px;
}

.table-scroll::-webkit-scrollbar-thumb {
  background: #94a3b8;
  border-radius: 999px;
}

.request-table {
  min-width: 960px;
}

.request-table th {
  background: #f1f5f9;
  color: #334155;
  font-size: 13px;
  letter-spacing: .01em;
  padding: 14px 12px;
  white-space: nowrap;
}

.request-table td {
  font-size: 14px;
  padding: 13px 12px;
  vertical-align: middle;
}

.request-table td:nth-child(5),
.request-table td:nth-child(6),
.request-table td:nth-child(9) {
  line-height: 1.45;
}

.request-table td:nth-child(1),
.request-table td:nth-child(7) {
  color: #0f172a;
  font-weight: 700;
  text-align: center;
}

.request-table td:nth-child(3) {
  color: var(--blue);
  font-weight: 700;
}

.request-table tbody tr:nth-child(even) {
  background: #f8fafc;
}

.request-table tbody tr:hover {
  background: #eaf4ff;
}

.table-status {
  border-radius: 999px;
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  padding: 5px 10px;
  white-space: nowrap;
}

.table-status.is-done {
  background: #dcfce7;
  color: #166534;
}

.table-status.is-waiting {
  background: #fef3c7;
  color: #92400e;
}

.table-status.is-issue {
  background: #ffe4e6;
  color: #be123c;
}

.table-footer {
  align-items: center;
  color: var(--muted);
  display: flex;
  font-size: 14px;
  gap: 16px;
  justify-content: space-between;
  margin-top: 14px;
}

.pager {
  align-items: center;
  display: flex;
  gap: 8px;
}

.pager button {
  background: #fff;
  border: 1px solid var(--line);
  color: var(--text);
  padding: 8px 11px;
}

.pager button:disabled {
  color: #94a3b8;
  cursor: not-allowed;
}

#requestPageInfo {
  color: var(--text);
  font-weight: 700;
  min-width: 54px;
  text-align: center;
}

@media (max-width: 780px) {
  .split,
  .hero-shell,
  .content-grid {
    grid-template-columns: 1fr;
  }

  .form-grid,
  .process-strip {
    grid-template-columns: 1fr;
  }

  .request-table-header,
  .dashboard-head,
  .table-tools,
  .table-footer {
    align-items: stretch;
    flex-direction: column;
  }

  .table-tools input {
    min-width: 0;
  }

  .request-table-card .dataTables_filter input {
    min-width: 0;
    width: 100%;
  }

  .topbar {
    align-items: start;
    flex-direction: column;
    gap: 8px;
    padding: 12px 16px;
  }

  .admin-shell {
    grid-template-columns: 1fr;
    padding: 18px 14px 42px;
  }

  .admin-sidebar {
    min-height: auto;
    position: static;
  }

  .admin-content {
    padding-left: 0;
    padding-top: 18px;
  }

  .admin-page-head {
    align-items: stretch;
    flex-direction: column;
  }

  .school-logo-hero {
    height: 64px;
    position: static;
    width: 64px;
    margin-bottom: 10px;
  }

  h1 {
    font-size: 28px;
  }
}

@media (max-width: 1180px) {
  .page {
    max-width: 100%;
    padding: 24px 18px 44px;
  }

  .hero-shell,
  .split,
  .content-grid {
    gap: 20px;
    grid-template-columns: 1fr;
  }

  .admin-shell {
    display: block;
    max-width: 100%;
    padding: 18px 16px 44px;
  }

  .admin-sidebar {
    min-height: auto;
    position: static;
  }

  .admin-profile {
    align-items: center;
    display: grid;
    grid-template-columns: 58px minmax(0, 1fr);
    padding: 14px 16px;
    text-align: left;
  }

  .admin-profile img {
    height: 52px;
    grid-row: span 2;
    width: 52px;
  }

  .admin-profile strong {
    margin-top: 0;
  }

  .admin-menu {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 10px 12px 14px;
    scrollbar-width: thin;
  }

  .admin-menu a {
    flex: 0 0 auto;
    padding: 10px 12px;
    white-space: nowrap;
  }

  .admin-content,
  .admin-content-wide {
    padding-left: 0;
    padding-top: 18px;
  }

  .admin-request-card .table-scroll,
  .admin-manage-card .table-scroll {
    overflow-x: auto;
  }

  .admin-request-card .request-table {
    min-width: 1340px;
  }

  .student-manage-card .request-table {
    min-width: 1340px;
  }

  .admin-manage-card .request-table {
    min-width: 980px;
  }

  .request-table-card {
    margin-top: 18px;
  }

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

@media (max-width: 900px) {
  .topbar {
    align-items: flex-start;
    gap: 10px;
    padding: 12px 16px;
  }

  .topbar nav {
    max-width: 100%;
    overflow-x: auto;
    padding-bottom: 2px;
  }

  .brand strong {
    font-size: 15px;
  }

  .brand small {
    font-size: 10px;
  }

  .hero-copy {
    min-height: 0;
  }

  .school-logo-hero {
    height: 70px;
    right: 18px;
    top: 18px;
    width: 70px;
  }

  .request-table-header,
  .dashboard-head,
  .admin-page-head {
    align-items: stretch;
    flex-direction: column;
  }

  .year-filter,
  .table-tools,
  .student-tools {
    min-width: 0;
    width: 100%;
  }

  .year-filter select,
  .year-filter button,
  .table-tools select,
  .table-tools input,
  .sample-link {
    width: 100%;
  }

  .request-table-card .dataTables_wrapper {
    padding: 14px;
  }

  .request-table-card .dataTables_length,
  .request-table-card .dataTables_filter,
  .request-table-card .dt-toolbar,
  .request-table-card .dt-footer,
  .request-table-card .dt-buttons {
    align-items: stretch;
    display: grid;
    gap: 8px;
    width: 100%;
  }

  .request-table-card .dt-toolbar {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 12px;
  }

  .request-table-card .dataTables_length,
  .request-table-card .dataTables_filter {
    margin-bottom: 0;
  }

  .request-table-card .dataTables_length label,
  .request-table-card .dataTables_filter label {
    color: #334155;
    display: grid;
    font-size: 0;
    font-weight: 700;
    gap: 6px;
    text-align: left;
    width: 100%;
  }

  .request-table-card .dataTables_length label::before {
    content: "แสดงรายการ";
    font-size: 13px;
  }

  .request-table-card .dataTables_filter label::before {
    content: "ค้นหา";
    font-size: 13px;
  }

  .request-table-card .dataTables_length select,
  .request-table-card .dataTables_filter input,
  .request-table-card .dt-button,
  .request-table-card button.dt-button {
    margin: 0;
    min-width: 0;
    width: 100%;
  }

  .request-table-card .dataTables_length select,
  .request-table-card .dataTables_filter input {
    font-size: 16px;
    height: 48px;
  }

  .request-table-card .dt-buttons {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .request-table-card .dt-button,
  .request-table-card button.dt-button {
    align-items: center;
    display: inline-flex;
    justify-content: center;
    min-height: 48px;
  }

  .request-table-card .dataTables_paginate {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: flex-start;
  }

  .request-table-card .dataTables_paginate .paginate_button {
    margin-left: 0;
  }

  .bulk-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .bulk-actions button {
    width: 100%;
  }
}

@media (max-width: 640px) {
  body {
    font-size: 15px;
  }

  .page {
    padding: 16px 12px 34px;
  }

  .topbar {
    position: static;
  }

  .brand {
    max-width: 100%;
  }

  .school-logo-mini {
    height: 34px;
    width: 34px;
  }

  .topbar nav a {
    padding: 8px 9px;
  }

  .hero-copy,
  .panel,
  .notice,
  .request-table-card,
  .document-info-card {
    border-radius: 10px;
  }

  .hero-copy {
    padding: 20px 16px;
  }

  .school-logo-hero {
    margin-bottom: 10px;
    position: static;
  }

  .lead {
    font-size: 16px;
  }

  .hero-actions,
  .panel-heading,
  .form-footer {
    align-items: stretch;
    flex-direction: column;
  }

  .hero-actions button,
  .hero-actions .button,
  .form-footer button,
  .form-footer .button-light {
    width: 100%;
  }

  .inline,
  .form-grid,
  .process-strip {
    grid-template-columns: 1fr;
  }

  input,
  select,
  textarea,
  button,
  .button {
    min-height: 44px;
  }

  .admin-shell {
    padding: 12px 10px 32px;
  }

  .admin-profile {
    grid-template-columns: 44px minmax(0, 1fr);
    padding: 12px;
  }

  .admin-profile img {
    height: 40px;
    width: 40px;
  }

  .admin-menu {
    gap: 6px;
    padding: 8px 10px 12px;
  }

  .admin-menu a {
    border: 1px solid rgba(255, 255, 255, .12);
    font-size: 13px;
    padding: 9px 10px;
  }

  .request-table-header {
    padding: 18px 14px 14px;
  }

  .student-import-panel,
  .bulk-actions {
    padding: 14px;
  }

  .modal-backdrop {
    align-items: stretch;
    padding: 8px;
  }

  .modal-panel {
    border-radius: 10px;
    max-height: calc(100vh - 16px);
    padding: 16px;
  }

  .modal-head {
    gap: 12px;
  }

  .modal-close {
    flex: 0 0 auto;
  }

  .table-scroll {
    margin-left: -1px;
    margin-right: -1px;
  }

  .request-table,
  table {
    min-width: 880px;
  }

  .admin-request-card .request-table {
    min-width: 1340px;
  }

  .student-manage-card .request-table {
    min-width: 1340px;
  }

  .admin-manage-card .request-table {
    min-width: 980px;
  }

  .request-table th,
  .request-table td {
    font-size: 13px;
    padding: 10px 9px;
  }

  .admin-actions {
    gap: 5px;
  }

  .admin-actions button,
  .admin-request-card .admin-actions button {
    min-height: 38px;
    min-width: 52px;
    padding: 8px 9px;
  }

  .auth-page {
    min-height: auto;
    padding: 20px 0;
  }

  .auth-card {
    padding: 22px 16px;
  }

  .auth-head h1 {
    font-size: 26px;
  }
}
