html,
body,
:root {
  margin: 0 !important;
  padding: 0 !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
}

html {
  scrollbar-gutter: stable;
  scrollbar-width: thin;
  scrollbar-color: rgba(32, 107, 196, 0.45) rgba(148, 163, 184, 0.12);
}

html::-webkit-scrollbar,
body::-webkit-scrollbar {
  width: 12px;
  height: 12px;
}

html::-webkit-scrollbar-track,
body::-webkit-scrollbar-track {
  background: rgba(148, 163, 184, 0.12);
}

html::-webkit-scrollbar-thumb,
body::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, rgba(32, 107, 196, 0.72) 0%, rgba(59, 130, 246, 0.56) 100%);
  border: 3px solid rgba(248, 250, 252, 0.9);
  border-radius: 999px;
}

html::-webkit-scrollbar-thumb:hover,
body::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, rgba(32, 107, 196, 0.92) 0%, rgba(59, 130, 246, 0.78) 100%);
}

:root {
  --app-font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  --tblr-font-sans-serif: var(--app-font-sans);
  --tblr-body-font-family: var(--app-font-sans);
  --admin-bg: linear-gradient(180deg, #f4f7fb 0%, #eef2f7 100%);
  --admin-accent: #206bc4;
  --admin-accent-soft: rgba(32, 107, 196, 0.12);
  --admin-border: rgba(15, 23, 42, 0.08);
  --admin-text-soft: #667085;
  --admin-shadow: 0 18px 40px rgba(15, 23, 42, 0.08);
}

body {
  min-height: 100vh;
  background: var(--admin-bg);
  color: #182433;
  font-family: var(--app-font-sans);
}

body.modal-open {
  padding-right: 0 !important;
}

.page {
  min-height: 100vh;
}

.page-body {
  padding: 1.5rem 0 2rem;
}

.admin-page {
  display: grid;
  gap: 1rem;
}

.admin-dashboard {
  display: grid;
  grid-template-columns: minmax(300px, 360px) minmax(0, 1fr);
  gap: 1.5rem;
  align-items: start;
}

.admin-dashboard__sidebar,
.admin-dashboard__main,
.admin-dashboard__content-grid,
.admin-dashboard__content-grid > .card {
  min-width: 0;
}

.admin-dashboard__main {
  display: grid;
  gap: 1rem;
  align-content: start;
}

.admin-dashboard__content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(280px, 0.7fr);
  gap: 1rem;
  align-items: start;
}

.app-navbar {
  position: sticky;
  top: 0;
  z-index: 1030;
  background: rgba(255, 255, 255, 0.97);
  border-bottom: 1px solid var(--admin-border);
}

.app-toast-stack {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 1085;
  display: grid;
  gap: 0.75rem;
  pointer-events: none;
}

.app-toast {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.85rem;
  min-width: min(360px, calc(100vw - 2rem));
  max-width: min(420px, calc(100vw - 2rem));
  padding: 0.9rem 1rem;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 1rem;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 20px 44px rgba(15, 23, 42, 0.18);
  opacity: 0;
  transform: translate3d(0, -10px, 0) scale(0.98);
  transition: opacity 0.2s ease, transform 0.2s ease;
  pointer-events: auto;
}

.app-toast.is-visible {
  opacity: 1;
  transform: translate3d(0, 0, 0) scale(1);
}

.app-toast.is-leaving {
  opacity: 0;
  transform: translate3d(0, -8px, 0) scale(0.98);
}

.app-toast--success {
  border-color: rgba(34, 197, 94, 0.2);
}

