:root {
  --bg:        #111110;
  --surface:   #1a1917;
  --raised:    #222120;
  --rule:      #2c2a27;
  --rule2:     #3a3835;
  --ink:       #f0ede8;
  --muted:     #9b9692;
  --faint:     #6b6762;
  --red:       #e8321a;
  --red-dim:   rgba(232,50,26,0.1);
  --green:     #3db870;
  --green-dim: rgba(61,184,112,0.1);
  --amber:     #d4891a;
  --amber-dim: rgba(212,137,26,0.12);
  --serif:     'DM Serif Display', Georgia, serif;
  --body:      'Figtree', system-ui, sans-serif;
  --mono:      'DM Mono', monospace;
  --snap:      cubic-bezier(0.22, 1, 0.36, 1);
}

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

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--body);
  font-weight: 400;
  line-height: 1.5;
  min-height: 100vh;
  text-transform: lowercase;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
button { cursor: pointer; border: none; background: none; font-family: var(--body); text-transform: lowercase; }

.screen { display: none; }
.screen.active { display: block; }

/* ── LOGIN ── */
#screen-login { min-height: 100vh; display: none; align-items: center; justify-content: center; padding: 24px; }
#screen-login.active { display: flex; }

.login-wrap { width: 100%; max-width: 360px; }
.text-button { margin-top: 12px; color: var(--muted); font-family: var(--mono); font-size: 0.66rem; letter-spacing: 0.04em; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.password-reset-form { gap: 12px; margin-top: 8px; }

.login-logo { display: flex; align-items: center; gap: 10px; margin-bottom: 52px; }

.logo-dots { display: grid; grid-template-columns: repeat(2, 7px); gap: 4px; position: relative; top: 1px; }
.logo-dots .d { width: 7px; height: 7px; background: var(--red); border-radius: 50%; display: block; }
.logo-dots .d:nth-child(1) { grid-column: 1 / 3; justify-self: left; margin-bottom: -2px; }
.logo-dots .d:nth-child(2) { grid-column: 2 / 3; justify-self: center; margin-bottom: -2px; }
.logo-dots .d:nth-child(3) { grid-column: 1; }

.logo-name { font-family: var(--body); font-weight: 600; font-size: 0.95rem; letter-spacing: 0.06em; color: var(--ink); }
.logo-sub  { font-family: var(--mono); font-size: 0.72rem; font-weight: 300; color: var(--red); letter-spacing: 0.04em; }

.login-wrap h1 { font-family: var(--serif); font-size: 2.2rem; font-weight: 400; line-height: 1.1; margin-bottom: 8px; }
.login-wrap h1 em { color: var(--red); font-style: italic; }
.login-sub { font-size: 0.88rem; font-weight: 300; color: var(--muted); margin-bottom: 36px; }

.field { border-bottom: 1px solid var(--rule); transition: border-color 0.2s; }
.field:focus-within { border-bottom-color: var(--red); }
.field input { width: 100%; background: transparent; border: none; color: var(--ink); padding: 13px 0; font-family: var(--body); font-size: 1rem; font-weight: 400; letter-spacing: 0; outline: none; }
.field input::placeholder { color: var(--faint); }

.login-btn { width: 100%; min-height: 48px; background: var(--ink); color: var(--bg); padding: 13px; font-family: var(--body); font-size: 0.95rem; font-weight: 600; letter-spacing: 0; transition: background 0.2s, color 0.2s; margin-top: 28px; display: block; border-radius: 3px; }
.login-btn:hover:not(:disabled) { background: var(--red); color: #fff; }
.login-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.login-err { font-family: var(--mono); font-size: 0.66rem; color: var(--red); min-height: 1em; margin-top: 12px; letter-spacing: 0.04em; }

/* ── APP SHELL ── */
#screen-app { display: none; flex-direction: column; min-height: 100vh; }
#screen-app.active { display: flex; }

.topbar { height: 56px; padding: 0 28px; border-bottom: 1px solid var(--rule); display: flex; align-items: center; justify-content: space-between; position: sticky; top: 0; background: var(--bg); z-index: 100; flex-shrink: 0; }
.topbar-brand { display: flex; align-items: center; gap: 10px; }
.topbar-dots { display: grid; grid-template-columns: repeat(2, 6px); gap: 3px; }
.topbar-dots .d { width: 6px; height: 6px; background: var(--red); border-radius: 50%; }
.topbar-dots .d:nth-child(1) { grid-column: 1/3; justify-self: left; margin-bottom: -1px; }
.topbar-dots .d:nth-child(2) { grid-column: 2/3; justify-self: center; margin-bottom: -1px; }
.topbar-dots .d:nth-child(3) { grid-column: 1; }
.topbar-name { font-family: var(--body); font-weight: 600; font-size: 0.95rem; letter-spacing: 0.06em; color: var(--ink); }
.topbar-tag  { font-family: var(--mono); font-size: 0.72rem; font-weight: 300; color: var(--red); letter-spacing: 0.04em; }
.topbar-right { display: flex; align-items: center; gap: 20px; }
.topbar-user { font-family: var(--mono); font-size: 0.66rem; font-weight: 300; color: var(--muted); }
.topbar-user strong { color: var(--ink); font-weight: 400; }
.topbar-admin-badge { font-family: var(--mono); font-size: 0.58rem; font-weight: 400; color: var(--amber); background: var(--amber-dim); padding: 3px 8px; letter-spacing: 0.1em; text-transform: uppercase; }
.logout-btn { font-family: var(--mono); font-size: 0.64rem; font-weight: 300; color: var(--faint); letter-spacing: 0.06em; transition: color 0.2s; }
.logout-btn:hover { color: var(--red); }

.shell { display: grid; grid-template-columns: 210px 1fr; flex: 1; min-height: 0; }

/* ── SIDEBAR ── */
.sidebar { border-right: 1px solid var(--rule); padding: 24px 0; position: sticky; top: 56px; height: calc(100vh - 56px); overflow-y: auto; }
.sidebar-section { margin-bottom: 6px; }
.sidebar-hd { font-family: var(--mono); font-size: 0.57rem; font-weight: 300; color: var(--faint); letter-spacing: 0.18em; text-transform: uppercase; padding: 0 20px; margin-bottom: 2px; }
.nav-item { display: flex; align-items: center; gap: 9px; padding: 8px 20px; font-size: 0.82rem; font-weight: 400; color: var(--muted); cursor: pointer; transition: color 0.15s, background 0.15s; border-left: 2px solid transparent; user-select: none; }
.nav-item .ni { font-size: 0.75rem; width: 15px; text-align: center; flex-shrink: 0; opacity: 0.5; }
.nav-item:hover { color: var(--ink); background: var(--surface); }
.nav-item.active { color: var(--ink); border-left-color: var(--red); background: var(--surface); }
.nav-item.active .ni { opacity: 1; }

/* ── CONTENT ── */
.content { padding: 36px 40px; overflow-y: auto; }
.view { display: none; }
.view.active { display: block; }

.pg-hd { margin-bottom: 32px; padding-bottom: 24px; border-bottom: 1px solid var(--rule); }
.pg-eyebrow { font-family: var(--mono); font-size: 0.6rem; font-weight: 300; color: var(--faint); letter-spacing: 0.16em; text-transform: uppercase; margin-bottom: 6px; }
.pg-hd h2 { font-family: var(--serif); font-size: 1.9rem; font-weight: 400; line-height: 1.05; }
.pg-hd h2 em { color: var(--red); font-style: italic; }
.pg-meta { font-size: 0.84rem; font-weight: 300; color: var(--muted); margin-top: 5px; }

/* ── STAT STRIP ── */
.stat-strip { display: grid; grid-template-columns: repeat(4, 1fr); border: 1px solid var(--rule); margin-bottom: 32px; }
.stat-cell { padding: 20px 22px; border-right: 1px solid var(--rule); }
.stat-cell:last-child { border-right: none; }
.stat-lbl { font-family: var(--mono); font-size: 0.58rem; font-weight: 300; color: var(--faint); letter-spacing: 0.14em; text-transform: uppercase; margin-bottom: 8px; }
.stat-val { font-family: var(--serif); font-size: 1.5rem; font-weight: 400; line-height: 1; }
.stat-sub { font-family: var(--mono); font-size: 0.6rem; font-weight: 300; color: var(--muted); margin-top: 4px; }

/* ── TWO COL ── */
.two-col { display: grid; grid-template-columns: 1fr 300px; gap: 28px; align-items: start; }

/* ── SEC HD ── */
.sec-hd { font-family: var(--mono); font-size: 0.6rem; font-weight: 300; color: var(--faint); letter-spacing: 0.16em; text-transform: uppercase; margin-bottom: 14px; margin-top: 28px; padding-bottom: 10px; border-bottom: 1px solid var(--rule); display: flex; align-items: center; justify-content: space-between; }
.sec-hd:first-child { margin-top: 0; }

/* ── COURSE CARD ── */
.course-card { border: 1px solid var(--rule); margin-bottom: 10px; transition: border-color 0.2s; }
.course-card:hover { border-color: var(--rule2); }
.cc-inner { padding: 22px; display: grid; grid-template-columns: 1fr auto; gap: 16px; align-items: start; }
.cc-tag  { font-family: var(--mono); font-size: 0.58rem; font-weight: 300; color: var(--faint); letter-spacing: 0.14em; text-transform: uppercase; margin-bottom: 6px; }
.cc-name { font-family: var(--serif); font-size: 1.1rem; font-weight: 400; margin-bottom: 4px; }
.cc-meta { font-size: 0.8rem; font-weight: 300; color: var(--muted); }
.cc-contact { display: inline-block; margin-top: 10px; font-size: 0.86rem; font-weight: 500; color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
.cc-contact:hover { color: var(--red); }
.cc-contact-missing { margin-top: 10px; font-size: 0.82rem; color: var(--muted); }

/* ── BADGES ── */
.badge { display: inline-flex; align-items: center; padding: 3px 9px; font-family: var(--mono); font-size: 0.58rem; font-weight: 400; letter-spacing: 0.08em; text-transform: uppercase; }
.badge-green  { background: var(--green-dim); color: var(--green); }
.badge-amber  { background: var(--amber-dim); color: var(--amber); }
.badge-faint  { background: var(--surface); color: var(--muted); }
.badge-red    { background: var(--red-dim); color: var(--red); }

/* ── SESSION LIST ── */
.sess-list { border-top: 1px solid var(--rule); }
.sess-row { display: grid; grid-template-columns: 90px 1fr auto; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--rule); align-items: center; }
.sess-row.next-up { background: rgba(61,184,112,0.03); }
.sess-date { font-family: var(--mono); font-size: 0.68rem; font-weight: 300; color: var(--muted); }
.sess-title { font-size: 0.86rem; font-weight: 400; }
.sess-desc  { font-size: 0.76rem; font-weight: 300; color: var(--muted); margin-top: 2px; }
.sess-status { font-family: var(--mono); font-size: 0.6rem; font-weight: 300; text-transform: uppercase; letter-spacing: 0.1em; white-space: nowrap; }
.sess-status.done     { color: var(--faint); }
.sess-status.next     { color: var(--green); }
.sess-status.upcoming { color: var(--muted); }

/* ── NEXT SESSION CARD ── */
.next-card { border: 1px solid var(--rule); padding: 20px; margin-bottom: 10px; }
.nc-eyebrow { font-family: var(--mono); font-size: 0.58rem; font-weight: 300; color: var(--green); letter-spacing: 0.14em; text-transform: uppercase; margin-bottom: 8px; }
.nc-title { font-family: var(--serif); font-size: 1.05rem; font-weight: 400; margin-bottom: 6px; }
.nc-meta  { font-family: var(--mono); font-size: 0.68rem; font-weight: 300; color: var(--muted); line-height: 1.7; }

/* ── ANNOUNCEMENTS ── */
.ann { border-left: 2px solid var(--red); padding: 14px 18px; background: var(--surface); margin-bottom: 10px; position: relative; }
.ann-date  { font-family: var(--body); font-size: 0.76rem; font-weight: 400; color: var(--muted); letter-spacing: 0; margin-bottom: 5px; }
.mat-updated { margin-top: 5px; color: var(--muted); font-family: var(--body); font-size: 0.76rem; }
.ann-title { font-size: 0.86rem; font-weight: 500; margin-bottom: 4px; }
.ann-body  { font-size: 0.8rem; font-weight: 300; color: var(--muted); line-height: 1.65; }
.ann-pinned { display: inline-flex; background: var(--red-dim); color: var(--red); padding: 3px 8px; margin-bottom: 8px; font-family: var(--mono); font-size: 0.62rem; letter-spacing: 0.06em; text-transform: uppercase; }
.ann-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 12px; }

/* ── MATERIALS ── */
.mat-list { border-top: 1px solid var(--rule); }
.mat-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 13px 0; border-bottom: 1px solid var(--rule); cursor: pointer; transition: color 0.2s; text-decoration: none; color: inherit; }
.mat-row:hover { color: var(--red); }
.mat-name { font-size: 0.84rem; font-weight: 400; }
.mat-type { font-family: var(--mono); font-size: 0.6rem; font-weight: 300; color: var(--faint); letter-spacing: 0.08em; text-transform: uppercase; margin-top: 2px; }
.materials-search-row { max-width: 480px; margin-bottom: 24px; }
.assignments-filter-row { max-width: 240px; margin-bottom: 24px; }
.help-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; max-width: 900px; }
.help-card { border: 1px solid var(--rule); padding: 20px; background: var(--surface); }
.help-card h3 { font-family: var(--serif); font-size: 1.02rem; font-weight: 400; margin-bottom: 8px; }
.help-card p { color: var(--muted); font-size: 0.88rem; line-height: 1.65; }
.help-card a { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
.calendar-download { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 18px; }
.calendar-download p { color: var(--muted); font-size: 0.82rem; }
.mat-arrow { font-size: 0.78rem; color: var(--faint); transition: transform 0.15s var(--snap), color 0.2s; flex-shrink: 0; }
.mat-row:hover .mat-arrow { color: var(--red); transform: translate(2px,-2px); }

/* ── STATES ── */
.empty { padding: 40px 0; text-align: center; font-family: var(--mono); font-size: 0.72rem; font-weight: 300; color: var(--faint); letter-spacing: 0.06em; }
.loading { padding: 48px 0; text-align: center; font-family: var(--mono); font-size: 0.7rem; font-weight: 300; color: var(--faint); letter-spacing: 0.1em; animation: pulse 1.5s ease-in-out infinite; }
@keyframes pulse { 0%,100% { opacity: 0.4; } 50% { opacity: 1; } }

/* ── ADMIN GRID ── */
.admin-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; border: 1px solid var(--rule); background: var(--rule); margin-bottom: 28px; }
.admin-cell { background: var(--bg); padding: 28px; }
.admin-cell h3 { font-family: var(--serif); font-size: 1.05rem; font-weight: 400; margin-bottom: 20px; }

