:root {
  --ink: #141827;
  --muted: #5b667f;
  --line: #dde2ed;
  --bg: #eef3fb;
  --surface: #ffffff;
  --surface-strong: #f8f9ff;
  --brand: #4f46e5;
  --brand-soft: #eef2ff;
  --brand2: #7c3aed;
  --green: #16845b;
  --amber: #b54708;
  --red: #c4320a;
  --radius: 24px;
  --shadow: 0 18px 50px rgba(16, 24, 40, 0.10);
  --shadow-soft: 0 10px 30px rgba(16, 24, 40, 0.06);
}
* {
  box-sizing: border-box;
}
html {
  background: radial-gradient(circle at top left, rgba(99, 102, 241, 0.15), transparent 30%),
    radial-gradient(circle at bottom right, rgba(124, 58, 237, 0.12), transparent 24%),
    #e9edf5;
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  min-height: 100%;
}
body {
  margin: 0;
  min-height: 100vh;
  background: transparent;
}
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(circle at top center, rgba(255, 255, 255, 0.85), transparent 28%),
    radial-gradient(circle at 20% 10%, rgba(79, 70, 229, 0.08), transparent 20%),
    radial-gradient(circle at 85% 15%, rgba(124, 58, 237, 0.06), transparent 17%);
}
.app {
  width: 100%;
  max-width: 640px;
  min-height: 100vh;
  margin: 0 auto;
  position: relative;
  padding: 18px 16px 110px;
}
.topbar {
  padding: 24px 22px 18px;
  background: linear-gradient(135deg, #312e81 0%, #6d28d9 100%);
  color: #ffffff;
  border-radius: 0 0 34px 34px;
  box-shadow: 0 26px 60px rgba(50, 41, 161, 0.16);
}
.toprow {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.eyebrow {
  display: inline-flex;
  padding: 9px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  font-size: 12px;
  opacity: 0.92;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.topbar h1 {
  font-size: 28px;
  line-height: 1.05;
  margin: 10px 0 8px;
}
.topbar p {
  margin: 0;
  opacity: 0.88;
  font-size: 14px;
  line-height: 1.7;
}
.avatar {
  width: 48px;
  height: 48px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.18);
  display: grid;
  place-items: center;
  font-weight: 800;
  color: #ffffff;
}
.content {
  padding: 22px 0 0;
}
.hero {
  padding: 24px;
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), #f4f5ff 100%);
  box-shadow: var(--shadow-soft);
  border: 1px solid rgba(226, 232, 240, 0.9);
}
.hero h2 {
  margin: 0 0 10px;
  font-size: 26px;
}
.hero p {
  margin: 0;
  color: var(--muted);
  line-height: 1.75;
}
.stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 18px;
}
.stat {
  background: #ffffff;
  padding: 18px 16px;
  border-radius: 20px;
  text-align: center;
  border: 1px solid rgba(226, 232, 240, 0.95);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.06);
}
.stat b {
  display: block;
  font-size: 22px;
}
.stat span {
  font-size: 12px;
  color: var(--muted);
}
.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 28px 0 14px;
  gap: 12px;
}
.section-head h2,
.section-head h3 {
  font-size: 18px;
  margin: 0;
}
.section-head a {
  font-size: 13px;
  color: var(--brand);
  font-weight: 700;
  text-decoration: none;
}
.home-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin: 20px 0 0;
}
.home-actions .btn {
  width: 100%;
  padding: 18px 16px;
  font-size: 15px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border-radius: 24px;
  text-align: center;
  min-height: 62px;
}
.home-actions .btn.secondary {
  background: linear-gradient(180deg, #ffffff 0%, #f8f9ff 100%);
  color: var(--ink);
  border: 1px solid rgba(226, 232, 240, 0.95);
  box-shadow: 0 18px 36px rgba(15, 23, 42, 0.08);
}
.home-actions .btn.secondary:hover {
  background: linear-gradient(180deg, #f8f9ff 0%, #eef2ff 100%);
  transform: translateY(-1px);
}
.home-actions .btn.secondary:active {
  transform: translateY(0);
}
.card {
  background: var(--surface);
  border: 1px solid rgba(226, 232, 240, 0.95);
  border-radius: 26px;
  padding: 18px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-soft);
}
.card-row {
  display: flex;
  gap: 16px;
  align-items: flex-start;
}
.datebox {
  min-width: 62px;
  text-align: center;
  padding: 10px 8px;
  border-radius: 18px;
  background: #eef2ff;
  color: #3730a3;
}
.datebox b {
  display: block;
  font-size: 20px;
}
.datebox span {
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}
.card h3,
.card h2 {
  font-size: 17px;
  margin: 0 0 10px;
}
.card p {
  font-size: 14px;
  line-height: 1.75;
  margin: 0;
  color: var(--muted);
}
.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}
.pill {
  font-size: 11px;
  font-weight: 700;
  padding: 7px 12px;
  border-radius: 999px;
  background: #f8fafc;
  color: #475467;
}
.pill.green {
  background: #ecfdf3;
  color: #047857;
}
.pill.amber {
  background: #fffbeb;
  color: #b54708;
}
.bottom-nav {
  position: fixed;
  z-index: 20;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: min(640px, 100%);
  display: flex;
  justify-content: space-around;
  padding: 10px 10px calc(10px + env(safe-area-inset-bottom));
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(18px);
  border-top: 1px solid rgba(226, 232, 240, 0.95);
}
.bottom-nav a {
  width: 20%;
  text-align: center;
  text-decoration: none;
  color: #67758d;
  font-size: 10px;
  font-weight: 700;
}
.bottom-nav .icon {
  display: block;
  font-size: 20px;
  margin-bottom: 4px;
}
.bottom-nav a.active {
  color: var(--brand);
}
.form-card {
  background: rgba(255, 255, 255, 0.96);
  border-radius: 26px;
  padding: 22px;
  border: 1px solid rgba(226, 232, 240, 0.95);
  box-shadow: var(--shadow-soft);
}
label {
  display: block;
  font-size: 13px;
  font-weight: 700;
  margin: 18px 0 9px;
}
input,
textarea,
select {
  width: 100%;
  border: 1px solid rgba(148, 163, 184, 0.35);
  border-radius: 16px;
  padding: 15px 16px;
  background: #ffffff;
  font: inherit;
  color: var(--ink);
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
input:focus,
textarea:focus,
select:focus {
  border-color: rgba(79, 70, 229, 0.35);
  box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.08);
}
textarea {
  min-height: 110px;
  resize: vertical;
}
.btn {
  width: 100%;
  border: 0;
  border-radius: 18px;
  padding: 15px 18px;
  background: linear-gradient(135deg, var(--brand), var(--brand2));
  color: #ffffff;
  font-weight: 800;
  font-size: 15px;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  box-shadow: 0 18px 35px rgba(79, 70, 229, 0.18);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.btn:hover,
.btn:focus-visible {
  transform: translateY(-1px);
  box-shadow: 0 20px 38px rgba(79, 70, 229, 0.22);
}
.btn.secondary {
  width: auto;
  background: #ffffff;
  color: var(--ink);
  border: 1px solid rgba(226, 232, 240, 0.95);
  box-shadow: 0 6px 20px rgba(15, 23, 42, 0.08);
}
.btn.secondary.icon {
  padding: 12px 16px;
}
.btn.danger {
  background: #fff2f0;
  color: var(--red);
  border: 1px solid rgba(244, 226, 226, 0.95);
}
.btn.danger:hover,
.btn.secondary:hover {
  filter: brightness(0.98);
}
.actions {
  display: flex;
  gap: 12px;
  margin-top: 18px;
  flex-wrap: wrap;
}
.flash {
  padding: 16px 18px;
  border-radius: 18px;
  margin-bottom: 18px;
  font-size: 14px;
  background: #ecfdf3;
  color: #047857;
  border: 1px solid rgba(16, 185, 129, 0.15);
}
.flash.error {
  background: #fff1f2;
  color: #b42318;
  border: 1px solid rgba(244, 63, 94, 0.15);
}
.login {
  min-height: calc(100vh - 20px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 28px 20px 40px;
  background: radial-gradient(circle at top left, rgba(99, 102, 241, 0.16), transparent 22%),
    radial-gradient(circle at bottom right, rgba(124, 58, 237, 0.12), transparent 18%),
    #f6f8ff;
}
.brandmark {
  width: 72px;
  height: 72px;
  border-radius: 24px;
  background: linear-gradient(135deg, var(--brand), var(--brand2));
  color: #ffffff;
  display: grid;
  place-items: center;
  font-size: 32px;
  box-shadow: 0 18px 40px rgba(79, 70, 229, 0.2);
  margin-bottom: 22px;
}
.login h1 {
  font-size: 32px;
  margin: 0 0 10px;
}
.login > p {
  color: var(--muted);
  margin: 0 0 26px;
  line-height: 1.8;
}
.help {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.7;
}
.help a {
  color: var(--brand);
  text-decoration: none;
  font-weight: 700;
}
.profile {
  display: flex;
  gap: 18px;
  align-items: center;
  flex-wrap: wrap;
}
.photo {
  width: 84px;
  height: 84px;
  border-radius: 26px;
  object-fit: cover;
  background: #eef2ff;
  display: grid;
  place-items: center;
  font-size: 28px;
}
.profile h2 {
  margin: 0 0 6px;
  font-size: 20px;
}
.profile p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}
.list {
  display: grid;
  gap: 14px;
}
.list-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 18px;
  padding: 22px;
  border-radius: 28px;
  background: linear-gradient(180deg, #ffffff, #f9fbff);
  border: 1px solid rgba(79, 70, 229, 0.12);
  box-shadow: 0 24px 50px rgba(15, 23, 42, 0.08);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.list-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 28px 58px rgba(15, 23, 42, 0.12);
}
.student-summary {
  display: grid;
  gap: 14px;
}
.student-title {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.student-title strong {
  font-size: 16px;
}
.student-title .pill {
  font-size: 11px;
  padding: 6px 13px;
}
.student-subtitle small {
  color: var(--muted);
}
.student-info {
  display: grid;
  gap: 10px;
  font-size: 14px;
  color: var(--muted);
}
.student-info .item {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}
.student-info .item strong {
  color: var(--ink);
}
.student-contact {
  font-size: 13px;
  color: var(--brand);
  font-weight: 700;
}
.student-action {
  display: flex;
  align-items: center;
  justify-content: flex-end;
}
.student-action .btn.secondary {
  width: auto;
  padding: 12px 18px;
  border-radius: 20px;
}
.student-action .btn.secondary:hover {
  background: #eff2ff;
}
.section-note {
  font-size: 13px;
  color: var(--muted);
  margin: -10px 0 16px;
  line-height: 1.75;
}
.empty {
  text-align: center;
  padding: 32px 18px;
  color: var(--muted);
}
.empty .icon {
  font-size: 38px;
  margin-bottom: 10px;
}
.tabs {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 6px;
}
.tabs a {
  white-space: nowrap;
  text-decoration: none;
  color: var(--muted);
  background: #ffffff;
  border: 1px solid rgba(226, 232, 240, 0.95);
  padding: 11px 14px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}
.tabs a.active {
  background: linear-gradient(135deg, #4f46e5, #7c3aed);
  color: #ffffff;
  border-color: transparent;
}
.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.admin-table th,
.admin-table td {
  padding: 14px 10px;
  border-bottom: 1px solid rgba(226, 232, 240, 0.95);
  text-align: left;
  vertical-align: top;
}
.admin-table th {
  color: var(--muted);
  font-weight: 700;
}
.admin-table tr:hover {
  background: rgba(79, 70, 229, 0.04);
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
@media (min-width: 700px) {
  body {
    padding: 24px 0;
  }
  .app {
    min-height: calc(100vh - 48px);
    border-radius: 28px;
    overflow: hidden;
  }
  .bottom-nav {
    bottom: 20px;
    border-radius: 0 0 30px 30px;
  }
}
@media (max-width: 520px) {
  .topbar {
    padding: 20px 16px 16px;
    border-radius: 0 0 28px 28px;
  }
  .hero,
  .card,
  .form-card,
  .list-item {
    padding: 18px;
    border-radius: 24px;
  }
  .stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .admin-table th,
  .admin-table td {
    padding: 12px 8px;
  }
}
