:root {
  color-scheme: light;
  --page: #f8fafc;
  --surface: #ffffff;
  --text: #0f172a;
  --muted: #475569;
  --subtle: #64748b;
  --border: #e2e8f0;
  --primary: #4f46e5;
  --primary-hover: #4338ca;
  --success: #047857;
  --error: #b91c1c;
  font-family: Inter, "Segoe UI", Arial, sans-serif;
}

* { box-sizing: border-box; }

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  background: var(--page);
}

button, input { font: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }

.topbar {
  display: flex;
  min-height: 72px;
  align-items: center;
  justify-content: space-between;
  padding: 0 max(24px, calc((100vw - 1060px) / 2));
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

.brand {
  color: var(--text);
  font-size: 19px;
  font-weight: 750;
  letter-spacing: -0.7px;
  text-decoration: none;
}

.brand span { color: var(--primary); }
.topbar-actions { display: flex; align-items: center; gap: 18px; }
.admin-label { color: var(--muted); font-size: 13px; font-weight: 600; }

main {
  width: min(100% - 40px, 920px);
  margin: 0 auto;
  padding: 58px 0 80px;
}

.page-heading { margin-bottom: 27px; }
.eyebrow { margin: 0 0 9px; color: var(--primary); font-size: 10px; font-weight: 700; letter-spacing: 1.5px; }
h1 { margin: 0; font-size: clamp(30px, 5vw, 40px); letter-spacing: -1.5px; }
.page-heading > p:last-child { margin: 12px 0 0; color: var(--muted); font-size: 14px; line-height: 1.6; }

.admin-content { display: grid; gap: 18px; }
.panel {
  padding: 25px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: 0 8px 26px rgb(15 23 42 / 4%);
}

.sign-in-panel {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 16px 24px;
}

.panel-copy h2 { margin: 0; font-size: 17px; letter-spacing: -0.3px; }
.panel-copy p { margin: 7px 0 0; color: var(--muted); font-size: 13px; line-height: 1.6; }

.button {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 0 16px;
  border: 1px solid transparent;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 650;
  transition: background .15s, border-color .15s, opacity .15s;
}

.button:disabled { cursor: wait; opacity: .65; }
.button-primary { color: #fff; background: var(--primary); }
.button-primary:hover:not(:disabled) { background: var(--primary-hover); }
.button-secondary { border-color: var(--border); color: var(--text); background: var(--surface); }
.button-secondary:hover:not(:disabled) { border-color: var(--primary); }

.sign-in-panel .status-message { grid-column: 1 / -1; }
.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; margin-top: 20px; }
.field { min-width: 0; margin-bottom: 15px; }
.field-wide { grid-column: 1 / -1; }
.field label { display: block; margin: 0 0 7px; color: var(--text); font-size: 12px; font-weight: 600; }
.field input, .field textarea {
  width: 100%;
  min-width: 0;
  min-height: 42px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  outline: none;
  color: var(--text);
  background: var(--surface);
  font-size: 13px;
}

.field textarea { resize: vertical; }
.field input:focus, .field textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgb(79 70 229 / 13%); }
.field small { display: block; margin-top: 6px; color: var(--subtle); font-size: 11px; line-height: 1.5; }
.form-actions { display: flex; gap: 9px; }
.status-message { min-height: 18px; margin: 10px 0 0; color: var(--error); font-size: 12px; line-height: 1.5; }
.status-message.success { color: var(--success); }
.list-heading { display: flex; justify-content: space-between; align-items: center; }
.school-list { display: grid; gap: 8px; margin: 20px 0 0; padding: 0; list-style: none; }
.school-list li {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  padding: 13px;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 13px;
}
.school-summary { min-width: 0; }
.school-summary strong { display: block; overflow-wrap: anywhere; }
.school-summary small { display: block; margin-top: 5px; color: var(--subtle); line-height: 1.5; overflow-wrap: anywhere; }
.school-list .empty-state { color: var(--subtle); background: #f8fafc; }

@media (max-width: 600px) {
  .topbar { min-height: 62px; padding: 0 18px; }
  .admin-label { display: none; }
  main { width: min(100% - 28px, 920px); padding: 38px 0 60px; }
  .panel { padding: 19px; }
  .sign-in-panel { grid-template-columns: 1fr; }
  .sign-in-panel .button { width: 100%; }
  .field-grid { grid-template-columns: 1fr; }
  .field-wide { grid-column: auto; }
  .form-actions { flex-direction: column; }
  .form-actions .button { width: 100%; }
}