/* ── ADMIN STAT CARDS ── */
.admin-stats { display: grid; grid-template-columns: repeat(5, 1fr); gap: 1px; background: var(--rule); border: 1px solid var(--rule); margin-bottom: 32px; }
.admin-stat { background: var(--bg); padding: 22px 24px; }
.admin-stat .as-label { font-family: var(--mono); font-size: 0.58rem; font-weight: 300; color: var(--faint); letter-spacing: 0.14em; text-transform: uppercase; margin-bottom: 10px; }
.admin-stat .as-val { font-family: var(--serif); font-size: 2rem; font-weight: 400; line-height: 1; }
.admin-stat .as-sub { font-family: var(--mono); font-size: 0.6rem; font-weight: 300; color: var(--muted); margin-top: 5px; }

/* ── FORM ROWS ── */
.form-row { display: flex; flex-direction: column; gap: 0; margin-bottom: 16px; }
.form-row label { font-family: var(--body); font-size: 0.82rem; font-weight: 500; color: var(--ink); letter-spacing: 0; margin-bottom: 6px; }
.form-row input, .form-row select, .form-row textarea { width: 100%; min-height: 44px; background: var(--surface); border: 1px solid var(--rule2); border-radius: 3px; color: var(--ink); padding: 10px 12px; font-family: var(--body); font-size: 0.95rem; font-weight: 400; outline: none; appearance: none; -webkit-appearance: none; transition: border-color 0.2s, box-shadow 0.2s; }
.form-row input:focus, .form-row select:focus, .form-row textarea:focus { border-color: var(--red); box-shadow: 0 0 0 2px var(--red-dim); }
.form-row select { appearance: auto; -webkit-appearance: auto; }
.form-row input::placeholder, .form-row textarea::placeholder { color: var(--faint); }
.form-row select option { background: var(--surface); color: var(--ink); }
.form-row textarea { min-height: 90px; height: auto; resize: vertical; }

