:root {
  --bg: #f3f6fb;
  --surface: rgba(255, 255, 255, 0.9);
  --surface-strong: #ffffff;
  --line: rgba(18, 31, 53, 0.08);
  --text: #15263c;
  --muted: #74859b;
  --primary: #2f7bef;
  --primary-strong: #1f63cb;
  --green: #33b864;
  --shadow: 0 18px 44px rgba(44, 66, 92, 0.08);
  font-family: "SF Pro Display", "PingFang SC", "Helvetica Neue", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(47, 123, 239, 0.18), transparent 24%),
    linear-gradient(180deg, #f7f9fc 0%, #eef3f8 100%);
  color: var(--text);
}

.app-hidden {
  display: none !important;
}

.admin-login {
  position: relative;
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 24px;
}

.admin-login-card {
  display: grid;
  gap: 16px;
  width: min(420px, 100%);
  padding: 30px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.admin-login-mark {
  width: 58px;
  height: 58px;
  border-radius: 16px;
  object-fit: cover;
  background: #fff;
  box-shadow: var(--shadow);
}

.admin-login-card h1,
.admin-login-card p {
  margin: 0;
}

.admin-login-card h1 {
  font-size: 28px;
}

.admin-login-card p {
  color: var(--muted);
  line-height: 1.55;
}

.admin-login-card label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.shell {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  display: flex;
  min-height: 100vh;
  flex-direction: column;
  padding: 28px 20px;
  border-right: 1px solid var(--line);
  background: rgba(248, 250, 253, 0.92);
  backdrop-filter: blur(18px);
}

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

.brand-mark {
  width: 50px;
  height: 50px;
  border-radius: 16px;
  display: block;
  object-fit: cover;
  background: #fff;
  box-shadow: var(--shadow);
}

.brand h1,
.brand p,
.header h2,
.header p,
.card h3 {
  margin: 0;
}

.brand h1 {
  font-size: 22px;
}

.brand p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 14px;
}

.nav {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 32px;
}

.site-icp {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
  text-align: center;
  text-decoration: none;
}

.site-icp:hover {
  color: var(--primary-strong);
}

.login-icp {
  position: absolute;
  right: 24px;
  bottom: 22px;
  left: 24px;
}

.sidebar-icp {
  margin-top: auto;
  padding-top: 28px;
}

.nav-link {
  border: none;
  border-radius: 12px;
  padding: 14px 16px;
  text-align: left;
  background: transparent;
  color: #465971;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
}

.nav-link-active {
  background: linear-gradient(135deg, rgba(47, 123, 239, 0.16), rgba(51, 184, 100, 0.14));
  color: var(--text);
}

.main {
  padding: 28px;
}

.header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 20px;
}

.header h2 {
  font-size: 30px;
}

.header p {
  margin-top: 8px;
  color: var(--muted);
}

.panel {
  display: none;
}

.panel-active {
  display: block;
}

.stats-grid,
.two-col {
  display: grid;
  gap: 18px;
}

.stats-grid {
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  margin-bottom: 18px;
}

.two-col {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.teacher-sections {
  display: grid;
  gap: 18px;
}

.campus-class-card {
  margin-top: 18px;
}

.stat-card,
.card {
  border: 1px solid var(--line);
  border-radius: 28px;
  background: var(--surface);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.stat-card {
  padding: 22px;
}

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

.stat-value {
  display: block;
  margin-top: 10px;
  font-size: 34px;
  line-height: 1;
}

.card {
  padding: 20px;
}

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

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

.stack-form label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
}

input,
select,
button {
  font: inherit;
}

input,
select {
  width: 100%;
  border: 1px solid rgba(26, 43, 67, 0.12);
  border-radius: 16px;
  padding: 12px 14px;
  background: #fff;
  color: var(--text);
}

.primary-btn,
.secondary-btn {
  border: none;
  border-radius: 12px;
  padding: 12px 18px;
  font-weight: 700;
  cursor: pointer;
}

.primary-btn {
  color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--green));
}

.secondary-btn {
  color: var(--text);
  background: #e9eef5;
}

