:root {
  --ink: #1f2933;
  --muted: #5c6d75;
  --surface: #ffffff;
  --edge: rgba(13, 79, 108, 0.2);
  --accent: #5170ff;
  --accent-2: #ff66c4;
  --alert: #8e1f33;
  --good-bg: #eff8f5;
  --shadow: 0 24px 40px rgba(18, 44, 64, 0.16);
  --menu-bg: rgba(255, 255, 255, 0.95);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  font-family: 'DM Sans', sans-serif;
  color: var(--ink);
  background: #ffffff;
  min-height: 100%;
}

h1,
h2,
legend {
  font-family: 'DM Sans', sans-serif;
  letter-spacing: 0.2px;
}

.bg-shape {
  display: none;
}

.bg-shape-a {
  width: 340px;
  height: 340px;
  background: linear-gradient(45deg, rgba(13, 79, 108, 0.22), rgba(200, 100, 59, 0.2));
  top: -80px;
  left: -70px;
}

.bg-shape-b {
  width: 280px;
  height: 280px;
  background: linear-gradient(15deg, rgba(200, 100, 59, 0.26), rgba(227, 239, 187, 0.2));
  right: -90px;
  bottom: 12%;
}

.page-wrap {
  width: min(980px, 92vw);
  margin: 26px auto 70px;
  position: relative;
  z-index: 1;
}

.top-menu {
  position: sticky;
  top: 0;
  z-index: 40;
  border-bottom: 1px solid rgba(17, 53, 74, 0.16);
  background: var(--menu-bg);
  backdrop-filter: blur(6px);
}

.top-menu-inner {
  width: min(980px, 92vw);
  margin: 0 auto;
  min-height: 62px;
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto minmax(220px, 1fr);
  align-items: center;
  gap: 12px;
}

.top-menu-title {
  font-family: 'DM Sans', sans-serif;
  font-size: 1.05rem;
  letter-spacing: 0.2px;
}

.top-menu-logo {
  display: block;
  width: auto;
  height: 34px;
  max-width: 210px;
  object-fit: contain;
  justify-self: start;
}

a:has(> .top-menu-logo) {
  display: contents;
}

.top-menu-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
  justify-self: end;
}

.top-menu-actions .ghost {
  width: auto;
}

.top-menu-dropdown {
  position: relative;
}

.top-menu-dropdown summary {
  list-style: none;
  cursor: pointer;
}

.top-menu-dropdown summary::-webkit-details-marker {
  display: none;
}

.top-menu-dropdown-list {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  min-width: 170px;
  padding: 8px;
  border-radius: 12px;
  background: #ffffff;
  border: 1px solid var(--line-soft);
  box-shadow: var(--shadow);
  display: grid;
  gap: 6px;
  z-index: 25;
}

.auth-top-menu-inner {
  width: min(760px, 92vw);
  grid-template-columns: minmax(160px, 1fr) auto minmax(160px, 1fr);
}

.auth-top-menu-title {
  font-size: clamp(1.15rem, 2.6vw, 1.55rem);
  justify-self: center;
}

.top-menu-spacer {
  justify-self: end;
  width: 1px;
}

.auth-wrap {
  width: min(760px, 92vw);
}

.hero {
  background: linear-gradient(140deg, #5170ff, #ff66c4);
  color: #f8fcff;
  border-radius: 20px;
  padding: 28px 28px 22px;
  box-shadow: var(--shadow);
  animation: rise-in 420ms ease-out;
}

.hero-head {
  display: block;
}

.hero-head-with-logo {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
  margin-bottom: 8px;
}

.hero-head-text h1 {
  margin: 9px 0 0;
}

.hero-logo-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: 12px;
}

.hero-logo {
  display: block;
  width: min(280px, 65vw);
  height: auto;
  max-height: 86px;
  object-fit: contain;
}

.hero-logo-side {
  width: min(250px, 38vw);
  max-height: 78px;
}

.kicker {
  text-transform: uppercase;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 1.5px;
  margin: 0;
  opacity: 0.9;
}