/* ── BUTTONS ── */
.btn-primary { background: var(--ink); color: var(--bg); min-height: 44px; padding: 10px 20px; font-family: var(--body); font-size: 0.9rem; font-weight: 600; letter-spacing: 0; transition: background 0.2s, color 0.2s; cursor: pointer; border: none; border-radius: 3px; }
.btn-primary:hover { background: var(--red); color: #fff; }
.btn-primary:disabled { opacity: 0.4; cursor: not-allowed; }
.btn-danger { background: var(--red-dim); color: var(--red); padding: 5px 10px; font-family: var(--mono); font-size: 0.62rem; font-weight: 400; letter-spacing: 0.06em; border: 1px solid rgba(232,50,26,0.2); cursor: pointer; transition: background 0.2s, color 0.2s; }
.btn-danger:hover { background: var(--red); color: #fff; }
.btn-sm { display: inline-flex; align-items: center; justify-content: center; min-height: 40px; font-family: var(--body); font-size: 0.82rem; font-weight: 500; color: var(--muted); letter-spacing: 0; padding: 8px 12px; border: 1px solid var(--rule); background: transparent; cursor: pointer; transition: color 0.2s, border-color 0.2s; border-radius: 3px; }
.btn-sm:hover { color: var(--red); border-color: var(--red); }

.form-msg { font-family: var(--body); font-size: 0.82rem; min-height: 1em; margin-top: 10px; letter-spacing: 0; line-height: 1.5; }
.form-msg.ok  { color: var(--green); }
.form-msg.err { color: var(--red); }

/* Compact staff forms for experienced administrators. */
.view[id^="view-admin"] .form-row label { font-family: var(--mono); font-size: 0.6rem; font-weight: 300; color: var(--faint); letter-spacing: 0.12em; text-transform: uppercase; margin-bottom: 4px; }
.view[id^="view-admin"] .form-row input,
.view[id^="view-admin"] .form-row select,
.view[id^="view-admin"] .form-row textarea { min-height: 0; background: transparent; border: 0; border-bottom: 1px solid var(--rule); border-radius: 0; padding: 8px 0; font-family: var(--mono); font-size: 0.76rem; font-weight: 300; box-shadow: none; }
.view[id^="view-admin"] .form-row input:focus,
.view[id^="view-admin"] .form-row select:focus,
.view[id^="view-admin"] .form-row textarea:focus { border-color: var(--red); box-shadow: none; }
.view[id^="view-admin"] .form-row select { appearance: none; -webkit-appearance: none; }
.view[id^="view-admin"] .form-row textarea { min-height: 0; height: 70px; resize: none; }
.view[id^="view-admin"] .btn-primary { min-height: 0; font-family: var(--mono); font-size: 0.68rem; font-weight: 500; letter-spacing: 0.1em; border-radius: 0; }
.view[id^="view-admin"] .btn-sm { display: inline-block; min-height: 0; font-family: var(--mono); font-size: 0.62rem; font-weight: 400; letter-spacing: 0.06em; padding: 5px 10px; border-radius: 0; }
.view[id^="view-admin"] .form-msg { font-family: var(--mono); font-size: 0.64rem; letter-spacing: 0.04em; line-height: normal; }

/* ── TABLE ── */
.tbl { width: 100%; border-collapse: collapse; margin-top: 4px; }
.tbl th { font-family: var(--mono); font-size: 0.58rem; font-weight: 300; color: var(--faint); letter-spacing: 0.14em; text-transform: uppercase; text-align: left; padding: 10px 0; border-bottom: 1px solid var(--rule); }
.tbl td { font-size: 0.82rem; font-weight: 300; color: var(--muted); padding: 12px 0; border-bottom: 1px solid var(--rule); vertical-align: middle; }
.tbl td strong { color: var(--ink); font-weight: 400; }
.tbl td:last-child { text-align: right; }
.tbl-actions { display: flex; gap: 6px; justify-content: flex-end; }
.reschedule-session-form { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.reschedule-session-form input[type="date"] { min-height: 32px; max-width: 145px; padding: 4px 6px; }
.class-change-panel { margin: 0 0 18px 76px; padding: 12px; border-left: 2px solid var(--rule); }
.class-change-panel h4 { margin: 0 0 6px; font-size: 0.9rem; font-weight: 500; }
.class-change-panel p { margin: 4px 0; color: var(--muted); font-size: 0.82rem; }
.class-change-form { display: grid; gap: 10px; max-width: 420px; margin-top: 12px; }
.class-change-form label { display: grid; gap: 6px; color: var(--muted); font-size: 0.82rem; }
.class-change-form select, .class-change-form textarea { width: 100%; }
.class-change-form textarea { min-height: 72px; }
.waitlist-panel { margin-top: 24px; padding: 16px; border: 1px solid var(--rule); }
.waitlist-panel > p { max-width: 560px; margin: -8px 0 12px; color: var(--muted); font-size: 0.84rem; line-height: 1.55; }
.waitlist-list { display: grid; gap: 8px; }
.waitlist-row { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 0; border-top: 1px solid var(--rule); }
.copy-class-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px; margin: 12px 0; padding: 14px; border: 1px solid var(--rule); }
.copy-class-form label { display: grid; gap: 6px; color: var(--muted); font-size: 0.78rem; }
.copy-class-form input { width: 100%; }
.copy-class-form p { grid-column: 1 / -1; margin: 0; }
.classmates-panel { margin: -8px 0 18px 76px; color: var(--muted); font-size: 0.82rem; }
.classmates-panel summary { cursor: pointer; color: var(--ink); }
.classmates-panel ul { columns: 2; margin: 8px 0; padding-left: 20px; }
.submission-file-label { display: block; color: var(--muted); font-size: 0.82rem; margin: 8px 0 5px; }
.submit-form input[type="file"] { display: block; width: 100%; margin-bottom: 10px; color: var(--muted); font-size: 0.82rem; }
.submission-receipt a { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
.field-hint { margin-top: 4px; color: var(--muted); font-size: 0.78rem; line-height: 1.5; }
.assignment-rubric { margin: 12px 0; color: var(--muted); font-size: 0.84rem; }
.assignment-rubric summary { cursor: pointer; color: var(--ink); }
.rubric-criteria, .rubric-scores { margin: 8px 0; padding-left: 20px; }
.rubric-score-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; grid-column: 1 / -1; }
.rubric-score-fields label { display: grid; gap: 5px; color: var(--muted); font-size: 0.78rem; }
.rubric-score-fields input { width: 100%; }
.grade-form input[readonly] { color: var(--muted); }
.late-submission-flag { margin: 6px 0; color: var(--red); font-size: 0.78rem; }
.feedback-question { display: inline-block; margin-top: 8px; color: var(--ink); font-size: 0.82rem; text-decoration: underline; text-underline-offset: 3px; }
.private-notes { display: grid; gap: 8px; margin: 12px 0; padding: 12px; border: 1px dashed var(--rule); }
.private-notes label { display: grid; gap: 6px; color: var(--muted); font-size: 0.78rem; }
.private-notes textarea { min-height: 76px; }
.due-reminders { margin: 20px 0; padding: 14px; border: 1px solid var(--rule); }
.due-reminder-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 0; border-top: 1px solid var(--rule); }
.notification-center { margin-top: 24px; border: 1px solid var(--rule); }
.notification-center > summary { cursor: pointer; padding: 12px; color: var(--ink); font-size: 0.84rem; }
.notification-list { display: grid; gap: 8px; padding: 0 10px 10px; }
.notification-item { padding: 10px; border-left: 2px solid var(--rule); background: rgba(23, 27, 24, 0.34); }
.notification-item.is-unread { border-left-color: var(--red); }
.notification-item h4 { margin: 4px 0; color: var(--ink); font-size: 0.88rem; font-weight: 500; }
.notification-item p { margin: 4px 0 8px; color: var(--muted); font-size: 0.8rem; line-height: 1.5; }
.notification-actions { display: flex; gap: 6px; }
.active-sessions-list { display: grid; gap: 8px; margin: 8px 0; }
.active-session-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--rule); }
.active-session-row > div { display: grid; gap: 4px; }
.active-session-row strong { color: var(--ink); font-size: 0.84rem; font-weight: 500; }
.active-session-row span { color: var(--muted); font-size: 0.78rem; }
.profile-photo-settings { display: grid; gap: 10px; margin: 20px 0; }
.profile-photo-settings label { color: var(--muted); font-size: 0.82rem; }
.profile-photo-settings input[type="file"] { color: var(--muted); font-size: 0.82rem; }
.profile-photo-preview, #profile-photo-preview { width: 88px; height: 88px; border-radius: 50%; object-fit: cover; border: 1px solid var(--rule); }
.profile-photo-actions { display: flex; gap: 8px; }
.classmate-person { display: flex; align-items: center; gap: 8px; break-inside: avoid; margin: 4px 0; }
.classmate-person img { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; }