button:disabled,
select:disabled {
  cursor: not-allowed;
  opacity: 0.56;
}

.danger-btn {
  color: #b42318;
  background: #fff0ed;
}

.toolbar {
  display: flex;
  gap: 12px;
  margin-bottom: 14px;
}

.list-tip {
  padding: 10px 14px;
  border-radius: 14px;
  background: #f4f7fb;
  color: var(--muted);
  font-size: 13px;
}

.toolbar-wide {
  flex-wrap: wrap;
}

.list-stack {
  display: grid;
  gap: 12px;
}

.list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  border-radius: 18px;
  background: var(--surface-strong);
  border: 1px solid rgba(21, 38, 60, 0.06);
}

.list-item-main {
  flex: 1;
}

.list-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 280px;
}

.list-actions-compact {
  min-width: 360px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

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

.monitor-card {
  padding: 18px;
  border-radius: 20px;
  background: linear-gradient(135deg, rgba(47, 123, 239, 0.08), rgba(51, 184, 100, 0.08));
  border: 1px solid rgba(47, 123, 239, 0.08);
}

.monitor-label {
  display: block;
  color: var(--muted);
  font-size: 13px;
}

.monitor-value {
  display: block;
  margin-top: 10px;
  font-size: 32px;
  line-height: 1;
}

.list-title {
  font-size: 16px;
  font-weight: 700;
}

.list-meta {
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
}

.campus-request-hint {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  width: fit-content;
  max-width: 100%;
  margin-top: 10px;
  padding: 8px 10px;
  border: 1px solid rgba(245, 158, 11, 0.26);
  border-radius: 12px;
  background: rgba(245, 158, 11, 0.1);
  color: #764409;
  font-size: 13px;
}

.campus-request-label {
  font-weight: 800;
}

.campus-request-name {
  font-weight: 800;
  color: #15263c;
}

.campus-request-note {
  color: #8a560d;
}

.feedback-copy {
  margin-top: 10px;
  font-size: 14px;
  line-height: 1.6;
  color: var(--text);
}

.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 74px;
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  background: #edf2f8;
  color: #58708d;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  margin-left: 8px;
  padding: 4px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  vertical-align: middle;
  background: #edf2f8;
  color: #58708d;
}

.status-ACTIVE {
  background: rgba(51, 184, 100, 0.14);
  color: #168046;
}

.status-PENDING,
.status-WAITING_BIND {
  background: rgba(245, 158, 11, 0.16);
  color: #9a5b05;
}

.status-DISABLED,
.status-REMOVED {
  background: rgba(100, 116, 139, 0.15);
  color: #536173;
}

.code-text {
  color: var(--primary-strong);
  font-weight: 800;
  letter-spacing: 0.02em;
}

.table-wrap {
  overflow: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 12px 10px;
  text-align: left;
  border-bottom: 1px solid rgba(21, 38, 60, 0.08);
  white-space: nowrap;
}

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

td {
  font-size: 14px;
}

.empty {
  padding: 22px 18px;
  border-radius: 18px;
  color: var(--muted);
  background: #f4f7fb;
  text-align: center;
}

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  transform: translateY(20px);
  opacity: 0;
  pointer-events: none;
  padding: 12px 16px;
  border-radius: 14px;
  background: rgba(21, 38, 60, 0.92);
  color: #fff;
  transition: 180ms ease;
}

.toast-visible {
  transform: translateY(0);
  opacity: 1;
}

.login-error {
  margin: 14px 0 0;
  color: #b42318;
  font-size: 14px;
  line-height: 1.5;
  text-align: center;
}

@media (max-width: 980px) {
  .shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    min-height: auto;
    border-right: none;
    border-bottom: 1px solid var(--line);
  }

  .stats-grid,
  .two-col {
    grid-template-columns: 1fr;
  }

  .monitor-grid {
    grid-template-columns: 1fr;
  }

  .list-item {
    align-items: flex-start;
    flex-direction: column;
  }

  .list-actions {
    width: 100%;
    min-width: 0;
    flex-direction: column;
  }
}
