:root {
  --ink: #1b2733;
  --muted: #657282;
  --line: #d9e1e8;
  --paper: #fbfaf7;
  --surface: #ffffff;
  --nav: #17324d;
  --teal: #2f7d6d;
  --coral: #d94f45;
  --gold: #c99a2e;
  --blue: #3267a8;
  --shadow: 0 18px 45px rgba(27, 39, 51, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
}

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

button,
select,
input,
textarea {
  border: 1px solid var(--line);
}

button {
  cursor: pointer;
}

.app-shell {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  gap: 28px;
  height: 100vh;
  padding: 24px;
  background: var(--nav);
  color: #fff;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: #fff;
  text-decoration: none;
}

.brand strong,
.brand small {
  display: block;
}

.brand small {
  color: rgba(255, 255, 255, 0.72);
}

.nav-list {
  display: grid;
  gap: 8px;
}

.nav-list a {
  border-radius: 8px;
  color: rgba(255, 255, 255, 0.78);
  padding: 11px 12px;
  text-decoration: none;
}

.nav-list a.active,
.nav-list a:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.profile-switcher {
  margin-top: auto;
  display: grid;
  gap: 8px;
}

.profile-switcher label {
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.86rem;
}

.profile-switcher select {
  width: 100%;
  border-radius: 8px;
  padding: 10px;
  background: #fff;
  color: var(--ink);
}

main {
  min-width: 0;
  padding: 28px;
}

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

.topbar h1 {
  max-width: 760px;
  margin: 0;
  font-size: clamp(2rem, 4vw, 4.4rem);
  line-height: 1;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--teal);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.primary-button,
.icon-button,
.action-grid button,
.segmented button {
  min-height: 42px;
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
}

.primary-button {
  border-color: var(--teal);
  background: var(--teal);
  color: #fff;
  padding: 0 16px;
  font-weight: 700;
}

.icon-button {
  width: 42px;
  padding: 0;
  font-size: 1.45rem;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

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

.section-heading h2,
.panel h3,
.dialog-card h2 {
  margin: 0;
}

.status-pill,
.tag {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  border-radius: 999px;
  padding: 4px 10px;
  background: #edf5f2;
  color: var(--teal);
  font-size: 0.84rem;
  font-weight: 700;
}

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

.metric,
.panel,
.student-card,
.material-card,
.camper-card,
.privacy-card,
.message-row,
.timeline-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 1px 0 rgba(27, 39, 51, 0.04);
}

.metric {
  padding: 18px;
}

.metric span {
  display: block;
  color: var(--muted);
  font-size: 0.9rem;
}

.metric strong {
  display: block;
  margin-top: 8px;
  font-size: 2rem;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
  gap: 14px;
}

.panel {
  padding: 18px;
}

.action-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 16px;
}

.action-grid button {
  padding: 12px;
  text-align: left;
  font-weight: 700;
}

.stack-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.stack-list.wide {
  margin-top: 0;
}

.message-row,
.timeline-item {
  display: grid;
  gap: 8px;
  padding: 16px;
}

.message-row header,
.timeline-item header,
.student-card header,
.material-card header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.message-row h3,
.timeline-item h3,
.student-card h3,
.material-card h3,
.privacy-card h3 {
  margin: 0;
  font-size: 1.02rem;
}

.message-row p,
.timeline-item p,
.student-card p,
.material-card p,
.privacy-card p {
  margin: 0;
  color: var(--muted);
}

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

.student-card,
.material-card,
.camper-card,
.privacy-card {
  display: grid;
  gap: 14px;
  padding: 18px;
}

.spec-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 0;
}

.spec-list div {
  border-radius: 8px;
  background: #f3f6f8;
  padding: 10px;
}

.spec-list dt {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.spec-list dd {
  margin: 4px 0 0;
  font-weight: 800;
}

.progress {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: #e8edf1;
}

.progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--blue);
}

.search-input {
  min-height: 42px;
  width: min(100%, 320px);
  border-radius: 8px;
  padding: 0 12px;
  background: #fff;
}

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

.timeline-item {
  grid-template-columns: 110px minmax(0, 1fr);
}

.date-block {
  display: grid;
  align-content: center;
  justify-items: center;
  min-height: 82px;
  border-radius: 8px;
  background: #edf2f7;
}

.date-block strong {
  font-size: 1.6rem;
}

.segmented {
  display: inline-flex;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
}

.segmented button {
  border: 0;
  border-radius: 0;
  padding: 0 12px;
}

.segmented button.active {
  background: var(--ink);
  color: #fff;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

table {
  width: 100%;
  min-width: 860px;
  border-collapse: collapse;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 14px;
  text-align: left;
  vertical-align: top;
}

th {
  background: #f3f6f8;
  font-size: 0.86rem;
}

tr:last-child td {
  border-bottom: 0;
}

dialog {
  width: min(92vw, 560px);
  border: 0;
  border-radius: 8px;
  padding: 0;
  box-shadow: var(--shadow);
}

dialog::backdrop {
  background: rgba(23, 50, 77, 0.5);
}

.dialog-card {
  display: grid;
  gap: 16px;
  padding: 20px;
}

.dialog-card header,
.dialog-card menu {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0;
  padding: 0;
}

.dialog-card label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-weight: 700;
}

.dialog-card input,
.dialog-card select,
.dialog-card textarea {
  width: 100%;
  border-radius: 8px;
  padding: 10px;
  color: var(--ink);
}

.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  max-width: min(92vw, 420px);
  transform: translateY(140%);
  border-radius: 8px;
  background: var(--ink);
  color: #fff;
  padding: 12px 14px;
  box-shadow: var(--shadow);
  transition: transform 180ms ease;
}

.toast.visible {
  transform: translateY(0);
}

@media (max-width: 1020px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
  }

  .nav-list {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

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

  .dashboard-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 680px) {
  main,
  .sidebar {
    padding: 18px;
  }

  .topbar,
  .section-heading {
    display: grid;
  }

  .nav-list,
  .metric-grid,
  .cards-grid,
  .action-grid {
    grid-template-columns: 1fr;
  }

  .timeline-item {
    grid-template-columns: 1fr;
  }

  .topbar-actions {
    width: 100%;
  }

  .primary-button {
    flex: 1;
  }
}