/* ── ATTENDANCE TOGGLE ── */
.att-toggle { width: 36px; height: 20px; background: var(--rule); border-radius: 10px; position: relative; cursor: pointer; border: none; transition: background 0.2s; flex-shrink: 0; }
.att-toggle::after { content: ''; position: absolute; width: 14px; height: 14px; background: var(--muted); border-radius: 50%; top: 3px; left: 3px; transition: transform 0.2s, background 0.2s; }
.att-toggle.on { background: var(--green-dim); }
.att-toggle.on::after { transform: translateX(16px); background: var(--green); }

/* ── SETTINGS ── */
.settings-row { display: grid; grid-template-columns: 140px 1fr; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--rule); align-items: center; }
.settings-lbl { font-family: var(--mono); font-size: 0.62rem; font-weight: 300; color: var(--faint); letter-spacing: 0.1em; text-transform: uppercase; }
.settings-val { font-size: 0.88rem; font-weight: 300; }

/* ── CSV IMPORT ── */
.csv-preview { border: 1px solid var(--rule); margin-bottom: 16px; overflow-x: auto; }
.csv-preview table { width: 100%; border-collapse: collapse; }
.csv-preview th { font-family: var(--mono); font-size: 0.58rem; color: var(--faint); letter-spacing: 0.12em; text-transform: uppercase; padding: 10px 14px; border-bottom: 1px solid var(--rule); text-align: left; background: var(--surface); }
.csv-preview td { font-size: 0.8rem; font-weight: 300; color: var(--muted); padding: 10px 14px; border-bottom: 1px solid var(--rule); }
.csv-preview td strong { color: var(--ink); font-weight: 400; }
.csv-result-ok  { color: var(--green); }
.csv-result-err { color: var(--red); }
.csv-drop { border: 1px dashed var(--rule2); padding: 32px; text-align: center; cursor: pointer; transition: border-color 0.2s, background 0.2s; margin: 16px 0; }
.csv-drop:hover, .csv-drop.drag-over { border-color: var(--red); background: var(--red-dim); }
.csv-drop p { font-family: var(--mono); font-size: 0.72rem; font-weight: 300; color: var(--muted); line-height: 1.7; }
.csv-drop p strong { color: var(--ink); font-weight: 400; }