.app-toast--success .app-toast__badge {
  background: linear-gradient(180deg, #22c55e 0%, #16a34a 100%);
}

.app-toast--error {
  border-color: rgba(239, 68, 68, 0.24);
}

.app-toast--error .app-toast__badge {
  background: linear-gradient(180deg, #ef4444 0%, #dc2626 100%);
}

.app-toast__badge {
  width: 0.72rem;
  height: 0.72rem;
  border-radius: 50%;
  box-shadow: 0 0 0 0.28rem rgba(32, 107, 196, 0.12);
}

.app-toast__content {
  min-width: 0;
}

.app-toast__message {
  color: #0f172a;
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.55;
  word-break: break-word;
}

.app-toast__close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #64748b;
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
  transition: background-color 0.18s ease, color 0.18s ease;
}

.app-toast__close:hover {
  background: rgba(148, 163, 184, 0.14);
  color: #0f172a;
}

.app-backtotop {
  position: fixed;
  right: 1.5rem;
  bottom: 1.5rem;
  z-index: 1040;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  min-height: 3rem;
  padding: 0.78rem 1rem;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(135deg, #206bc4 0%, #4f8ef7 100%);
  color: #fff;
  font-size: 0.92rem;
  font-weight: 800;
  letter-spacing: 0.01em;
  box-shadow: 0 18px 36px rgba(32, 107, 196, 0.26);
  opacity: 0;
  transform: translateY(14px);
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}

.app-backtotop:hover {
  box-shadow: 0 22px 42px rgba(32, 107, 196, 0.32);
}

.app-backtotop:focus-visible {
  outline: 3px solid rgba(32, 107, 196, 0.18);
  outline-offset: 3px;
}

.app-backtotop.is-visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.app-backtotop__icon {
  display: inline-grid;
  place-items: center;
  width: 1.35rem;
  height: 1.35rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  font-size: 0.95rem;
  line-height: 1;
}

.app-backtotop__text {
  line-height: 1;
}

.app-brand {
  color: #111827;
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-decoration: none;
}

.app-avatar {
  background: linear-gradient(135deg, #206bc4 0%, #4299e1 100%);
  color: #fff;
  font-weight: 700;
}

.hero-card {
  border: 1px solid var(--admin-border);
  box-shadow: var(--admin-shadow);
}

.hero-card__title,
.auth-panel__title {
  margin: 0;
  font-size: clamp(2rem, 3vw, 3rem);
  line-height: 1.05;
}

.hero-card__eyebrow,
.admin-kicker {
  color: var(--admin-accent);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.hero-card__body,
.auth-panel__text {
  margin-top: 1rem;
  color: var(--admin-text-soft);
  line-height: 1.7;
}

.hero-card__actions {
  margin-top: 1.5rem;
}

.admin-home-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  margin-top: 1.75rem;
}

.admin-home-stat {
  padding: 1rem 1.1rem;
  border: 1px solid var(--admin-border);
  border-radius: 1rem;
  background: rgba(255, 255, 255, 0.82);
}

.admin-home-stat__label {
  display: block;
  color: var(--admin-text-soft);
  font-size: 0.9rem;
}

.admin-home-stat__value {
  display: block;
  margin-top: 0.35rem;
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  line-height: 1;
}

.admin-home-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.admin-home-grid--spaced {
  margin-top: 1.5rem;
}

.admin-tool-card {
  height: 100%;
}

.admin-tool-card .card-body {
  display: grid;
  gap: 1rem;
  align-content: start;
}

.admin-tool-card__title {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 800;
}

.admin-tool-card__text {
  margin: 0;
  color: var(--admin-text-soft);
  line-height: 1.7;
}

.auth-panel {
  min-height: calc(100vh - 180px);
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 1.5rem;
  align-items: center;
}

.auth-panel__intro,
.auth-form {
  border: 1px solid var(--admin-border);
  border-radius: 1.25rem;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--admin-shadow);
  padding: 2rem;
}

.admin-dashboard .card {
  border: 1px solid var(--admin-border);
  box-shadow: var(--admin-shadow);
}

.admin-sidebar-card {
  overflow: hidden;
}

.admin-sidebar-card__header {
  display: flex;
  justify-content: space-between;
  padding: 1.25rem 1.25rem 0.75rem;
  align-items: flex-start;
  gap: 1rem;
}

.admin-sidebar-card__actions {
  display: grid;
  gap: 0.75rem;
  min-width: 9rem;
  margin-left: auto;
  flex-shrink: 0;
}

.admin-sidebar-card__actions .btn {
  width: 100%;
}

.school-list {
  display: grid;
  gap: 0.875rem;
}

.school-list__item {
  display: block;
  padding: 1rem;
  border: 1px solid var(--admin-border);
  border-radius: 1rem;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(247, 249, 252, 0.92) 100%);
  color: inherit;
  text-decoration: none;
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.school-list__item:hover {
  transform: translateY(-1px);
  border-color: rgba(32, 107, 196, 0.3);
  box-shadow: 0 12px 24px rgba(32, 107, 196, 0.08);
}

.school-list__item--active {
  border-color: rgba(32, 107, 196, 0.42);
  background: linear-gradient(180deg, rgba(234, 242, 255, 0.98) 0%, rgba(247, 250, 255, 0.98) 100%);
}

.school-list__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.school-list__title {
  font-size: 1rem;
  font-weight: 700;
}

.school-list__subtitle {
  margin-top: 0.4rem;
  color: var(--admin-text-soft);
  line-height: 1.5;
}

.school-list__slug {
  margin-top: 0.75rem;
  color: #94a3b8;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.empty-panel {
  padding: 1.5rem;
  border: 1px dashed rgba(100, 116, 139, 0.35);
  border-radius: 1rem;
  background: rgba(248, 250, 252, 0.8);
  text-align: center;
}

.empty-panel--soft {
  background: transparent;
}

.empty-panel--danger {
  border-style: solid;
  border-color: rgba(220, 38, 38, 0.18);
  background: rgba(254, 242, 242, 0.9);
}

.empty-panel__title {
  font-size: 1rem;
  font-weight: 700;
}

.empty-panel__text {
  margin: 0.625rem 0 1rem;
  color: var(--admin-text-soft);
}

.hero-masthead {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at top right, rgba(32, 107, 196, 0.14), transparent 28%),
    linear-gradient(135deg, #0f172a 0%, #16213a 55%, #1d4f91 100%);
  color: #fff;
}

.hero-masthead::after {
  content: "";
  position: absolute;
  inset: auto -80px -80px auto;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
}

.hero-masthead .card-body {
  position: relative;
  z-index: 1;
  padding: 1.5rem;
}

.hero-masthead__title {
  margin: 0.4rem 0 0;
  font-size: clamp(1.9rem, 3vw, 2.8rem);
  line-height: 1.05;
}

.hero-masthead__text {
  max-width: 640px;
  margin: 0.85rem 0 0;
  color: rgba(255, 255, 255, 0.78);
  line-height: 1.7;
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.625rem;
  margin-top: 1rem;
}

.hero-masthead--empty {
  min-height: 320px;
  display: flex;
  align-items: center;
}

.hero-tools {
  display: grid;
  gap: 1rem;
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(120px, 1fr));
  gap: 0.875rem;
}

.hero-stats__item {
  padding: 1rem 1.1rem;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 1rem;
  background: rgba(255, 255, 255, 0.14);
}

.hero-stats__label {
  display: block;
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.72);
}

