/* Rhema LMS - single stylesheet, mobile-first, no build step.
   Theme: Calvary Leadership College (verde / mint). Palette + wordmark from
   the CLC brand guide (clc-graphic-assets.pdf). Colours live as tokens on
   :root; swap the values here to re-skin for another tenant. */

/* Plus Jakarta Sans - CLC wordmark typeface, self-hosted (no build, offline-ok).
   Variable weight 200-800; latin + latin-ext subsets from Google Fonts v12. */
@font-face {
  font-family: "Plus Jakarta Sans";
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url("../fonts/plus-jakarta-sans-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
    U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Plus Jakarta Sans";
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url("../fonts/plus-jakarta-sans-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF,
    U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020,
    U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  /* CLC brand core */
  --verde-900: #182d2b;   /* deep green - dark ground, nav rail, primary btn */
  --verde-800: #21403c;   /* hover on dark surfaces */
  --mint: #b2daa6;         /* light green - accent on dark, primary btn text */
  --mint-100: #e7f2e2;     /* faint mint - tag/well backgrounds */
  --cream: #e3d5c0;
  --navy: #0a2d3f;         /* brand navy - stat figures, headings on light */

  --ink: #1e2c2a;          /* body text (verde-tinted near-black) */
  --ink-soft: #5c6b68;     /* secondary text */
  --line: #e3ded3;         /* hairlines / borders (warm) */
  --bg: #f4f2ec;           /* page ground (warm paper) */
  --card: #ffffff;
  --navy-600: #12405a;

  --rail: var(--verde-900);
  --rail-ink: #c7d8c2;     /* mint-grey, readable on verde */

  --accent: #0e5994;       /* links / focus - CLC blue, AA on white */
  --accent-600: #0a4674;
  --danger: #a5382e;
  --danger-bg: #f7e7e5;
  --ok: #1f7a4d;
  --ok-bg: #e4f1e6;
  --info: #0e5994;
  --info-bg: #e4eef6;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(24, 45, 43, .06), 0 8px 24px rgba(24, 45, 43, .08);
  --font: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI",
    Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--bg);
}

h1 { font-size: 1.5rem; margin: 0 0 .75rem; }
h2 { font-size: 1.125rem; margin: 0 0 .5rem; }
a { color: var(--accent); }
.muted { color: var(--ink-soft); }

.brand {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}
.brand img { height: 24px; width: auto; display: block; }

.icon { width: 20px; height: 20px; flex: none; }

/* ---- App shell: persistent left nav rail (Blackboard Ultra style) ---- */
.app { min-height: 100vh; }
body.rail-locked { overflow: hidden; }

.rail {
  background: var(--rail);
  color: var(--rail-ink);
  display: flex;
  flex-direction: column;
}
.rail-brand {
  display: block;
  padding: 1.15rem 1.25rem;
  border-bottom: 1px solid rgba(255, 255, 255, .1);
}
.rail-brand img { height: 30px; width: auto; display: block; }

.rail-nav { flex: 1; display: flex; flex-direction: column; gap: 2px; padding: .6rem; }
.rail-link {
  display: flex;
  align-items: center;
  gap: .8rem;
  padding: .6rem .7rem;
  min-height: 44px;
  border-radius: 8px;
  color: var(--rail-ink);
  text-decoration: none;
  font-size: .925rem;
}
.rail-link .icon { opacity: .85; }
.rail-link:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.rail-link.active { background: rgba(255, 255, 255, .14); color: #fff; font-weight: 600; }
.rail-link.is-disabled { opacity: .38; cursor: default; }
.rail-group {
  padding: 1rem .8rem .3rem;
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: #83a97c;
}
.rail-foot {
  padding: .9rem 1.1rem 1.1rem;
  border-top: 1px solid rgba(255, 255, 255, .09);
}
.rail-foot .who { color: #fff; font-size: .92rem; font-weight: 600; }
.rail-foot .role { color: #83a97c; font-size: .78rem; text-transform: capitalize; margin-bottom: .4rem; }
.rail-foot a { color: var(--mint); font-size: .86rem; text-decoration: none; }
.rail-foot a:hover { text-decoration: underline; }

.topbar-mobile {
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: .5rem .8rem;
  background: var(--rail);
  color: #fff;
  position: sticky;
  top: 0;
  z-index: 30;
}
.rail-toggle {
  display: inline-flex;
  width: 40px;
  height: 40px;
  padding: 8px;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, .25);
  border-radius: 8px;
  color: #fff;
  cursor: pointer;
}
.rail-toggle svg { width: 20px; height: 20px; }
.scrim { position: fixed; inset: 0; background: rgba(0, 0, 0, .45); z-index: 40; }

/* Mobile: rail is an off-canvas drawer. */
@media (max-width: 959px) {
  .rail {
    position: fixed;
    inset: 0 auto 0 0;
    width: 270px;
    max-width: 82vw;
    z-index: 50;
    transform: translateX(-100%);
    transition: transform .2s ease;
  }
  .rail.open { transform: none; }
}

/* Desktop: fixed two-column layout, rail always visible. */
@media (min-width: 960px) {
  .app { display: grid; grid-template-columns: 256px 1fr; }
  .topbar-mobile, .scrim { display: none; }
  .rail { position: sticky; top: 0; height: 100vh; }
  .app-main { min-width: 0; }
}

/* ---- Layout ---- */
.container {
  max-width: 1180px;
  margin: 0 auto;
  padding: 1.5rem 1.25rem 4rem;
}
@media (min-width: 960px) { .container { padding: 2rem 2.25rem 4rem; } }

.page-head { margin-bottom: 1.25rem; }
.page-head h1 { margin-bottom: .2rem; }

.grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: 1fr;
}
@media (min-width: 720px) {
  .grid { grid-template-columns: repeat(3, 1fr); }
}

/* ---- Cards ---- */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.25rem;
}
.auth-card {
  max-width: 400px;
  margin: 2rem auto;
}
/* a collapsible card standing on its own needs space before what follows it */
details.card { margin-bottom: 1.25rem; }
details.card > summary { cursor: pointer; }
.auth-logo { display: block; width: 132px; height: auto; margin: .25rem auto 1.25rem; }

.hero {
  text-align: center;
  padding: 3rem 1rem;
}
.hero h1 { font-size: 1.9rem; }
.hero-logo { display: block; width: 200px; max-width: 60vw; height: auto; margin: 0 auto 1.25rem; }

/* ---- Stat cards ---- */
.stat-grid { grid-template-columns: repeat(2, 1fr); }
@media (min-width: 720px) {
  .stat-grid { grid-template-columns: repeat(3, 1fr); }
}
.stat { text-align: center; padding: 1rem; }
.stat-value { font-size: 1.9rem; font-weight: 700; color: var(--navy); }
.stat-label { color: var(--ink-soft); text-transform: capitalize; font-size: .9rem; }

/* ---- Forms ---- */
.stack { display: flex; flex-direction: column; gap: 1rem; }
label {
  display: flex;
  flex-direction: column;
  gap: .35rem;
  font-weight: 600;
  font-size: .9rem;
}
input[type="email"],
input[type="password"],
input[type="text"],
input[type="tel"],
input[type="url"],
input[type="time"],
input[type="date"],
input[type="datetime-local"],
input[type="number"],
select,
textarea {
  font: inherit;
  padding: .7rem .8rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  min-height: 44px;
  width: 100%;
}
textarea { min-height: 88px; resize: vertical; }
input:focus,
select:focus,
textarea:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
  border-color: var(--accent);
}
label.check {
  flex-direction: row;
  align-items: center;
  gap: .5rem;
  font-weight: 500;
}
label.check input { min-height: 0; width: auto; }
.field-row { display: flex; flex-wrap: wrap; gap: 1rem; }
.field-row > label { flex: 1 1 12rem; }

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin: 1.75rem 0 .6rem;
}
.section-head h2 { margin: 0; }

