:root {
  --purple: #1b365d;
  --purple-dark: #101820;
  --lavender: #e7edf5;
  --canvas: #f4f6f8;
  --line: #d7dcdf;
  --ink: #101820;
  --muted: #657270;
}

body {
  font-family: "Avenir Next", "Segoe UI", sans-serif;
  background: #f4f6f8;
}

.card,
.hero {
  border-radius: 8px;
}

.brand__mark,
.button,
.pill,
.invite,
.assignment-meta div,
.empty,
.notice {
  border-radius: 6px;
}

.brand__mark,
.button--primary {
  background: var(--purple);
  box-shadow: none;
}

.button--primary:hover {
  background: var(--purple-dark);
}

.button--quiet,
.pill {
  background: var(--lavender);
  color: var(--purple-dark);
}

.hero {
  min-height: 190px;
  background-color: #1b365d;
  background-image: linear-gradient(135deg, transparent 0 68%, rgba(255, 255, 255, 0.11) 68% 70%, transparent 70%), linear-gradient(45deg, transparent 0 77%, rgba(162, 172, 171, 0.16) 77% 79%, transparent 79%);
}

.hero h1 {
  font-size: 40px;
  letter-spacing: 0;
}

.hero p {
  color: #ffffff;
}

.hero .eyebrow {
  color: #a2acab;
}

.hero__metric {
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.08);
}

.hero__metric span,
.hero__metric small {
  color: #ffffff;
}

.hero__metric small {
  grid-column: 1 / -1;
  margin-top: 8px;
  font-size: 11px;
}

.sync-state {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #1b365d;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.sync-state::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #1b365d;
}

.sync-state--offline {
  color: #657270;
}

.sync-state--offline::before {
  background: #a2acab;
}

.login-view,
.dashboard-shell {
  animation: enter 360ms ease-out both;
}

.login-card {
  border-top: 4px solid #1b365d;
}

.login-error {
  margin: 0;
  color: #9f2d38;
  font-size: 14px;
  font-weight: 700;
}

.login-switch {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  text-align: center;
}

.login-switch a,
.material-list a {
  color: #1b365d;
  font-weight: 700;
}

.social-layout,
.settings-grid {
  display: grid;
  grid-template-columns: minmax(260px, .8fr) minmax(0, 1.5fr);
  gap: 18px;
  margin-top: 28px;
}

.people-panel,
.conversation-panel {
  min-height: 580px;
}

.people-panel h1,
.conversation-panel h2,
.settings-grid h1,
.settings-grid h2 {
  margin: 5px 0 18px;
}

.search-form,
#message-form,
#profile-form,
#avatar-form,
#password-form {
  display: grid;
  gap: 12px;
}

.people-list {
  display: grid;
  gap: 8px;
  margin-top: 18px;
}

.message-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.tab-button {
  border: 0;
  border-bottom: 3px solid transparent;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  padding: 10px 12px;
  font: inherit;
  font-size: 14px;
  font-weight: 800;
}

