:root {
  color-scheme: light;
  --ink: #17202a;
  --muted: #5e6874;
  --line: #cbd3dc;
  --line-strong: #9eabb8;
  --panel: #ffffff;
  --surface: #f2f5f8;
  --surface-strong: #e5eaf0;
  --nav: #0d3f7a;
  --nav-dark: #06275d;
  --tab: #38a3d8;
  --tab-active: #b9d727;
  --accent: #1f6f5b;
  --accent-soft: #e3f3ed;
  --gold: #9a6b12;
  --gold-soft: #fff2cc;
  --warning: #9b332c;
  --warning-soft: #f8dfdb;
  --shadow: 0 12px 28px rgba(23, 32, 42, 0.08);
  font-family: Arial, Helvetica, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  min-width: 320px;
  margin: 0;
  background: var(--surface);
  color: var(--ink);
  letter-spacing: 0;
}

button,
input,
select,
textarea {
  font: inherit;
  letter-spacing: 0;
}

button {
  cursor: pointer;
}

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

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 14px;
  border-right: 1px solid #aeb8c2;
  background: #eef1f4;
  color: var(--ink);
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 10px 8px;
}

.brand-mark {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 4px;
  background: linear-gradient(135deg, #9cc61b, #1e9bd2);
  color: #ffffff;
  font-weight: 800;
}

.brand h1,
.brand p,
.sidebar-footer p {
  margin: 0;
}

.brand h1 {
  font-size: 1rem;
  line-height: 1.1;
}

.brand p,
.sidebar-footer {
  color: var(--muted);
  font-size: 0.76rem;
}

.nav-tabs {
  display: grid;
  gap: 1px;
  padding: 0 8px;
}

.nav-tab {
  display: flex;
  align-items: center;
  gap: 7px;
  width: 100%;
  min-height: 31px;
  border: 1px solid #c9d0d8;
  border-radius: 2px;
  background: linear-gradient(#ffffff, #e8edf2);
  color: var(--ink);
  padding: 5px 8px;
  text-align: left;
  font-size: 0.78rem;
}

.nav-tab span {
  display: grid;
  width: 18px;
  height: 18px;
  place-items: center;
  color: #946500;
  font-size: 0.7rem;
  font-weight: 800;
}

.nav-tab.active,
.nav-tab:hover {
  border-color: #7fa7c8;
  background: linear-gradient(#cce9fb, #7fc4ed);
}

.sidebar-footer {
  margin-top: auto;
  display: grid;
  gap: 7px;
  border-top: 1px solid #c7d0d8;
  padding: 10px;
  line-height: 1.35;
}

.workspace {
  display: grid;
  align-content: start;
  gap: 10px;
  padding: 12px 16px 24px;
}

.topbar,
.controls-band,
.table-header,
.student-page-toolbar,
.modal-heading,
.modal-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.topbar {
  min-height: 32px;
  border-radius: 3px;
  background: linear-gradient(#1e66ac, var(--nav-dark));
  color: #ffffff;
  padding: 5px 8px;
}

.topbar h2,
.topbar p,
.modal-heading h3,
.modal-heading p {
  margin: 0;
}

.topbar h2 {
  font-size: 0.92rem;
  line-height: 1.1;
}

.eyebrow {
  color: inherit;
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
}

.topbar-actions,
.student-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.primary-button,
.secondary-button,
.ghost-button,
.warning-button,
.icon-button,
.small-button {
  min-height: 28px;
  border-radius: 4px;
  padding: 0 9px;
  border: 1px solid transparent;
  font-size: 0.76rem;
  font-weight: 700;
}

.primary-button {
  border-color: #0b503f;
  background: linear-gradient(#2b9b7d, #16614f);
  color: #ffffff;
}

.secondary-button,
.ghost-button,
.small-button {
  border-color: #b8c2cc;
  background: linear-gradient(#ffffff, #e7ebef);
  color: var(--ink);
}

.warning-button {
  border-color: #ceada8;
  background: var(--warning-soft);
  color: var(--warning);
}

.icon-button {
  width: 30px;
  padding: 0;
  border-color: #b8c2cc;
  background: #ffffff;
  color: var(--muted);
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(120px, 1fr));
  gap: 8px;
}

.metric {
  display: grid;
  gap: 2px;
  min-height: 58px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--panel);
  padding: 8px 10px;
}

.metric-label,
.metric span:last-child {
  color: var(--muted);
  font-size: 0.72rem;
}

.metric strong {
  font-size: 1.35rem;
  line-height: 1;
}

.controls-band {
  flex-wrap: wrap;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--panel);
  padding: 8px;
}

label {
  display: grid;
  gap: 3px;
  min-width: 130px;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 800;
}

.search-box {
  flex: 1 1 230px;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid #bcc6cf;
  border-radius: 2px;
  background: #ffffff;
  color: var(--ink);
  padding: 5px 6px;
  outline: none;
  font-size: 0.78rem;
}

textarea {
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: #2276a9;
  box-shadow: 0 0 0 2px #d6ecfa;
}

.content-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  align-items: start;
}

.roster-panel,
.student-page,
.schedule-board {
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.roster-panel {
  overflow: hidden;
}

.table-header {
  min-height: 40px;
  padding: 7px 9px;
  border-bottom: 1px solid var(--line);
}

.table-header p {
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

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

.student-row {
  display: grid;
  grid-template-columns: minmax(210px, 1.45fr) 74px 112px 86px 112px minmax(210px, 1.25fr) 82px;
  min-width: 980px;
  border-bottom: 1px solid #d8dee5;
}

.student-row.header {
  background: linear-gradient(#f7f8f9, #dbe1e7);
  color: #384653;
  font-size: 0.68rem;
  font-weight: 900;
  text-transform: uppercase;
}

.student-row button {
  display: contents;
}

.student-row:not(.header):hover,
.student-row.selected {
  background: #edf7fc;
}

.student-cell {
  display: grid;
  align-content: center;
  min-height: 38px;
  padding: 4px 8px;
  font-size: 0.76rem;
  line-height: 1.25;
}

.student-row.header span {
  padding: 7px 8px;
}

.student-name {
  color: var(--ink);
  font-weight: 800;
}

.student-subtext,
.next-step,
.status-copy {
  color: var(--muted);
  font-size: 0.7rem;
  line-height: 1.25;
}

.plan-pill,
.status-pill,
.deliverable-status {
  display: inline-flex;
  width: max-content;
  max-width: 100%;
  align-items: center;
  border-radius: 3px;
  padding: 2px 5px;
  font-size: 0.68rem;
  font-weight: 800;
  line-height: 1.2;
}

.plan-pill {
  background: var(--gold-soft);
  color: var(--gold);
}

.plan-pill.standard {
  background: var(--surface-strong);
  color: #33495d;
}

.status-pill.active,
.deliverable-status.complete {
  background: var(--accent-soft);
  color: #155645;
}

.status-pill.past {
  background: #eef0f4;
  color: #596174;
}

.deliverable-status.blocked {
  background: var(--warning-soft);
  color: var(--warning);
}

.deliverable-status.in-progress {
  background: #e5eefb;
  color: #245b9c;
}

.deliverable-status.not-started {
  background: #eef0f4;
  color: #596174;
}

.student-page {
  overflow: hidden;
}

.student-page-toolbar {
  min-height: 40px;
  border-bottom: 1px solid var(--line);
  background: #f8fafb;
  padding: 6px 8px;
}

.record-banner {
  display: grid;
  grid-template-columns: 126px minmax(220px, 1fr) minmax(220px, 0.7fr);
  gap: 8px;
  border-bottom: 1px solid var(--line);
  background: #ffffff;
  padding: 10px;
}

.photo-placeholder {
  display: grid;
  min-height: 118px;
  place-items: center;
  border: 1px solid #d6dce3;
  background: #fafafa;
  color: #c1c1c1;
  font-size: 1.35rem;
  font-weight: 800;
  text-align: center;
}

.record-title {
  display: grid;
  align-content: center;
  gap: 4px;
}

.record-title h3,
.record-title p {
  margin: 0;
}

.record-title h3 {
  font-size: 1.35rem;
}

.record-title .eyebrow {
  color: #a0462d;
}

.record-quick {
  display: grid;
  grid-template-columns: 1fr;
  align-content: center;
  margin: 0;
  border: 1px solid var(--line);
}

.record-quick div,
.record-table div {
  display: grid;
  grid-template-columns: minmax(120px, 0.45fr) minmax(0, 1fr);
  min-width: 0;
  border-bottom: 1px solid var(--line);
}

.record-quick div:last-child,
.record-table div:last-child {
  border-bottom: 0;
}

dt,
dd {
  margin: 0;
  min-width: 0;
  overflow-wrap: anywhere;
}

dt {
  background: #eeeeee;
  color: #222f3d;
  padding: 5px 7px;
  font-size: 0.7rem;
  font-weight: 800;
}

dd {
  padding: 5px 7px;
  font-size: 0.76rem;
}

.record-tabs {
  display: grid;
  grid-template-columns: repeat(6, minmax(110px, 1fr));
  border-bottom: 3px solid #0f5f91;
  background: #5eb4df;
}

.record-tab {
  min-height: 31px;
  border: 0;
  border-right: 1px solid #e2f2fb;
  background: linear-gradient(#75c3e9, #2f9bd1);
  color: #ffffff;
  font-size: 0.76rem;
  font-weight: 800;
}

.record-tab.active {
  background: linear-gradient(#d7ec42, #a9c41f);
  color: #1b2630;
}

.record-body {
  padding: 10px;
}

.record-grid {
  display: grid;
  gap: 10px;
}

.record-grid.two-column {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: start;
}

.record-section {
  overflow: hidden;
  border: 1px solid var(--line);
  background: #ffffff;
}

.record-section h4 {
  display: flex;
  align-items: center;
  gap: 4px;
  margin: 0;
  border-bottom: 1px solid var(--line);
  background: #ffffff;
  padding: 6px 8px;
  color: #1b2630;
  font-size: 0.83rem;
}

.record-section h4 span {
  color: #c00000;
  font-size: 0.9rem;
}

.record-table {
  margin: 0;
}

.record-notes {
  min-height: 110px;
  margin: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  border: 0;
  background: #ffffff;
  padding: 9px;
  color: #111111;
  font: 0.78rem/1.45 Arial, Helvetica, sans-serif;
}

.document-list,
.record-list-table {
  display: grid;
  overflow-x: auto;
}

.document-row,
.record-list-header,
.record-list-row {
  display: grid;
  align-items: center;
  border-bottom: 1px solid var(--line);
}

.document-row {
  grid-template-columns: 170px minmax(180px, 1fr) 64px;
}

.document-row:last-child,
.record-list-row:last-child {
  border-bottom: 0;
}

.document-row > span,
.document-row input,
.show-toggle {
  min-height: 30px;
}

.document-row > span {
  display: grid;
  align-content: center;
  background: #eeeeee;
  padding: 5px 8px;
  font-size: 0.75rem;
}

.document-row input {
  border: 0;
  border-left: 1px solid var(--line);
  border-right: 1px solid var(--line);
  border-radius: 0;
}

.show-toggle {
  display: flex;
  align-items: center;
  gap: 4px;
  justify-content: center;
  min-width: 0;
  color: var(--ink);
  font-size: 0.7rem;
}

.show-toggle input {
  width: auto;
}

.record-list-header,
.record-list-row {
  grid-template-columns: minmax(210px, 1.6fr) 100px 100px 76px 142px;
  min-width: 720px;
}

.record-list-header {
  background: #dce2e8;
  color: #2f3a45;
  font-size: 0.7rem;
  font-weight: 900;
  text-transform: uppercase;
}

.record-list-header span,
.record-list-row > span {
  padding: 6px 8px;
}

.record-list-row {
  font-size: 0.76rem;
}

.record-list-row small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.7rem;
}

.record-row-actions {
  display: flex;
  gap: 5px;
}

.empty-state {
  display: grid;
  gap: 8px;
  padding: 36px 20px;
  color: var(--muted);
  text-align: center;
}

.empty-state h3,
.empty-state p {
  margin: 0;
}

.modal {
  width: min(760px, calc(100vw - 28px));
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0;
  color: var(--ink);
  box-shadow: 0 28px 72px rgba(23, 32, 42, 0.24);
}

.modal::backdrop {
  background: rgba(23, 32, 42, 0.46);
}

.modal form {
  display: grid;
  gap: 14px;
  padding: 16px;
}

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

.form-grid .wide {
  grid-column: 1 / -1;
}

.modal-actions {
  justify-content: flex-end;
}

.schedule-view {
  grid-column: 1 / -1;
}

.schedule-board {
  display: grid;
  grid-template-columns: repeat(4, minmax(220px, 1fr));
  gap: 0;
  overflow: hidden;
}

.schedule-column {
  min-height: 420px;
  border-right: 1px solid var(--line);
  background: #ffffff;
}

.schedule-column:last-child {
  border-right: 0;
}

.schedule-column h3 {
  margin: 0;
  border-bottom: 1px solid var(--line);
  background: var(--surface-strong);
  padding: 9px;
  font-size: 0.82rem;
}

.schedule-items {
  display: grid;
  gap: 8px;
  padding: 9px;
}

.schedule-card {
  display: grid;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 9px;
}

.schedule-card h4,
.schedule-card p {
  margin: 0;
}

.schedule-card h4 {
  line-height: 1.25;
}

.schedule-card p {
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.35;
}

.hidden {
  display: none !important;
}

@media (max-width: 1120px) {
  .record-grid.two-column,
  .schedule-board {
    grid-template-columns: 1fr;
  }

  .record-banner {
    grid-template-columns: 110px 1fr;
  }

  .record-quick {
    grid-column: 1 / -1;
  }
}

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

  .sidebar {
    position: sticky;
    top: 0;
    z-index: 3;
  }

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

  .nav-tab {
    justify-content: center;
    min-height: 36px;
    text-align: center;
  }

  .nav-tab span,
  .sidebar-footer {
    display: none;
  }

  .workspace {
    padding: 10px;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .topbar-actions {
    width: 100%;
    justify-content: flex-start;
  }

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

  .record-tabs {
    grid-template-columns: repeat(3, minmax(100px, 1fr));
  }
}

@media (max-width: 620px) {
  .topbar-actions,
  .controls-band,
  .student-page-toolbar,
  .student-actions,
  .modal-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .topbar-actions button,
  .student-actions button,
  .modal-actions button,
  .controls-band label {
    width: 100%;
  }

  .metrics-grid,
  .form-grid,
  .record-banner {
    grid-template-columns: 1fr;
  }

  .photo-placeholder {
    min-height: 86px;
  }

  .record-tabs {
    grid-template-columns: 1fr 1fr;
  }
}
