:root {
  --ink: #17211d;
  --muted: #68746d;
  --line: #d7ddd6;
  --paper: #fbfbf7;
  --panel: #ffffff;
  --soft: #edf4ef;
  --accent: #276b57;
  --accent-2: #b16b36;
  --danger: #9b2f2f;
  --shadow: 0 18px 40px rgba(23, 33, 29, 0.08);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--paper);
}
a { color: inherit; }
button, input, textarea, select { font: inherit; }

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 250px 1fr;
}
.sidebar {
  border-right: 1px solid var(--line);
  background: #f5f7f2;
  padding: 24px 18px;
  position: sticky;
  top: 0;
  height: 100vh;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  font-size: 13px;
  margin-bottom: 30px;
}
.brand-mark {
  width: 26px;
  height: 26px;
  border: 2px solid var(--ink);
  border-radius: 50% 50% 50% 0;
  transform: rotate(-15deg);
  display: inline-block;
}
.nav-stack {
  display: grid;
  gap: 6px;
}
.nav-stack a, .nav-stack button {
  border: 0;
  background: transparent;
  text-align: left;
  padding: 11px 12px;
  border-radius: 6px;
  text-decoration: none;
  color: var(--muted);
  cursor: pointer;
}
.nav-stack a.active, .nav-stack a:hover, .nav-stack button:hover {
  background: var(--soft);
  color: var(--ink);
}
.main {
  padding: 30px;
  max-width: 1180px;
  width: 100%;
}
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
  margin-bottom: 24px;
}
.eyebrow {
  color: var(--accent);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .12em;
  font-weight: 800;
}
h1, h2, h3 { margin: 0; line-height: 1.05; letter-spacing: 0; }
h1 { font-size: 42px; max-width: 720px; }
h2 { font-size: 24px; }
h3 { font-size: 18px; }
p { color: var(--muted); line-height: 1.65; }
.grid {
  display: grid;
  gap: 16px;
}
.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  box-shadow: var(--shadow);
}
.card.tight { padding: 14px; box-shadow: none; }
.stat {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}
.stat strong { font-size: 28px; }
.section-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
}
.section-row select {
  width: auto;
  min-width: 132px;
  border: 1px solid var(--line);
  border-radius: 6px;
  min-height: 42px;
  padding: 9px 12px;
  background: #fff;
  color: var(--ink);
}
.metric-card {
  display: grid;
  gap: 8px;
}
.metric-card span,
.metric-line span {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0;
  font-weight: 800;
}
.metric-card strong { font-size: 24px; }
.metric-stack {
  display: grid;
  gap: 12px;
}
.metric-line {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  border-bottom: 1px solid var(--line);
  padding-bottom: 10px;
}
.metric-line a,
.metric-line strong {
  overflow-wrap: anywhere;
  text-align: right;
}
.bar-list {
  display: grid;
  gap: 10px;
}
.bar-row {
  display: grid;
  grid-template-columns: 90px 1fr 42px;
  gap: 10px;
  align-items: center;
  font-size: 13px;
}
.bar-label { color: var(--muted); }
.bar-track {
  height: 8px;
  background: #e3e7e1;
  border-radius: 999px;
  overflow: hidden;
}
.bar-track span {
  display: block;
  height: 100%;
  background: var(--accent-2);
}
.check-list {
  display: grid;
  gap: 10px;
}
.check-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  display: grid;
  gap: 6px;
}
.check-item span {
  color: var(--accent);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0;
  font-weight: 800;
}
.check-item.waiting_for_seneca_token span,
.check-item.seneca_google_required span { color: var(--accent-2); }
.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 10px 15px;
  border-radius: 6px;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: #fff;
  text-decoration: none;
  cursor: pointer;
  font-weight: 700;
}
.btn.secondary {
  background: #fff;
  color: var(--ink);
  border-color: var(--line);
}
.btn.warn {
  background: var(--danger);
  border-color: var(--danger);
}
.btn:disabled { opacity: .55; cursor: wait; }
.form {
  display: grid;
  gap: 14px;
}
.field {
  display: grid;
  gap: 7px;
}
.field label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .08em;
  font-weight: 800;
  color: var(--muted);
}
.field input, .field textarea, .field select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  min-height: 44px;
  padding: 11px 12px;
  background: #fff;
  color: var(--ink);
}
.field textarea { min-height: 110px; resize: vertical; }
.auth-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}
.auth-card {
  width: min(100%, 430px);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 26px;
  box-shadow: var(--shadow);
}
.policy-card {
  width: min(100%, 780px);
}
.policy-card h2 {
  font-size: 20px;
  margin-top: 24px;
}
.program-list, .module-list, .post-list { display: grid; gap: 14px; }
.program-card {
  display: grid;
  gap: 12px;
  cursor: pointer;
}
.progress-bar {
  height: 8px;
  background: #e3e7e1;
  border-radius: 999px;
  overflow: hidden;
}
.progress-bar span {
  display: block;
  height: 100%;
  width: 0;
  background: var(--accent);
}
.lesson {
  border-top: 1px solid var(--line);
  padding: 14px 0;
}
.lesson:last-child { padding-bottom: 0; }
.lesson-body {
  white-space: pre-wrap;
  color: var(--ink);
}
.pill {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  min-height: 30px;
  padding: 5px 10px;
  font-size: 12px;
  color: var(--muted);
  background: #fff;
}
.tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.tab {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--muted);
  border-radius: 999px;
  padding: 8px 12px;
  cursor: pointer;
}
.tab.active {
  color: #fff;
  background: var(--accent);
  border-color: var(--accent);
}
.post-meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 13px;
}
.message {
  border-radius: 6px;
  padding: 12px 14px;
  background: var(--soft);
  color: var(--ink);
}
.message.error { background: #f8e8e4; color: var(--danger); }
.split {
  display: grid;
  grid-template-columns: 1.1fr .9fr;
  gap: 18px;
  align-items: start;
}
.table-wrap { overflow-x: auto; }
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
th, td {
  text-align: left;
  border-bottom: 1px solid var(--line);
  padding: 10px 8px;
  vertical-align: top;
}
th { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .08em; }
.hidden { display: none !important; }
.mt-12 { margin-top: 12px; }
.mt-14 { margin-top: 14px; }
.mt-16 { margin-top: 16px; }
.mt-18 { margin-top: 18px; }
.mt-20 { margin-top: 20px; }
.progress-fill { width: 0; }

@media (max-width: 860px) {
  .app-shell { display: block; }
  .sidebar {
    position: static;
    height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .nav-stack { grid-template-columns: repeat(auto-fit, minmax(86px, 1fr)); }
  .nav-stack a, .nav-stack button { text-align: center; padding: 9px 6px; font-size: 13px; }
  .main { padding: 20px; }
  h1 { font-size: 32px; }
  .grid.two, .grid.three, .grid.four, .split { grid-template-columns: 1fr; }
  .topbar, .section-row { display: grid; }
  .metric-line { display: grid; }
  .metric-line a, .metric-line strong { text-align: left; }
}