/* ── MODAL ── */
.modal-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,0.7); z-index: 500; display: none; align-items: center; justify-content: center; padding: 24px; }
.modal-backdrop.open { display: flex; }
.modal { background: var(--surface); border: 1px solid var(--rule); border-top: 2px solid var(--red); padding: 32px; width: 100%; max-width: 420px; }
.modal h3 { font-family: var(--serif); font-size: 1.2rem; font-weight: 400; margin-bottom: 6px; }
.modal p { font-size: 0.84rem; font-weight: 300; color: var(--muted); margin-bottom: 24px; line-height: 1.6; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 20px; }
.modal-cancel { font-family: var(--mono); font-size: 0.68rem; color: var(--muted); padding: 10px 16px; border: 1px solid var(--rule); background: transparent; cursor: pointer; transition: color 0.2s; }
.modal-cancel:hover { color: var(--ink); }

/* ── ASSIGNMENT CARDS ── */
.assign-card { border: 1px solid var(--rule); margin-bottom: 10px; transition: border-color 0.2s; }
.assign-card:hover { border-color: var(--rule2); }
.assign-inner { padding: 22px; display: grid; grid-template-columns: 1fr auto; gap: 16px; align-items: start; }
.assign-tag  { font-family: var(--mono); font-size: 0.58rem; font-weight: 300; color: var(--faint); letter-spacing: 0.14em; text-transform: uppercase; margin-bottom: 6px; }
.assign-title { font-family: var(--serif); font-size: 1.05rem; font-weight: 400; margin-bottom: 6px; }
.assign-desc  { font-size: 0.82rem; font-weight: 300; color: var(--muted); line-height: 1.6; margin-bottom: 14px; max-width: 600px; }
.assign-due   { font-family: var(--body); font-size: 0.86rem; font-weight: 500; color: var(--muted); }
.assign-due.overdue { color: var(--red); }