.hero-stats__value {
  display: block;
  margin-top: 0.3rem;
  font-size: 1.8rem;
  line-height: 1;
}

.hero-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.hero-actions form,
.qr-hero__actions form,
.qr-card__actions form,
.modal-footer form {
  margin: 0;
}

.school-qrcode {
  display: grid;
  justify-items: center;
  gap: 1rem;
}

.school-qrcode__poster {
  width: min(100%, 340px);
}

.school-qrcode__canvas {
  width: 292px;
  height: 292px;
}

.school-qrcode__logo-wrap {
  width: 92px;
  height: 92px;
}

.school-qrcode__hint {
  color: var(--admin-text-soft);
  font-size: 0.92rem;
  text-align: center;
}

.school-qrcode__footer {
  font-size: 0.98rem;
}

.revision-history__intro {
  margin-bottom: 1rem;
  padding: 0.95rem 1rem;
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 1rem;
  background: rgba(248, 250, 252, 0.88);
  color: var(--admin-text-soft);
  font-size: 0.95rem;
  line-height: 1.75;
}

.revision-history__list {
  display: grid;
  gap: 0.85rem;
  max-height: 26rem;
  padding-right: 0.35rem;
  overflow-y: auto;
}

.revision-history__item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.05rem 1.1rem;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 1rem;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(248, 250, 252, 0.88) 100%);
}