.hero h1 {
  margin: 9px 0 8px;
  font-size: clamp(1.65rem, 2.4vw, 2.35rem);
}

.hero p {
  margin: 0;
  color: rgba(248, 252, 255, 0.88);
}

.alert {
  margin-top: 16px;
  padding: 12px 14px;
  border-left: 4px solid var(--alert);
  border-radius: 10px;
  background: #fff0f4;
  color: #601123;
  font-weight: 500;
}

.notice {
  margin-top: 16px;
  padding: 12px 14px;
  border-left: 4px solid #1e6f4f;
  border-radius: 10px;
  background: #e8f8f0;
  color: #134e38;
  font-weight: 500;
}

.form-grid {
  display: grid;
  gap: 16px;
  margin-top: 18px;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--edge);
  border-radius: 16px;
  padding: 18px;
  box-shadow: 0 8px 18px rgba(14, 43, 68, 0.08);
}

.panel h2 {
  margin: 0 0 10px;
  font-size: 1.3rem;
}

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

.actions-inline {
  display: inline-flex;
  gap: 10px;
  flex-wrap: wrap;
}

.subtle {
  margin: 0 0 12px;
  color: var(--muted);
}

.grid {
  display: grid;
  gap: 12px;
}

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

.col-span-2 {
  grid-column: 1 / -1;
}

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

label {
  display: grid;
  gap: 7px;
  font-weight: 500;
}

input,
select,
textarea,
button {
  font: inherit;
}

input,
select,
textarea {
  border: 1px solid rgba(17, 53, 74, 0.3);
  border-radius: 10px;
  padding: 10px 11px;
  background: #fff;
  color: var(--ink);
}

textarea {
  resize: vertical;
}

fieldset {
  border: 1px solid rgba(17, 53, 74, 0.2);
  border-radius: 12px;
  padding: 12px;
  margin: 0;
}

legend {
  padding: 0 6px;
  color: #5170ff;
}

.choice {
  display: flex;
  align-items: center;
  gap: 9px;
  font-weight: 500;
  margin: 8px 0;
}

.choice input {
  width: 18px;
  height: 18px;
}

.table-like {
  display: grid;
  gap: 11px;
}

.table-like label {
  background: #fff;
  border: 1px solid rgba(17, 53, 74, 0.14);
  border-radius: 10px;
  padding: 10px;
}

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

.panel-quiet {
  background: rgba(255, 255, 255, 0.74);
  border: 1px solid rgba(17, 53, 74, 0.12);
  box-shadow: none;
}

.teacher-picker-wrap {
  margin: 0;
  padding: 12px;
}

.student-list-select {
  height: 280px;
  overflow-y: auto;
  border-radius: 10px;
  padding: 4px;
}

.teacher-picker-list {
  display: grid;
  gap: 7px;
  max-height: 280px;
  overflow: auto;
  padding-right: 4px;
}

.teacher-choice {
  margin: 0;
  padding: 8px;
  border: 1px solid rgba(17, 53, 74, 0.14);
  border-radius: 8px;
  background: #fff;
}

.teacher-choice-text {
  display: grid;
  line-height: 1.3;
}

.teacher-choice-text small {
  color: var(--muted);
}

.tight {
  margin-bottom: 6px;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 700px;
}

.data-table th,
.data-table td {
  text-align: left;
  border-bottom: 1px solid rgba(17, 53, 74, 0.12);
  padding: 10px 8px;
  vertical-align: top;
}

.data-table th {
  color: #0f384d;
  font-size: 0.9rem;
}

.teachers-scroll {
  max-height: 2.6rem;
  overflow-y: auto;
  line-height: 1.3;
  padding-right: 4px;
}

.tiny-note {
  margin-top: 4px;
  font-size: 0.78rem;
  color: var(--muted);
}

.summary-pre {
  margin: 8px 0 0;
  padding: 10px;
  border: 1px solid rgba(17, 53, 74, 0.14);
  border-radius: 8px;
  background: #f8fbfd;
  white-space: pre-wrap;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.92rem;
  line-height: 1.45;
}

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