.submit-form { border-top: 1px solid var(--rule); padding-top: 16px; margin-top: 16px; }
.submit-form textarea { width: 100%; background: transparent; border: none; border-bottom: 1px solid var(--rule); color: var(--ink); padding: 10px 0; font-family: var(--mono); font-size: 0.76rem; font-weight: 300; outline: none; resize: none; height: 80px; transition: border-color 0.2s; }
.submit-form textarea:focus { border-bottom-color: var(--red); }
.submit-form textarea::placeholder { color: var(--faint); }
.submit-form input { width: 100%; background: transparent; border: none; border-bottom: 1px solid var(--rule); color: var(--ink); padding: 10px 0; font-family: var(--mono); font-size: 0.76rem; font-weight: 300; outline: none; transition: border-color 0.2s; margin-top: 10px; }
.submit-form input:focus { border-bottom-color: var(--red); }
.submit-form input::placeholder { color: var(--faint); }
.submit-actions { display: flex; align-items: center; gap: 12px; margin-top: 14px; }

.submission-box { background: var(--surface); border: 1px solid var(--rule); padding: 16px; margin-top: 14px; }
.submission-box .sb-label { font-family: var(--mono); font-size: 0.58rem; font-weight: 300; color: var(--faint); letter-spacing: 0.14em; text-transform: uppercase; margin-bottom: 8px; }
.submission-box .sb-content { font-size: 0.84rem; font-weight: 300; color: var(--ink); line-height: 1.65; }
.submission-box .sb-grade { font-family: var(--serif); font-size: 1.3rem; color: var(--green); margin-top: 10px; }
.submission-box .sb-feedback { font-size: 0.82rem; font-weight: 300; color: var(--muted); margin-top: 6px; line-height: 1.6; }
.submission-receipt { display: flex; flex-direction: column; gap: 3px; border-left: 3px solid var(--green); background: var(--green-dim); padding: 12px 14px; margin: 14px 22px 0; font-size: 0.84rem; line-height: 1.45; }
.submission-receipt strong { font-weight: 600; color: var(--ink); }
.submission-receipt span { color: var(--muted); }