.revision-history__main {
  min-width: 0;
  display: grid;
  gap: 0.55rem;
}

.revision-history__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.85rem;
  flex-wrap: wrap;
}

.revision-history__action {
  display: inline-flex;
  align-items: center;
  min-height: 2rem;
  padding: 0 0.82rem;
  border-radius: 999px;
  background: rgba(32, 107, 196, 0.1);
  color: var(--admin-accent);
  font-size: 0.86rem;
  font-weight: 800;
  line-height: 1;
}

.revision-history__time {
  color: #0f172a;
  font-size: 0.9rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.revision-history__summary {
  color: #475569;
  font-size: 1rem;
  line-height: 1.7;
  word-break: break-word;
}

.revision-history__school {
  color: #0f172a;
  font-size: 1.02rem;
  font-weight: 800;
  line-height: 1.4;
}

.revision-history__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem;
}

.revision-history__slug {
  color: #94a3b8;
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.revision-history__empty {
  margin: 0;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.section-head__title {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
}

.section-head__text {
  margin: 0.3rem 0 0;
  color: var(--admin-text-soft);
}

.section-head--tight {
  margin-bottom: 0;
}

.section-head__actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-shrink: 0;
}

.tab-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.tab-pills__item {
  display: inline-flex;
  align-items: center;
  min-height: 2.5rem;
  padding: 0 1rem;
  border: 1px solid rgba(100, 116, 139, 0.2);
  border-radius: 999px;
  background: #fff;
  color: #334155;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.18s ease;
}

.tab-pills__item:hover {
  color: var(--admin-accent);
  border-color: rgba(32, 107, 196, 0.35);
}

.tab-pills__item--active {
  border-color: transparent;
  background: #206bc4;
  color: #fff;
  box-shadow: 0 10px 20px rgba(32, 107, 196, 0.24);
}

.type-actions {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-left: auto;
}

.qr-hero__head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 1.5rem 2.5rem;
  margin-bottom: 1.5rem;
}

.qr-hero__intro {
  display: grid;
  gap: 1rem;
  max-width: 40rem;
}

.qr-hero__title {
  margin: 0;
  font-size: clamp(1.95rem, 3vw, 2.75rem);
  line-height: 1.02;
  letter-spacing: -0.03em;
}

.qr-hero__text {
  max-width: 31rem;
  margin: 0;
  color: var(--admin-text-soft);
  font-size: 1.02rem;
  line-height: 1.85;
}

.qr-hero__summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.85rem 1rem;
}

.qr-hero__summary-badge {
  display: inline-flex;
  align-items: center;
  min-height: 2rem;
  padding: 0 0.8rem;
  border-radius: 999px;
  background: rgba(32, 107, 196, 0.1);
  color: var(--admin-accent);
  font-size: 0.9rem;
  font-weight: 700;
}

.qr-hero__summary-text {
  color: var(--admin-text-soft);
  font-size: 0.92rem;
  line-height: 1.5;
}

.qr-hero__actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: nowrap;
  margin-left: auto;
}

.qr-hero__actions .btn {
  min-width: 9.75rem;
  white-space: nowrap;
}

.qr-toolbar {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 1rem;
  flex-wrap: wrap;
}

.qr-toolbar__search {
  flex: 1 1 360px;
  max-width: 560px;
}

.qr-toolbar__meta {
  color: var(--admin-text-soft);
  font-size: 0.95rem;
}

.qr-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 1rem;
}

.qr-card .card-body {
  display: grid;
  gap: 1rem;
}