.tab-button.is-active { border-bottom-color: #1b365d; color: #1b365d; }

.profile-card { display: grid; gap: 12px; }
.profile-card h3, .profile-card p { margin: 0; }
.profile-card__avatar { display: grid; width: 76px; height: 76px; place-items: center; overflow: hidden; border-radius: 50%; background: #1b365d; color: #fff; font-size: 30px; font-weight: 800; }
.profile-card__avatar img { width: 100%; height: 100%; object-fit: cover; }
.notifications { position: relative; font-size: 13px; }
.notifications summary { cursor: pointer; color: #1b365d; font-weight: 800; white-space: nowrap; }
.notification-count, .message-count { display: inline-block; margin-left: 4px; border-radius: 10px; background: #1b365d; color: #fff; padding: 1px 6px; font-size: 11px; }
.message-count { background: #516b4f; }
.notifications__list { position: absolute; z-index: 5; right: 0; top: 28px; display: grid; width: min(340px, 80vw); max-height: 360px; overflow: auto; border: 1px solid var(--line); background: #fff; box-shadow: 0 8px 24px #10182024; }
.notifications__list a, .notifications__list p { display: grid; gap: 3px; margin: 0; padding: 12px; color: var(--ink); text-decoration: none; }
.notifications__list a + a { border-top: 1px solid var(--line); }
.notifications__list span { color: var(--muted); }
.student-directory, .calendar-list { display: grid; gap: 12px; }
.student-card, .calendar-event { display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.student-card h2 { margin: 0; font-size: 18px; }
.student-card p { margin: 5px 0 0; }
.student-card dl { display: flex; gap: 18px; margin: 0; }
.student-card dt { color: var(--muted); font-size: 12px; }
.student-card dd { margin: 2px 0 0; font-size: 20px; font-weight: 800; }
.student-card__actions { display: flex; flex-wrap: wrap; gap: 8px; }
.student-history { grid-column: 1 / -1; width: 100%; border-top: 1px solid var(--line); padding-top: 12px; }
.student-history ul { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.student-history li { padding: 8px; background: #eef2f3; }
.student-history span { color: var(--muted); font-size: 14px; }
.table-filter { max-width: 300px; }
.calendar-event { border-left: 4px solid #1b365d; background: #fff; padding: 16px 18px; }
.calendar-event time { min-width: 180px; color: #1b365d; font-weight: 800; }
.calendar-event strong, .calendar-event span { display: block; }
.calendar-event div span { margin-top: 4px; color: var(--muted); font-size: 14px; }

.person-row {
  display: grid;
  gap: 3px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  padding: 12px;
  color: var(--ink);
  cursor: pointer;
  text-align: left;
}

.person-row:hover { border-color: #1b365d; background: #e7edf5; }
.person-row small { color: var(--muted); }
.message-list { display: grid; gap: 10px; min-height: 390px; max-height: 520px; overflow-y: auto; padding: 12px 0; }
.message { max-width: 78%; padding: 10px 12px; border-radius: 6px; }
.message p { margin: 0 0 5px; white-space: pre-wrap; }
.message small { color: var(--muted); font-size: 11px; }
.message--incoming { background: #eef2f3; }
.message--outgoing { justify-self: end; background: #e7edf5; }
.avatar { display: grid; width: 96px; height: 96px; place-items: center; margin-bottom: 16px; border: 3px solid #e7edf5; border-radius: 50%; background: #1b365d center / cover no-repeat; color: #fff; font-size: 40px; font-weight: 800; }
.provision-member { border-top: 1px solid var(--line); padding-top: 12px; }
.provision-member summary { color: #1b365d; cursor: pointer; font-size: 14px; font-weight: 800; }
.provision-form { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }
.provision-form .button { grid-column: 1 / -1; }

@media (max-width: 760px) {
  .social-layout,
  .settings-grid { grid-template-columns: 1fr; }
  .people-panel,
  .conversation-panel { min-height: auto; }
  .provision-form { grid-template-columns: 1fr; }
  .student-card, .calendar-event { align-items: flex-start; flex-direction: column; }
  .student-card dl { width: 100%; }
  .table-filter { max-width: none; margin-top: 10px; }
}

input:focus,
textarea:focus,
select:focus {
  border-color: #1b365d;
  box-shadow: 0 0 0 3px #e7edf5;
}

.checkbox input {
  accent-color: #1b365d;
}

.status-published,
.status-reviewed {
  background: #e7edf5;
  color: #1b365d;
}

.status-submitted {
  background: #eef2f3;
  color: #101820;
}

.status-late {
  background: #f2eeee;
  color: #7f3035;
}

@keyframes enter {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 760px) {
  .topbar__right {
    flex-wrap: wrap;
    justify-content: flex-end;
  }

  .sync-state {
    font-size: 11px;
  }

  .hero h1 {
    font-size: 30px;
  }

  .shell { padding: 12px; }
  .topbar { height: auto; min-height: 56px; align-items: flex-start; gap: 10px; padding: 8px 0; }
  .topbar__right { width: 100%; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
  .topbar__right .button { min-height: 40px; padding: 7px 5px; overflow-wrap: anywhere; font-size: 12px; text-align: center; }
  .topbar__right .notifications { min-width: 0; padding: 9px 2px; text-align: center; }
  .topbar__right .notifications summary { overflow: hidden; text-overflow: ellipsis; }
  .hero { margin: 12px 0 20px; min-height: 0; padding: 22px 18px; align-items: flex-start; }
  .hero__metric { width: 100%; min-width: 0; }
  .card { padding: 16px; }
  .assignment-actions, .chat-bind, .upload-form { align-items: stretch; }
  .assignment-actions .button, .assignment-actions a { flex: 1 1 130px; text-align: center; }
}

.max-login { display: block; width: 100%; text-align: center; text-decoration: none; }
.login-divider { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 12px; }
.login-divider::before, .login-divider::after { content: ""; flex: 1; border-top: 1px solid var(--line); }