.grade-form { border-top: 1px solid var(--rule); padding-top: 14px; margin-top: 14px; display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.grade-form input { background: transparent; border: none; border-bottom: 1px solid var(--rule); color: var(--ink); padding: 6px 0; font-family: var(--mono); font-size: 0.76rem; outline: none; width: 80px; }
.grade-form textarea { background: transparent; border: none; border-bottom: 1px solid var(--rule); color: var(--ink); padding: 6px 0; font-family: var(--mono); font-size: 0.76rem; outline: none; resize: none; height: 40px; flex: 1; min-width: 200px; }
.grade-form input::placeholder, .grade-form textarea::placeholder { color: var(--faint); }
.grade-form input:focus, .grade-form textarea:focus { border-bottom-color: var(--red); }

/* ── MOBILE NAV BAR ── */
.mobile-nav {
  display: none;
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: 60px;
  background: var(--surface);
  border-top: 1px solid var(--rule);
  z-index: 200;
  padding: 0 4px;
  align-items: stretch;
}

.mobile-nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  cursor: pointer;
  color: var(--faint);
  font-family: var(--mono);
  font-size: 0.52rem;
  font-weight: 300;
  letter-spacing: 0.06em;
  padding: 8px 4px;
  transition: color 0.15s;
  border: none;
  background: none;
  text-transform: lowercase;
  position: relative;
}

.mobile-nav-item .mni {
  font-size: 1.1rem;
  line-height: 1;
}

.mobile-nav-item.active { color: var(--ink); }
.mobile-nav-item.active::before {
  content: '';
  position: absolute;
  top: 0; left: 12px; right: 12px;
  height: 2px;
  background: var(--red);
}

.mobile-more-menu { display: none; }

/* ── RESPONSIVE ── */
@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .help-grid { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .mobile-nav { display: flex; }
  .mobile-more-menu:not([hidden]) {
    position: fixed;
    right: 12px;
    bottom: calc(68px + env(safe-area-inset-bottom));
    z-index: 210;
    display: grid;
    min-width: 190px;
    padding: 6px;
    border: 1px solid var(--rule2);
    border-radius: 10px;
    background: var(--surface);
    box-shadow: 0 16px 42px rgba(0, 0, 0, 0.42);
  }
  .mobile-more-menu button {
    padding: 12px 14px;
    border-radius: 6px;
    color: var(--ink);
    text-align: left;
    font-family: var(--mono);
    font-size: 0.68rem;
  }
  .mobile-more-menu button:hover, .mobile-more-menu button:focus-visible { background: var(--raised); }
  .content { padding: 24px 20px 80px; }
  .stat-strip, .admin-stats { grid-template-columns: 1fr 1fr; }
  .stat-cell:nth-child(even), .admin-stat:nth-child(even) { border-right: none; }
  .stat-cell:nth-child(n+3), .admin-stat:nth-child(n+3) { border-top: 1px solid var(--rule); }
  .two-col { grid-template-columns: 1fr; }
  .admin-grid { grid-template-columns: 1fr; }
  .topbar { padding: 0 16px; }
  .topbar-user { display: none; }
}

@media (max-width: 480px) {
  .stat-strip, .admin-stats { grid-template-columns: 1fr; }
  .stat-cell, .admin-stat { border-right: none; border-bottom: 1px solid var(--rule); }
  .sess-row { grid-template-columns: 70px 1fr; }
  .sess-row .sess-status { display: none; }
  .tbl td:nth-child(n+4) { display: none; }
  .tbl th:nth-child(n+4) { display: none; }
  .admin-cell { padding: 20px 16px; }
  .pg-hd h2 { font-size: 1.6rem; }
  .login-wrap { padding: 0 8px; }
}