.qr-card__head {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
}

.qr-card__index {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 3rem;
  min-height: 2rem;
  padding: 0 0.75rem;
  border-radius: 999px;
  background: var(--admin-accent-soft);
  color: var(--admin-accent);
  font-weight: 800;
}

.qr-card__title {
  margin: 0.75rem 0 0;
  font-size: 1.1rem;
  font-weight: 800;
}

.qr-card__subtitle {
  margin: 0.45rem 0 0;
  color: var(--admin-text-soft);
  line-height: 1.6;
}

.qr-poster {
  position: relative;
  display: grid;
  justify-items: center;
  width: min(100%, 336px);
  margin-inline: auto;
  gap: 0.75rem;
  padding: 0.55rem 0.55rem 3rem;
  border: 1px solid rgba(32, 107, 196, 0.14);
  border-radius: 1.1rem;
  background: linear-gradient(180deg, #ffffff 0%, #f7fbff 100%);
  overflow: hidden;
}

.qr-poster__canvas {
  width: 292px;
  height: 292px;
  padding: 0.2rem;
  border-radius: 1rem;
  background: #fff;
  box-shadow: 0 14px 30px rgba(15, 23, 42, 0.08);
}

.qr-poster__canvas canvas,
.qr-poster__canvas img,
.qr-poster__canvas table {
  width: 100% !important;
  height: 100% !important;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

.qr-poster__logo-wrap {
  position: absolute;
  left: 50%;
  top: calc(0.55rem + 146px);
  transform: translate(-50%, -50%);
  width: 92px;
  height: 92px;
  padding: 0.35rem;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.14);
}

.qr-poster__logo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.qr-poster__logo--placeholder {
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #206bc4 0%, #5aa7ff 100%);
  color: #fff;
  font-size: 1.6rem;
  font-weight: 800;
}

.qr-poster__footer {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 0.7rem 0.55rem 0.75rem;
  color: var(--admin-accent);
  font-weight: 800;
  text-align: center;
  line-height: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: 0;
  font-size: 0.98rem;
  background: linear-gradient(180deg, rgba(247, 251, 255, 0) 0%, rgba(247, 251, 255, 1) 45%);
}

.qr-card__meta {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 0.75rem;
}

.qr-card__meta-main {
  min-width: 0;
  display: grid;
  gap: 0.35rem;
}

.qr-card__slug {
  color: #94a3b8;
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.qr-card__updated {
  color: var(--admin-text-soft);
  font-size: 0.92rem;
  line-height: 1.4;
  font-variant-numeric: tabular-nums;
  word-break: break-word;
}

.qr-card__public-link {
  justify-self: end;
}

.qr-card__actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  flex-wrap: wrap;
  align-items: stretch;
}

.qr-card__actions > * {
  min-width: 0;
}

.qr-card__actions .btn {
  min-width: 11rem;
}

.app-confirm-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1100;
  display: grid;
  place-items: center;
  padding: 1.5rem;
  background: rgba(15, 23, 42, 0.36);
  opacity: 0;
  transition: opacity 0.18s ease;
}

.app-confirm-backdrop[hidden] {
  display: none !important;
}

.app-confirm-open {
  overflow: hidden;
}

.app-confirm-backdrop.is-visible {
  opacity: 1;
}

.app-confirm-dialog {
  position: relative;
  width: min(100%, 31rem);
  padding: 1.5rem 1.5rem 1.2rem;
  border: 1px solid rgba(203, 213, 225, 0.78);
  border-radius: 1.1rem;
  background: #fff;
  box-shadow: 0 24px 48px rgba(15, 23, 42, 0.18);
  transform: translateY(8px) scale(0.985);
  transition: transform 0.18s ease;
}

.app-confirm-backdrop.is-visible .app-confirm-dialog {
  transform: translateY(0) scale(1);
}

.app-confirm__close {
  position: absolute;
  top: 0.85rem;
  right: 0.85rem;
  width: 2rem;
  height: 2rem;
  border: 0;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.12);
  color: #64748b;
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  transition: background-color 0.18s ease, color 0.18s ease;
}

