*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --indigo:       #4338ca;
  --indigo-light: #eef2ff;
  --indigo-pale:  #f5f3ff;
  --indigo-mid:   #6366f1;
  --text:         #111827;
  --muted:        #6b7280;
  --border:       #e5e7eb;
  --white:        #ffffff;
  --sidebar-w:    200px;
}

html { scroll-behavior: smooth; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 15px;
  line-height: 1.7;
  color: var(--text);
  background: #f8f8fc;
}

/* ── Centered page wrapper ── */
.page {
  max-width: 1060px;
  margin: 0 auto;
  display: flex;
  align-items: flex-start;
  min-height: 100vh;
}

/* ── Sidebar ── */
nav {
  width: var(--sidebar-w);
  min-width: var(--sidebar-w);
  background: var(--indigo-pale);
  border-right: 1px solid #ddd6fe;
  padding: 36px 0 40px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.nav-brand { padding: 0 18px 24px; border-bottom: 1px solid #ddd6fe; margin-bottom: 14px; }
.nav-brand .course-id  { font-size: 17px; font-weight: 700; color: var(--indigo); }
.nav-brand .course-term { font-size: 11.5px; color: var(--muted); margin-top: 2px; }

nav ul { list-style: none; }
nav ul li a {
  display: block;
  padding: 6px 18px;
  color: #374151;
  text-decoration: none;
  font-size: 13.5px;
  border-left: 2px solid transparent;
  transition: background .12s, color .12s, border-color .12s;
}
nav ul li a:hover,
nav ul li a.active {
  background: #ede9fe;
  border-left-color: var(--indigo-mid);
  color: var(--indigo);
}

.nav-group-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: #a78bfa;
  padding: 16px 18px 4px;
}

/* ── Main ── */
main {
  flex: 1;
  padding: 52px 52px 80px;
  background: var(--white);
  min-height: 100vh;
}

.page-header { margin-bottom: 44px; }
.page-header h1 { font-size: 26px; font-weight: 700; color: var(--indigo); line-height: 1.2; }
.page-header .meta { font-size: 14px; color: var(--muted); margin-top: 5px; }

section { margin-bottom: 52px; }

h2 {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--indigo-mid);
  margin-bottom: 18px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

p { margin-bottom: 10px; }
p:last-child { margin-bottom: 0; }

a { color: var(--indigo); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── People ── */
.person { display: flex; gap: 16px; align-items: flex-start; }

.avatar {
  width: 56px; height: 56px;
  border-radius: 50%;
  background: var(--indigo-light);
  color: var(--indigo);
  font-size: 16px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  border: 1.5px solid #c7d2fe;
}
.avatar img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }

.person-info .role {
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .06em; color: var(--indigo-mid); margin-bottom: 1px;
}
.person-info .name  { font-weight: 600; font-size: 15px; }
.person-info .detail { font-size: 13px; color: var(--muted); line-height: 1.55; }
.person-info .detail a { color: var(--indigo); }

.tutors-row {
  display: flex; gap: 40px; flex-wrap: wrap;
  margin-top: 26px; padding-top: 22px;
  border-top: 1px dashed var(--border);
}

/* ── Meetings ── */
.meetings-list { display: flex; flex-direction: column; gap: 9px; }
.meeting-row   { display: flex; align-items: baseline; }
.meeting-label { font-size: 13px; font-weight: 600; color: var(--muted); width: 100px; flex-shrink: 0; }
.meeting-value { font-size: 14px; }
.venue-note    { font-size: 13px; color: var(--muted); margin-top: 12px; }

/* ── Shared table card ── */
.table-card {
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,.07), 0 4px 20px rgba(99,102,241,.08);
  border: 1px solid #e0e7ff;
}
.table-card table {
  width: 100%; border-collapse: collapse; background: var(--white);
}
.table-card thead tr { background: var(--indigo); }
.table-card thead th {
  padding: 11px 14px;
  font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  color: #c7d2fe; text-align: left;
}
.table-card thead th:last-child { text-align: right; }
.table-card tbody tr { border-bottom: 1px solid #f3f4f6; transition: background .1s; }
.table-card tbody tr:last-child { border-bottom: none; }
.table-card tbody tr:hover { background: var(--indigo-pale); }
.table-card tbody td { padding: 9px 14px; vertical-align: middle; font-size: 14px; }

/* ── Agenda specifics ── */
.week-row td {
  background: var(--indigo-light);
  font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  color: var(--indigo);
  padding: 6px 14px !important;
  border-bottom: 1px solid #c7d2fe;
}
.col-date  { width: 110px; font-size: 13px; color: var(--muted); white-space: nowrap; }
.col-links { width: 88px; white-space: nowrap; }
.col-tags  { width: 100px; text-align: right; white-space: nowrap; }

/* icon links */
.icon-link {
  display: inline-flex; align-items: center; justify-content: center;
  width: 26px; height: 26px; border-radius: 5px;
  color: #818cf8;
  text-decoration: none !important;
  transition: background .12s, color .12s;
}
.icon-link:hover { background: var(--indigo-light); color: var(--indigo); }
.icon-link.tbd   { color: #a5b4fc; }

/* agenda tags */
.atag { display: inline-block; font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 4px; }
.atag-quiz  { background: #fef9c3; color: #854d0e; border: 1px solid #fde68a; }
.atag-hw    { background: #dcfce7; color: #166534; border: 1px solid #bbf7d0; }
.atag-exam  { background: #fee2e2; color: #991b1b; border: 1px solid #fca5a5; }

/* ── Homework specifics ── */
.hw-link {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 13px; font-weight: 500;
  color: var(--indigo);
  padding: 3px 10px; border-radius: 5px;
  border: 1px solid #c7d2fe; background: var(--indigo-light);
  transition: background .12s, border-color .12s;
  text-decoration: none;
}
.hw-link:hover { background: #dde4ff; border-color: var(--indigo-mid); text-decoration: none; }
.hw-link.tbd   { color: #9ca3af; border-color: var(--border); background: #f9fafb; pointer-events: none; }

/* ── Textbook ── */
.tb-badge {
  display: inline-block; font-size: 10px; font-weight: 700;
  letter-spacing: .06em; text-transform: uppercase;
  padding: 1px 7px; border-radius: 3px; margin-bottom: 3px;
}
.tb-req { background: var(--indigo-light); color: var(--indigo); }
.tb-opt { background: #f3f4f6; color: var(--muted); }

/* ── Grading table ── */
.grade-wrap {
  display: inline-block; overflow: hidden;
  border-radius: 8px; border: 1px solid var(--border);
  box-shadow: 0 1px 4px rgba(0,0,0,.05);
}
.grade-table { border-collapse: collapse; font-size: 13.5px; }
.grade-table th {
  background: #f3f4f6; padding: 8px 18px;
  font-size: 11px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase;
  color: var(--muted); text-align: left; border-bottom: 1px solid var(--border);
}
.grade-table td { padding: 6px 18px; border-bottom: 1px solid #f0f0f0; }
.grade-table tr:last-child td { border-bottom: none; }
.grade-table tr:nth-child(even) td { background: #fafafa; }

/* ── Policies ── */
.policy { margin-bottom: 24px; }
.policy h3 { font-size: 14px; font-weight: 700; color: var(--text); margin-bottom: 5px; }
.policy p  { font-size: 14px; color: #374151; }

footer {
  margin-top: 60px; padding-top: 18px;
  border-top: 1px solid var(--border);
  font-size: 12.5px; color: #9ca3af;
}