/* ---- Enrolment list (person detail) ---- */
.enrol-list { list-style: none; margin: 0; padding: 0; }
.enrol-list li {
  display: flex;
  gap: 1rem;
  align-items: start;
  justify-content: space-between;
  padding: .65rem 0;
  border-bottom: 1px solid var(--line);
}
.enrol-list li:last-child { border-bottom: 0; padding-bottom: 0; }
.enrol-list__main { min-width: 0; }
.enrol-list__main a { font-weight: 600; }
.enrol-list__meta { font-size: .85rem; margin-top: .15rem; }
.enrol-list form { flex: none; }

/* ---- Key / value list ---- */
.kv { margin: .25rem 0 .5rem; display: grid; gap: .35rem; }
.kv > div { display: flex; gap: .75rem; font-size: .92rem; }
.kv dt { flex: 0 0 9rem; color: var(--ink-soft); margin: 0; }
.kv dd { margin: 0; }

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  min-height: 44px;
  padding: .65rem 1.1rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}
.btn:hover { background: #efece3; }
.btn-primary {
  background: var(--verde-900);
  border-color: var(--verde-900);
  color: var(--mint);
}
.btn-primary:hover { background: var(--verde-800); border-color: var(--verde-800); }
.btn-microsoft {
  width: 100%;
  background: #fff;
  border-color: #8c8c8c;
}

.divider {
  display: flex;
  align-items: center;
  text-align: center;
  color: var(--ink-soft);
  font-size: .85rem;
  margin: .25rem 0;
}
.divider::before,
.divider::after {
  content: "";
  flex: 1;
  border-bottom: 1px solid var(--line);
}
.divider span { padding: 0 .75rem; }

/* ---- Flash messages ---- */
.flashes { display: flex; flex-direction: column; gap: .5rem; margin-bottom: 1rem; }
.flash {
  padding: .7rem .9rem;
  border-radius: 10px;
  border: 1px solid transparent;
  font-size: .92rem;
}
.flash-error { background: var(--danger-bg); border-color: #e6c3bf; color: var(--danger); }
.flash-info { background: var(--info-bg); border-color: #bcd4e6; color: var(--info); }
.flash-success { background: var(--ok-bg); border-color: #c2e0c9; color: var(--ok); }

/* ---- Tables ---- */
.table-wrap { overflow-x: auto; }
.table {
  width: 100%;
  border-collapse: collapse;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.table th,
.table td {
  text-align: left;
  padding: .7rem .85rem;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.table th {
  background: #efece3;
  font-size: .82rem;
  text-transform: uppercase;
  letter-spacing: .4px;
  color: var(--ink-soft);
}
.table tr:last-child td { border-bottom: none; }

/* ---- CSV import ---- */
.btn-row { display: flex; flex-wrap: wrap; gap: .6rem; }
.tag {
  display: inline-block;
  padding: .15rem .55rem;
  border-radius: 999px;
  font-size: .78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .3px;
  border: 1px solid transparent;
}
.tag-create { background: var(--ok-bg); color: var(--ok); border-color: #c2e0c9; }
.tag-update { background: var(--info-bg); color: var(--info); border-color: #bcd4e6; }
.tag-skip { background: #efece3; color: var(--ink-soft); border-color: var(--line); }
.tag-error { background: var(--danger-bg); color: var(--danger); border-color: #e6c3bf; }

/* ---- Activity Stream (dashboard) ---- */
.stream-layout { display: grid; gap: 1.5rem; grid-template-columns: 1fr; }
@media (min-width: 1000px) {
  .stream-layout { grid-template-columns: minmax(0, 1fr) 320px; align-items: start; }
}
/* stacked cards/sections in either column get their own vertical rhythm */
.stream-layout > aside,
.stream-layout > .stack { display: flex; flex-direction: column; gap: 1.25rem; }

/* Dashboard greeting + stat row */
.dash-hello { margin-bottom: 1.4rem; }
.dash-hello h1 { font-size: clamp(1.6rem, 1.2rem + 1.8vw, 2.15rem); margin: 0 0 .25rem; }
.dash-hello p { margin: 0; font-size: .95rem; }
.dash-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1rem;
  margin-bottom: 1.9rem;
}
.dash-stats .stat { padding: 1.1rem 1rem; }
.dash-stats a.stat { text-decoration: none; color: inherit; transition: transform .12s ease, box-shadow .12s ease; }
.dash-stats a.stat:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(24, 45, 43, .1); }
.dash-stats .stat-value { color: var(--navy); }

.stream-group { margin-bottom: 0; }
.stream-group > h2 {
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--ink-soft);
  margin-bottom: .6rem;
}
.stream-empty {
  color: var(--ink-soft);
  font-size: .92rem;
  padding: .3rem 0;
  margin: 0;
}
.stream-item {
  display: flex;
  gap: .9rem;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: .9rem 1rem;
  margin-bottom: .6rem;
}
.stream-item__bar {
  flex: none;
  width: 4px;
  border-radius: 4px;
  background: var(--course, var(--accent));
}
.stream-item__body { min-width: 0; }
.stream-item__body p { margin: .3rem 0; }
.stream-item__body time { font-size: .82rem; }

.course-pill, .dot { --course: var(--accent); }
.course-pill {
  display: inline-block;
  padding: .1rem .5rem;
  border-radius: 999px;
  font-size: .76rem;
  font-weight: 700;
  color: #fff;
  background: var(--course);
}
.dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--course);
  margin-right: .5rem;
}

.da-list { list-style: none; padding: 0; margin: .3rem 0; }
.da-list li {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: .5rem;
  padding: .35rem 0;
  border-bottom: 1px solid var(--line);
  font-size: .9rem;
}
.da-list li:last-child { border-bottom: none; }
.da-list a { text-decoration: none; }
.da-num { font-weight: 700; }

.mini-course-list { list-style: none; padding: 0; margin: 0 0 .75rem; }
.mini-course-list li { padding: .35rem 0; border-bottom: 1px solid var(--line); font-size: .9rem; }
.mini-course-list li:last-child { border-bottom: none; }
.mini-course-list a { text-decoration: none; color: var(--ink); display: flex; align-items: center; }
.mini-course-list a:hover { color: var(--accent); }

.btn-quiet {
  padding: .4rem .7rem;
  min-height: 0;
  font-size: .85rem;
  font-weight: 600;
}

/* ---- Top app bar with universal search ---- */
.appbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: 1fr minmax(0, 540px) 1fr;
  align-items: center;
  gap: .6rem;
  padding: .6rem 1.25rem;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(180%) blur(6px);
  border-bottom: 1px solid var(--line);
}
@media (min-width: 960px) { .appbar { padding: .7rem 2.25rem; } }
@media (max-width: 959px) {
  .appbar { position: static; grid-template-columns: 1fr auto; }
  .appbar > div:first-child { display: none; }
}

/* notification bell */
.bell-wrap { position: relative; justify-self: end; }
.bell {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--card);
  color: var(--ink);
  cursor: pointer;
}
.bell:hover { background: #efece3; }
.bell svg { width: 19px; height: 19px; }
.bell-badge {
  position: absolute;
  top: -3px;
  right: -3px;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--danger);
  color: #fff;
  font-size: .68rem;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
}
.bell-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  width: min(360px, 88vw);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow);
  overflow: hidden;
  z-index: 40;
}
.bell-menu__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .6rem .8rem;
  border-bottom: 1px solid var(--line);
  font-weight: 700;
  font-size: .9rem;
}
.bell-menu__head button {
  background: none;
  border: 0;
  color: var(--accent);
  font: inherit;
  font-size: .82rem;
  cursor: pointer;
}
.bell-menu__list { max-height: min(60vh, 420px); overflow-y: auto; }
.bell-item {
  display: block;
  padding: .6rem .8rem;
  border-bottom: 1px solid var(--line);
  text-decoration: none;
  color: var(--ink);
  font-size: .88rem;
}
.bell-item:last-child { border-bottom: 0; }
.bell-item:hover { background: var(--mint-100); }
.bell-item.is-unread { background: color-mix(in srgb, var(--mint-100) 60%, transparent); }
.bell-item time { display: block; color: var(--ink-soft); font-size: .78rem; margin-top: .15rem; }
.bell-menu__foot { padding: .55rem .8rem; text-align: center; border-top: 1px solid var(--line); }
.bell-menu__foot a { font-size: .84rem; text-decoration: none; }
.bell-empty { padding: 1.2rem .8rem; text-align: center; color: var(--ink-soft); font-size: .88rem; }