.app-confirm__close:hover {
  background: rgba(148, 163, 184, 0.14);
  color: #0f172a;
}

.app-confirm__label {
  display: inline-flex;
  align-items: center;
  min-height: 1.9rem;
  padding: 0 0.7rem;
  border-radius: 999px;
  background: rgba(220, 38, 38, 0.08);
  color: #dc2626;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.app-confirm-backdrop[data-tone="primary"] .app-confirm__label {
  background: rgba(32, 107, 196, 0.1);
  color: var(--admin-accent);
}

.app-confirm-backdrop[data-tone="warning"] .app-confirm__label {
  background: rgba(245, 158, 11, 0.12);
  color: #b45309;
}

.app-confirm__title {
  margin: 0.8rem 0 0;
  font-size: 1.2rem;
  line-height: 1.35;
}

.app-confirm__message {
  margin-top: 0.75rem;
  color: var(--admin-text-soft);
  font-size: 0.95rem;
  line-height: 1.72;
  white-space: pre-line;
}

.app-confirm__actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  margin-top: 1.1rem;
  flex-wrap: wrap;
}

.app-confirm__actions .btn {
  min-width: 7.5rem;
}

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

.subject-table {
  width: 100%;
  min-width: 760px;
  border-collapse: separate;
  border-spacing: 0;
}

.subject-table thead th {
  padding: 0 1rem 0.8rem;
  border-bottom: 1px solid rgba(100, 116, 139, 0.16);
  color: var(--admin-text-soft);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
}

.subject-table thead th:first-child,
.subject-table tbody td:first-child {
  padding-left: 0;
}

.subject-table thead th:last-child,
.subject-table tbody td:last-child {
  padding-right: 0;
}

.subject-table tbody td {
  padding: 0.9rem 1rem;
  border-bottom: 1px solid rgba(100, 116, 139, 0.12);
  vertical-align: middle;
}

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

.subject-table__index {
  width: 76px;
  color: var(--admin-accent);
  font-size: 1rem;
  font-weight: 800;
}

.subject-table__name {
  min-width: 0;
}

.subject-table__quota {
  width: 120px;
}

.subject-table__quota .form-control {
  width: 5.5rem;
  min-width: 5.5rem;
  text-align: center;
}

.subject-table__action-head {
  text-align: right;
}

.subject-table__actions {
  width: 188px;
  text-align: right;
  white-space: nowrap;
}

.subject-inline-form {
  display: none;
}

.subject-field {
  position: relative;
  min-width: 0;
}

.subject-field__label {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--admin-text-soft);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.subject-field--name {
  min-width: 0;
}

.subject-field__label--sr-only {
  display: none;
}

.subject-field .form-control {
  height: 44px;
  min-width: 0;
}

.subject-table__name .form-control {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.subject-field--tooltip:hover::after,
.subject-field--tooltip:focus-within::after {
  content: attr(data-fulltext);
  position: absolute;
  left: 0;
  right: auto;
  bottom: calc(100% + 0.5rem);
  max-width: min(36rem, 80vw);
  padding: 0.55rem 0.75rem;
  border-radius: 0.75rem;
  background: rgba(15, 23, 42, 0.94);
  color: #fff;
  font-size: 0.82rem;
  line-height: 1.5;
  white-space: normal;
  word-break: break-word;
  box-shadow: 0 16px 32px rgba(15, 23, 42, 0.2);
  z-index: 8;
}

.subject-save {
  min-width: 88px;
  width: auto;
  height: 44px;
  margin-right: 0.625rem;
}

.subject-table__actions .btn {
  min-width: 88px;
  height: 44px;
}

.quick-create-card {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(243, 247, 252, 0.96) 100%);
}

.quick-create-form {
  display: grid;
  gap: 1rem;
}

.quick-create-form__field {
  display: grid;
  gap: 0.45rem;
}