/* Student dashboard refresh and shared accessibility polish */
:root {
  --bg: #101311;
  --surface: #171b18;
  --raised: #1e2420;
  --rule: #2a322d;
  --rule2: #3a4740;
  --ink: #f2f3ed;
  --muted: #a6b0a8;
  --faint: #859188;
  --red: #ed725d;
  --red-dim: rgba(237, 114, 93, 0.12);
  --green: #79c992;
  --green-dim: rgba(121, 201, 146, 0.12);
}

body {
  background:
    radial-gradient(ellipse at 78% -8%, rgba(121, 201, 146, 0.075), transparent 34rem),
    var(--bg);
}

:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 3px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.login-wrap {
  max-width: 420px;
  padding: 42px;
  border: 1px solid var(--rule);
  background: linear-gradient(145deg, rgba(30, 36, 32, 0.96), rgba(20, 24, 21, 0.94));
  box-shadow: 0 28px 100px rgba(0, 0, 0, 0.28);
}

.login-logo { margin-bottom: 44px; }
.login-wrap h1 { font-size: clamp(2.35rem, 7vw, 3rem); }
.field { margin-bottom: 8px; }
.field input { min-height: 48px; font-size: 0.84rem; }
.login-btn { min-height: 48px; }

.topbar { backdrop-filter: blur(18px); background: rgba(16, 19, 17, 0.94); }
.topbar-tag { margin-left: 2px; }
.content { width: 100%; max-width: 1500px; margin-inline: auto; }
.pg-hd { margin-bottom: 26px; }
.pg-hd h2 { letter-spacing: -0.025em; }
.stat-strip { border-radius: 10px; overflow: hidden; background: rgba(23, 27, 24, 0.65); }
.stat-cell { min-height: 102px; padding: 22px; }
.stat-val { font-size: 1.8rem; }
.dashboard-grid { grid-template-columns: minmax(0, 1fr) minmax(260px, 340px); gap: clamp(22px, 4vw, 48px); }
.dashboard-grid .sec-hd { margin-top: 0; }
.course-card, .assign-card, .next-card, .admin-cell {
  border-radius: 9px;
  background: linear-gradient(145deg, rgba(30, 36, 32, 0.72), rgba(23, 27, 24, 0.8));
}
.course-card { margin-bottom: 12px; }
.course-card:hover, .assign-card:hover { border-color: #526257; transform: translateY(-1px); }
.course-card, .assign-card { transition: border-color 0.2s, transform 0.2s; }
.cc-inner, .assign-inner { padding: 20px; }
.cc-name, .assign-title { line-height: 1.3; }
.badge { border-radius: 999px; white-space: nowrap; }
.next-card { padding: 20px; }
.next-card .nc-title { font-size: 1.2rem; line-height: 1.3; }
.ann { border: 1px solid var(--rule); border-left: 3px solid var(--red); border-radius: 7px; }
.ann-title { line-height: 1.4; }
.empty-state, .empty {
  padding: 22px;
  border: 1px dashed var(--rule2);
  border-radius: 8px;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.65;
}
.mat-row { padding: 17px 16px; border-radius: 7px; }
.mat-row:hover { background: var(--surface); }
.mat-row[aria-disabled="true"] { opacity: 0.55; pointer-events: none; }
.mat-type { margin-top: 3px; font-family: var(--mono); font-size: 0.62rem; color: var(--muted); }
.mat-arrow { font-size: 1rem; }
.sess-row { padding: 16px 12px; }
.sess-row:nth-child(even) { background: rgba(23, 27, 24, 0.42); }
.form-msg { line-height: 1.5; }
.mobile-nav { padding-bottom: env(safe-area-inset-bottom); height: calc(64px + env(safe-area-inset-bottom)); backdrop-filter: blur(18px); background: rgba(23, 27, 24, 0.96); }

@media (max-width: 900px) {
  .content { padding-top: 30px; }
  .dashboard-grid { grid-template-columns: 1fr; }
  .dashboard-grid aside { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 18px; }
  .dashboard-grid aside .sec-hd:first-child, .dashboard-grid aside .next-card { grid-column: 1 / -1; }
}

@media (max-width: 560px) {
  .topbar { padding: 0 14px; }
  .topbar-right { gap: 12px; }
  .topbar-right > a { display: none; }
  .topbar-brand { gap: 7px; }
  .login-wrap { max-width: 420px; padding: 28px 22px; }
  .content { padding: 22px 16px calc(88px + env(safe-area-inset-bottom)); }
  .pg-hd { margin-bottom: 20px; padding-bottom: 18px; }
  .pg-hd h2 { font-size: 1.75rem; }
  .stat-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat-cell { min-height: 86px; padding: 16px; border-bottom: 1px solid var(--rule); }
  .stat-cell:nth-child(2) { border-right: none; }
  .stat-val { font-size: 1.5rem; }
  .cc-inner, .assign-inner { padding: 16px; }
  .dashboard-grid aside { display: block; }
  .dashboard-grid aside .sec-hd { margin-top: 24px; }
  .dashboard-grid aside .sec-hd:first-child { margin-top: 0; }
  .sess-row { grid-template-columns: 78px minmax(0, 1fr); gap: 10px; }
  .sess-row .sess-status { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}
