.admin-page {
  min-height: 100vh;
  background:
    radial-gradient(circle at 8% 4%, rgba(45, 155, 96, 0.08), transparent 28%),
    var(--paper);
}

.admin-topbar {
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 34px;
  border-bottom: 1px solid rgba(21, 34, 29, 0.1);
  background: rgba(244, 240, 232, 0.9);
  backdrop-filter: blur(18px);
}

.admin-identity {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 750;
}

.admin-identity button,
.admin-state a {
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid rgba(21, 34, 29, 0.13);
  border-radius: 18px;
  background: var(--white);
  color: var(--ink);
  font-size: 11px;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
}

.admin-shell {
  width: min(1240px, calc(100% - 36px));
  margin: 0 auto;
  padding: 42px 0 70px;
}

.admin-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 28px;
}

.admin-heading > div > span,
.panel-head > div > span {
  color: var(--route);
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.16em;
}

.admin-heading h1 {
  margin: 7px 0 6px;
  font-size: clamp(30px, 4vw, 46px);
  letter-spacing: -0.065em;
}

.admin-heading p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 13px;
}

.year-picker {
  min-width: 165px;
  display: grid;
  gap: 5px;
}

.year-picker span {
  color: var(--ink-soft);
  font-size: 9px;
  font-weight: 800;
}

.year-picker select,
.admin-filters input,
.admin-filters select {
  height: 42px;
  padding: 0 12px;
  border: 1px solid rgba(21, 34, 29, 0.13);
  border-radius: 10px;
  outline: 0;
  background: var(--white);
  color: var(--ink);
  font-size: 12px;
  font-weight: 750;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.summary-grid article {
  min-height: 120px;
  padding: 19px;
  border: 1px solid rgba(21, 34, 29, 0.1);
  border-radius: 17px;
  background: rgba(255, 253, 248, 0.78);
  box-shadow: 0 12px 35px rgba(21, 34, 29, 0.04);
}

.summary-grid article > span {
  display: block;
  margin-bottom: 16px;
  color: var(--ink-soft);
  font-size: 10px;
  font-weight: 800;
}

.summary-grid strong {
  font-size: 36px;
  letter-spacing: -0.05em;
}

.summary-grid small {
  margin-left: 4px;
  color: var(--ink-soft);
  font-size: 10px;
  font-weight: 750;
}

.admin-panel {
  margin-top: 16px;
  padding: 22px;
  border: 1px solid rgba(21, 34, 29, 0.1);
  border-radius: 19px;
  background: rgba(255, 253, 248, 0.78);
  box-shadow: 0 12px 35px rgba(21, 34, 29, 0.04);
}

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

.panel-head h2 {
  margin: 5px 0 0;
  font-size: 20px;
  letter-spacing: -0.045em;
}

.route-completion-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px 22px;
}

.route-completion-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 100px 34px;
  align-items: center;
  gap: 10px;
  min-height: 34px;
}

.route-completion-row > span {
  overflow: hidden;
  font-size: 11px;
  font-weight: 750;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.completion-bar {
  height: 6px;
  overflow: hidden;
  border-radius: 4px;
  background: rgba(21, 34, 29, 0.08);
}

.completion-bar i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--route);
}

.route-completion-row strong {
  color: var(--route);
  font-size: 11px;
  text-align: right;
}

.admin-filters {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.admin-filters input {
  width: 220px;
}

.admin-filters select {
  max-width: 145px;
}

.admin-filters button {
  min-height: 42px;
  padding: 0 13px;
  border: 1px solid rgba(21, 34, 29, 0.13);
  border-radius: 10px;
  background: rgba(var(--route-rgb), 0.08);
  color: var(--route);
  font-size: 10px;
  font-weight: 850;
  cursor: pointer;
}

.filter-result {
  margin: -5px 0 12px;
  color: var(--ink-soft);
  font-size: 10px;
  font-weight: 700;
}

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

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

.student-table th,
.student-table td {
  padding: 13px 10px;
  border-bottom: 1px solid rgba(21, 34, 29, 0.08);
  font-size: 11px;
  text-align: left;
}

.student-table th {
  color: var(--ink-soft);
  font-size: 9px;
  font-weight: 850;
  letter-spacing: 0.04em;
}

.student-cell {
  display: grid;
  gap: 3px;
}

.student-cell strong {
  font-size: 12px;
}

.student-cell span,
.student-table td small {
  color: var(--ink-soft);
  font-size: 9px;
}

.admin-role {
  margin-left: 5px;
  padding: 2px 5px;
  border-radius: 4px;
  background: rgba(var(--route-rgb), 0.1);
  color: var(--route);
  font-size: 8px;
}

.admin-empty {
  margin: 0;
  padding: 26px 0;
  color: var(--ink-soft);
  font-size: 11px;
  text-align: center;
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 17px;
}

.pagination button {
  min-width: 62px;
  height: 33px;
  border: 1px solid rgba(21, 34, 29, 0.12);
  border-radius: 17px;
  background: var(--white);
  font-size: 10px;
  font-weight: 800;
  cursor: pointer;
}

.pagination button:disabled {
  opacity: 0.35;
  cursor: default;
}

.pagination span {
  min-width: 65px;
  font-size: 10px;
  font-weight: 800;
  text-align: center;
}

.admin-state {
  width: min(430px, calc(100% - 36px));
  margin: 17vh auto 0;
  padding: 28px;
  border: 1px solid rgba(21, 34, 29, 0.1);
  border-radius: 20px;
  background: var(--white);
  text-align: center;
  box-shadow: 0 22px 60px rgba(21, 34, 29, 0.1);
}

.admin-state strong {
  display: block;
  font-size: 18px;
}

.admin-state p {
  margin: 9px 0 18px;
  color: var(--ink-soft);
  font-size: 12px;
}

@media (max-width: 760px) {
  .admin-topbar {
    height: 64px;
    padding: 0 16px;
  }

  .admin-topbar .brand-name {
    font-size: 15px;
  }

  .admin-identity > span {
    display: none;
  }

  .admin-shell {
    width: min(100% - 24px, 620px);
    padding-top: 24px;
  }

  .admin-heading,
  .student-panel-head {
    align-items: stretch;
    flex-direction: column;
  }

  .year-picker {
    min-width: 0;
  }

  .summary-grid,
  .route-completion-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .summary-grid article {
    min-height: 100px;
    padding: 15px;
  }

  .summary-grid strong {
    font-size: 29px;
  }

  .admin-panel {
    padding: 16px;
  }

  .route-completion-list {
    grid-template-columns: 1fr;
  }

  .admin-filters {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .admin-filters input {
    width: 100%;
    grid-column: 1 / -1;
  }

  .admin-filters select {
    width: 100%;
    max-width: none;
  }

  .admin-filters button {
    grid-column: 1 / -1;
  }
}

@media (max-width: 520px) {
  .admin-filters {
    grid-template-columns: 1fr;
  }

  .admin-filters input,
  .admin-filters button {
    grid-column: auto;
  }
}