.modal-content {
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: 1.25rem;
  box-shadow: 0 28px 56px rgba(15, 23, 42, 0.18);
}

.modal-force-open {
  display: block;
}

.modal-header,
.modal-footer {
  padding-left: 1.5rem;
  padding-right: 1.5rem;
}

.modal-body {
  padding: 1rem 1.5rem 0.5rem;
}

.logo-uploader {
  display: grid;
  gap: 0.75rem;
}

.logo-uploader__input {
  display: none;
}

.logo-uploader__surface {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  gap: 1rem;
  align-items: center;
  padding: 1rem;
  border: 1px dashed rgba(100, 116, 139, 0.28);
  border-radius: 1rem;
  background: rgba(248, 250, 252, 0.92);
  cursor: pointer;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease;
}

.logo-uploader__surface:hover,
.logo-uploader__surface:focus-visible,
.logo-uploader__surface--dragover {
  border-color: rgba(32, 107, 196, 0.42);
  box-shadow: 0 14px 28px rgba(32, 107, 196, 0.08);
  background: rgba(239, 246, 255, 0.9);
}

.logo-uploader__surface--empty {
  background: rgba(248, 250, 252, 0.8);
}

.logo-uploader__preview {
  width: 120px;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 0.875rem;
  background: #fff;
  border: 1px solid rgba(15, 23, 42, 0.08);
  flex-shrink: 0;
}

.logo-uploader__preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.logo-uploader__preview--empty {
  background: linear-gradient(180deg, rgba(241, 245, 249, 0.9) 0%, rgba(255, 255, 255, 0.92) 100%);
}

.logo-uploader__placeholder {
  padding: 0 0.75rem;
  color: var(--admin-text-soft);
  font-size: 0.88rem;
  text-align: center;
  line-height: 1.5;
}

.logo-uploader__body {
  display: grid;
  gap: 0.75rem;
  min-width: 0;
}

.logo-uploader__title {
  font-size: 1rem;
  font-weight: 700;
}

.logo-uploader__text {
  color: var(--admin-text-soft);
  line-height: 1.6;
}

.logo-uploader__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.logo-uploader__status {
  color: var(--admin-text-soft);
  font-size: 0.92rem;
  line-height: 1.5;
}

.logo-uploader__meta {
  display: grid;
  gap: 0.75rem;
  min-width: 0;
}

.logo-uploader__path {
  color: var(--admin-text-soft);
  line-height: 1.6;
  word-break: break-all;
}

.logo-cropper {
  display: grid;
  gap: 0.875rem;
}

.logo-crop-modal__dialog {
  max-width: min(880px, calc(100vw - 2rem));
}

.logo-cropper__stage {
  min-height: min(46vh, 420px);
  max-height: min(46vh, 420px);
  background: linear-gradient(180deg, rgba(241, 245, 249, 0.96) 0%, rgba(255, 255, 255, 0.96) 100%);
  border-radius: 1rem;
  overflow: hidden;
}

.logo-cropper__stage img {
  display: block;
  max-width: 100%;
}

.logo-cropper__toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.logo-cropper__zoom {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  flex: 1 1 320px;
  min-width: 0;
}

.logo-cropper__zoom-label,
.logo-cropper__zoom-value {
  font-size: 0.95rem;
  font-weight: 700;
  color: #425466;
  white-space: nowrap;
}

.logo-cropper__zoom-value {
  min-width: 3.5rem;
  text-align: right;
}

.logo-cropper__range {
  flex: 1 1 auto;
  min-width: 160px;
  margin: 0;
}

.logo-cropper__tips {
  padding: 0.75rem 0.875rem;
  border-radius: 0.875rem;
  background: rgba(248, 250, 252, 0.92);
  color: var(--admin-text-soft);
  font-size: 0.95rem;
}

.logo-cropper__tips strong {
  display: block;
  margin-bottom: 0.35rem;
  color: #182433;
}

.logo-cropper__tips p {
  margin: 0;
  line-height: 1.5;
}