.summary-grid p {
  margin: 0;
}

.actions {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-top: 8px;
}

.review-actions {
  flex-wrap: wrap;
}

.tiny {
  padding: 6px 10px;
  font-size: 0.82rem;
}

.school-select-panel {
  text-align: center;
}

.school-select-label {
  display: grid;
  gap: 8px;
  font-size: 1rem;
}

.school-select-label select {
  font-size: 1rem;
  padding: 11px 14px;
  border-radius: 12px;
  text-align: center;
  cursor: pointer;
}

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

.auth-cards-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.auth-card {
  display: block;
  text-decoration: none;
  border: 1px solid rgba(17, 53, 74, 0.2);
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
  padding: 16px;
}

.auth-card h2 {
  margin: 0 0 8px;
}

.auth-card p {
  margin: 0;
  color: var(--muted);
}

.auth-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(14, 43, 68, 0.12);
}

.auth-form {
  margin-top: 16px;
}

.creds code {
  font-family: 'DM Sans', sans-serif;
  background: #f1f7fb;
  border: 1px solid rgba(17, 53, 74, 0.2);
  border-radius: 6px;
  padding: 2px 6px;
}

.inline-form {
  margin: 0;
}

.row-actions-menu {
  position: relative;
  display: inline-block;
}

.row-actions-menu summary {
  list-style: none;
}

.row-actions-menu summary::-webkit-details-marker {
  display: none;
}

.row-actions-list {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  z-index: 10;
  min-width: 220px;
  display: grid;
  gap: 6px;
  padding: 8px;
  border-radius: 12px;
  border: 1px solid rgba(17, 53, 74, 0.16);
  background: #fff;
  box-shadow: 0 14px 26px rgba(14, 43, 68, 0.14);
}

.row-actions-list .ghost,
.row-actions-list button {
  width: 100%;
}

button,
.ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 11px 15px;
  border-radius: 11px;
  border: 0;
  text-decoration: none;
  font-weight: 600;
  cursor: pointer;
}

button {
  background: linear-gradient(130deg, var(--accent-2), #ff66c4);
  color: #fff;
  box-shadow: 0 9px 20px rgba(200, 100, 59, 0.32);
}

button:hover {
  transform: translateY(-1px);
}

.danger-ghost {
  color: #9a2f1d;
  border: 1px solid rgba(154, 47, 29, 0.2);
  background: #fff7f5;
  box-shadow: none;
}

.ghost {
  background: #fff;
  border: 1px solid rgba(17, 53, 74, 0.25);
  color: var(--accent);
}

.foot-note {
  margin-top: 16px;
  color: var(--muted);
}

.foot-note a {
  color: #8b3f24;
}

.legal-footer {
  text-align: center;
}

.legal-inline-notice {
  margin-top: 14px;
}

.legal-stack ul {
  margin: 0;
  padding-left: 18px;
}

.privacy-actions {
  align-items: center;
}

[data-super-admin-user-pager] {
  margin-top: 10px;
}

.reveal {
  opacity: 0;
  transform: translateY(14px);
}

.reveal.in {
  animation: rise-in 360ms ease-out forwards;
}

@keyframes rise-in {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 780px) {
  .cols-2,
  .summary-grid,
  .auth-cards {
    grid-template-columns: 1fr;
  }

  .top-menu-inner {
    min-height: auto;
    padding: 10px 0;
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .top-menu-title,
  .top-menu-actions {
    justify-self: center;
  }

  .top-menu-logo {
    justify-self: center;
  }

  .top-menu-actions {
    width: 100%;
    justify-content: center;
  }

  .auth-top-menu-inner {
    grid-template-columns: 1fr;
    align-items: center;
  }

  .top-menu-spacer {
    display: none;
  }

  .actions {
    flex-direction: column-reverse;
  }

  button,
  .ghost {
    width: 100%;
  }
}