/* notifications page */
.notif-list { list-style: none; margin: 0; padding: 0; }
.notif-list li { border-bottom: 1px solid var(--line); }
.notif-list li:last-child { border-bottom: 0; }
.notif-list a {
  display: flex;
  gap: .7rem;
  padding: .85rem 1rem;
  text-decoration: none;
  color: var(--ink);
}
.notif-list a:hover { background: var(--mint-100); }
.notif-dot { flex: none; width: 8px; height: 8px; border-radius: 50%; margin-top: .5rem; background: transparent; }
.notif-list li.is-unread .notif-dot { background: var(--accent); }
.notif-body { min-width: 0; }
.notif-body time { display: block; font-size: .8rem; margin-top: .15rem; }
.appsearch {
  display: flex;
  align-items: center;
  gap: .5rem;
  width: 100%;
  max-width: 540px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: .35rem .9rem;
}
.appsearch:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(14, 89, 148, .12); }
.appsearch svg { width: 17px; height: 17px; color: var(--ink-soft); flex: none; }
.appsearch input {
  border: 0;
  outline: 0;
  background: transparent;
  font: inherit;
  width: 100%;
  color: var(--ink);
}
.appsearch-wrap { position: relative; width: 100%; max-width: 540px; }
.appsearch-wrap .appsearch { max-width: none; }
.ac-menu {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 6px);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow);
  padding: .3rem;
  z-index: 40;
  max-height: min(60vh, 420px);
  overflow-y: auto;
}
.ac-group {
  padding: .4rem .6rem .2rem;
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.ac-item {
  display: block;
  padding: .45rem .6rem;
  border-radius: 8px;
  text-decoration: none;
  color: var(--ink);
}
.ac-item small { display: block; color: var(--ink-soft); font-size: .8rem; }
.ac-item:hover,
.ac-item.is-active { background: var(--mint-100); }
.ac-empty { padding: .6rem; color: var(--ink-soft); font-size: .9rem; }

/* ---- Calendar ---- */
.cal-monthbar {
  display: flex;
  align-items: center;
  gap: .6rem;
  margin: 0 0 .8rem;
}
.cal-monthbar strong { font-size: 1.05rem; }
.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.cal-head {
  background: var(--card);
  padding: .4rem .5rem;
  font-size: .74rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--ink-soft);
  text-align: center;
}
.cal-cell {
  background: var(--card);
  min-height: 96px;
  padding: .3rem .35rem .4rem;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.cal-cell.cal-out { background: var(--bg); }
.cal-cell.cal-today { outline: 2px solid var(--accent); outline-offset: -2px; }
.cal-daynum { font-size: .78rem; font-weight: 700; color: var(--ink-soft); }
.cal-today .cal-daynum { color: var(--accent); }
.cal-chip {
  display: block;
  font-size: .74rem;
  line-height: 1.25;
  padding: .1rem .35rem;
  border-radius: 5px;
  text-decoration: none;
  color: #fff;
  background: var(--ink-soft);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cal-chip .cal-t { opacity: .8; font-variant-numeric: tabular-nums; }
.cal-chip .muted { color: rgba(255, 255, 255, .75); }
.cal-due     { background: var(--danger); }
.cal-lecture { background: var(--accent); }
.cal-key_date{ background: #7a4326; }
.cal-personal{ background: var(--navy); }
@media (max-width: 640px) {
  .cal-cell { min-height: 64px; }
  .cal-chip { font-size: .68rem; }
}

/* ---- Course cards ---- */
.course-grid {
  display: grid;
  gap: 1.1rem;
  grid-template-columns: 1fr;
}
@media (min-width: 560px) { .course-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 960px) { .course-grid { grid-template-columns: repeat(3, 1fr); } }

.course-card {
  display: flex;
  flex-direction: column;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  text-decoration: none;
  color: var(--ink);
  box-shadow: var(--shadow);
  transition: transform .12s ease, box-shadow .12s ease;
}
.course-card:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(16, 24, 40, .12); }
.course-card__banner {
  height: 96px;
  background: var(--course, var(--accent));
  display: flex;
  align-items: flex-end;
  padding: .7rem .9rem;
}
.course-card__code {
  color: #fff;
  font-weight: 700;
  font-size: .82rem;
  letter-spacing: .04em;
  background: rgba(0, 0, 0, .22);
  padding: .15rem .5rem;
  border-radius: 6px;
}
.course-card__body { padding: .9rem 1rem 1.1rem; }
.course-card__body h2 { font-size: 1rem; margin-bottom: .25rem; }
.course-card__meta { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .7rem; }

.role-badge {
  display: inline-block;
  padding: .12rem .55rem;
  border-radius: 999px;
  font-size: .75rem;
  font-weight: 700;
  text-transform: capitalize;
  background: #efece3;
  color: var(--ink-soft);
  border: 1px solid var(--line);
}
.role-teacher { background: var(--info-bg); color: var(--info); border-color: #bcd4e6; }
.role-student { background: var(--ok-bg); color: var(--ok); border-color: #c2e0c9; }

.course-hero {
  border-radius: var(--radius);
  padding: 1.5rem 1.6rem;
  background: var(--course, var(--accent));
  color: #fff;
  margin-bottom: 1.5rem;
}
.course-hero__code {
  display: inline-block;
  font-weight: 700;
  font-size: .8rem;
  letter-spacing: .05em;
  background: rgba(0, 0, 0, .22);
  padding: .15rem .55rem;
  border-radius: 6px;
  margin-bottom: .5rem;
}
.course-hero h1 { color: #fff; margin: 0 0 .3rem; }
.course-hero p { margin: 0; opacity: .9; font-size: .9rem; }

/* ---- Breadcrumb ---- */
.crumbs { font-size: .85rem; color: var(--ink-soft); margin-bottom: .75rem; }
.crumbs a { color: var(--ink-soft); text-decoration: none; }
.crumbs a:hover { color: var(--accent); }
.crumbs__sep { margin: 0 .4rem; opacity: .55; }

/* ---- In-course nav ---- */
.course-nav {
  display: flex;
  gap: .25rem;
  margin: -0.5rem 0 1.25rem;
  border-bottom: 1px solid var(--line);
}
.course-nav a {
  padding: .6rem .9rem;
  text-decoration: none;
  color: var(--ink-soft);
  font-weight: 600;
  font-size: .92rem;
  border-bottom: 2px solid transparent;
}
.course-nav a:hover { color: var(--ink); }
.course-nav a.active { color: var(--accent); border-bottom-color: var(--accent); }

.cat-row {
  display: flex;
  align-items: center;
  gap: .75rem;
  flex-wrap: wrap;
  padding: .5rem 0;
  border-bottom: 1px solid var(--line);
}
.cat-row:last-of-type { border-bottom: none; }
.cat-edit { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.cat-edit input[type="text"] { max-width: 12rem; }

/* ---- Rubrics ---- */
.rubric-grid { display: flex; flex-direction: column; gap: .9rem; }
.rubric-crit {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: .8rem .9rem;
}
.rubric-crit__head { margin-bottom: .5rem; }
.rubric-levels { display: flex; flex-wrap: wrap; gap: .5rem; }
.rubric-level {
  flex: 1 1 9rem;
  min-width: 9rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: .5rem .6rem;
  font-size: .88rem;
}
.rubric-level__pts {
  display: inline-block;
  background: #efece3;
  color: var(--ink-soft);
  font-weight: 700;
  border-radius: 6px;
  padding: 0 .4rem;
  margin-bottom: .2rem;
}

/* builder */
.crit .crit-title { font-weight: 600; max-width: 22rem; }
.crit .crit-desc { width: 100%; }
.lvl { flex: 1 1 12rem; min-width: 11rem; }
.lvl-row { display: flex; gap: .4rem; align-items: center; }
.lvl-row .lvl-title { flex: 1; }
.lvl-row .lvl-points { width: 4.5rem; }
.lvl .lvl-desc { width: 100%; margin-top: .3rem; font-size: .85rem; }
.rubric-level.is-picked, .lvl.is-picked { outline: 2px solid var(--accent); border-radius: 8px; }

/* grading grid */
.grade-grid fieldset {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: .8rem .9rem;
  margin: 0 0 .9rem;
}
.grade-grid legend { padding: 0 .3rem; }
.grade-grid .rubric-level { cursor: pointer; display: block; }
.grade-grid .rubric-level input[type="radio"] { position: absolute; opacity: 0; }
.grade-grid .rubric-level:hover { border-color: var(--accent); }

.grade-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: .5rem .8rem;
  margin-bottom: 1rem;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: .9rem;
}
.grade-nav a { text-decoration: none; font-weight: 600; }

/* student assessment task list */
.task-list { list-style: none; padding: 0; margin: 0; }
.task {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding: .8rem 1rem;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  margin-bottom: .6rem;
}
.task__title { font-weight: 600; text-decoration: none; color: var(--ink); }
.task__title:hover { color: var(--accent); }
.task__meta { display: block; font-size: .85rem; color: var(--ink-soft); margin-top: .15rem; }
.task__due.due-soon { color: var(--info); font-weight: 600; }
.task__due.overdue { color: var(--danger); font-weight: 600; }
.task__due.closed { color: var(--ink-soft); }
.task__status {
  font-size: .82rem;
  font-weight: 700;
  padding: .2rem .6rem;
  border-radius: 999px;
  white-space: nowrap;
  background: #efece3;
  color: var(--ink-soft);
}
.task__status.status-ok { background: var(--ok-bg); color: var(--ok); }
.task__status.status-sub { background: var(--info-bg); color: var(--info); }
.task__status.status-muted { background: transparent; color: var(--ink-soft); font-weight: 500; }

/* gradebook */
.gradebook th, .gradebook td { white-space: normal; vertical-align: top; }
.gradebook th { min-width: 5.5rem; }
.gradebook td:first-child, .gradebook th:first-child {
  white-space: nowrap;
  position: sticky;
  left: 0;
  z-index: 2;
  box-shadow: 1px 0 0 var(--line);
}
.gradebook td:first-child { background: var(--card); }
.gradebook th:first-child { background: #efece3; }
.gradebook .gb-final { font-weight: 700; background: #eef3ea; }
.gradebook .gb-draft { font-style: italic; color: var(--ink-soft); }

/* ---- Course content ---- */
.editbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: .6rem .9rem;
  background: var(--info-bg);
  border: 1px solid #bcd4e6;
  border-radius: 10px;
  margin-bottom: 1rem;
  font-size: .88rem;
}
.module {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
  margin-bottom: 1rem;
}
.module-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}
.module-head h2 { margin: 0; display: flex; align-items: center; gap: .5rem; }

.item-list { list-style: none; padding: 0; margin: .6rem 0 0; }
.item-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding: .5rem 0;
  border-top: 1px solid var(--line);
}
.item-list .item-row:first-child { border-top: none; }
.item-link { text-decoration: none; color: var(--ink); font-weight: 600; }
.item-link:hover { color: var(--accent); }
.item-kind {
  display: inline-block;
  min-width: 3.2rem;
  margin-right: .6rem;
  padding: .05rem .45rem;
  border-radius: 6px;
  background: #efece3;
  color: var(--ink-soft);
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  text-align: center;
}
.rowbtns { display: flex; align-items: center; gap: .3rem; flex-wrap: wrap; }
.inline-form { display: inline; }
.linkbtn {
  background: none;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: .2rem .5rem;
  font: inherit;
  font-size: .8rem;
  color: var(--ink-soft);
  cursor: pointer;
  min-height: 0;
}
.linkbtn:hover { background: #efece3; color: var(--ink); }
.add-item { margin-top: .7rem; font-size: .85rem; color: var(--ink-soft); }
.add-item a { margin-left: .5rem; }

.prose { line-height: 1.65; }
.prose h1, .prose h2, .prose h3 { margin: 1.2em 0 .4em; }
.prose h1:first-child, .prose h2:first-child { margin-top: 0; }
.prose p, .prose ul, .prose ol, .prose pre, .prose table { margin: 0 0 1em; }
.prose ul, .prose ol { padding-left: 1.4em; }
.prose code {
  background: #efece3;
  padding: .1em .35em;
  border-radius: 4px;
  font-size: .92em;
}
.prose pre {
  background: var(--verde-900);
  color: #e8efe4;
  padding: .9rem 1rem;
  border-radius: 8px;
  overflow-x: auto;
}
.prose pre code { background: none; padding: 0; color: inherit; }
.prose table { border-collapse: collapse; }
.prose th, .prose td { border: 1px solid var(--line); padding: .4rem .6rem; }
.prose blockquote {
  margin: 0 0 1em;
  padding-left: 1rem;
  border-left: 3px solid var(--line);
  color: var(--ink-soft);
}

.embed-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
  border-radius: var(--radius);
  overflow: hidden;
}
.embed-wrap iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}