.logo-cropper__stage .cropper-point,
.logo-cropper__stage .cropper-line {
  display: none !important;
}

.logo-cropper__stage .cropper-face {
  background-color: rgba(32, 107, 196, 0.06);
}

.logo-cropper__stage .cropper-view-box {
  outline-width: 2px;
  outline-color: rgba(32, 107, 196, 0.95);
 }

.form-control,
.form-select {
  border-radius: 0.875rem;
}

.form-control:focus,
.form-select:focus {
  border-color: rgba(32, 107, 196, 0.55);
  box-shadow: 0 0 0 0.25rem rgba(32, 107, 196, 0.12);
}

@media (max-width: 1199px) {
  .admin-home-stats,
  .admin-home-grid {
    grid-template-columns: 1fr;
  }

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

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

  .subject-table {
    min-width: 700px;
  }

  .qr-grid {
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  }
}

@media (max-width: 767px) {
  .page-body {
    padding-top: 1rem;
  }

  .app-toast-stack {
    top: 0.75rem;
    right: 0.75rem;
    left: 0.75rem;
  }

  .app-toast {
    min-width: 0;
    max-width: none;
    width: 100%;
  }

  .app-backtotop {
    right: 1rem;
    bottom: 1rem;
    min-height: 2.75rem;
    padding: 0.72rem 0.9rem;
  }

  .admin-dashboard {
    gap: 1rem;
  }

  .admin-sidebar-card__actions {
    width: 100%;
    min-width: 0;
  }

  .auth-panel {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .hero-stats {
    grid-template-columns: 1fr 1fr;
  }

  .section-head {
    align-items: flex-start;
  }

  .section-head__actions {
    width: 100%;
    justify-content: flex-start;
  }

  .type-actions {
    justify-content: stretch;
  }

  .type-actions .btn {
    width: 100%;
  }

  .hero-actions {
    justify-content: stretch;
  }

  .hero-actions .btn {
    flex: 1 1 auto;
  }

  .revision-history__item {
    flex-direction: column;
    align-items: stretch;
  }

  .qr-hero__head,
  .qr-hero__actions,
  .qr-card__actions,
  .qr-card__meta,
  .qr-toolbar {
    width: 100%;
  }

  .qr-hero__head {
    grid-template-columns: 1fr;
  }

  .qr-hero__actions .btn,
  .qr-card__actions .btn {
    width: 100%;
  }

  .qr-hero__actions {
    flex-wrap: wrap;
  }

  .qr-card__meta {
    grid-template-columns: 1fr;
  }

  .qr-card__public-link {
    justify-self: stretch;
  }

  .app-confirm-dialog {
    padding: 1.2rem 1.1rem 1rem;
  }

  .app-confirm__actions .btn {
    width: 100%;
  }

  .subject-table {
    min-width: 640px;
  }

  .subject-table thead th,
  .subject-table tbody td {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
  }

  .subject-table__actions {
    width: 176px;
  }

  .subject-table__actions .btn {
    min-width: 80px;
  }

  .logo-uploader__surface {
    grid-template-columns: 1fr;
  }

  .logo-uploader__preview {
    width: 96px;
    justify-self: start;
  }

  .logo-uploader__actions .btn {
    width: 100%;
  }

  .logo-cropper__stage {
    min-height: 320px;
    max-height: 320px;
  }

  .logo-cropper__toolbar {
    align-items: stretch;
  }

  .logo-cropper__zoom {
    flex-basis: 100%;
  }

  .qr-poster__canvas {
    width: 100%;
    max-width: 292px;
    height: auto;
    aspect-ratio: 1;
  }

  .qr-poster__logo-wrap {
    width: 80px;
    height: 80px;
    top: calc(0.55rem + 132px);
  }

  .school-qrcode__poster {
    width: min(100%, 320px);
  }

  .school-qrcode__canvas {
    width: 100%;
    max-width: 292px;
    height: auto;
    aspect-ratio: 1;
  }

  .school-qrcode__logo-wrap {
    width: 80px;
    height: 80px;
  }
}
