/* SEVEN HOUSE Portal — an app, not a brochure: sidebar, cards, tables. */

:root {
  --ink: #141414;
  --ink-soft: #3b3b3b;
  --muted: #6f6f6f;
  --faint: #767676;
  --line: #e7e5e1;
  --line-strong: #d6d3cd;
  --rule: var(--line);
  --rule-strong: var(--line-strong);
  --bg: #f6f5f2;
  --card: #ffffff;
  --side: #ffffff;
  --hover: #f1efeb;
  --accent: #141414;
  --cream: #f4eee9;
  --cream-line: #e5d7ca;
  --olive: #5f5e36;
  --ok-bg: #eef3e6;
  --ok: #3f5a1f;
  --warn-bg: #fbf1e3;
  --warn: #8a5a1b;
  --bad-bg: #fbeceb;
  --bad: #8f2a24;
  --info-bg: #eceff6;
  --info: #334a7a;
  --radius: 10px;
  --radius-sm: 7px;
  --side-w: 248px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Acumin Pro", "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }
button { font: inherit; }

/* ---------- type ---------- */

h1 { font-size: 22px; font-weight: 700; margin: 0; letter-spacing: -0.005em; }
h2 { font-size: 16px; font-weight: 700; margin: 0; }
h3 { font-size: 13px; font-weight: 700; margin: 0; }

.label {
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
}
.sub { color: var(--muted); font-size: 13px; margin-top: 4px; }
.dim { color: var(--muted); }
.note { font-size: 12px; color: var(--muted); margin-top: 12px; line-height: 1.5; }
.link { font-size: 13px; color: var(--ink-soft); text-decoration: underline; }
.empty { color: var(--muted); font-size: 13px; padding: 28px 4px; text-align: center; }

/* ---------- app shell ---------- */

.app {
  display: grid;
  grid-template-columns: var(--side-w) 1fr;
  min-height: 100vh;
  /* The sidebar's white and its edge run the full height of the page, however long it is. */
  background: linear-gradient(to right, var(--side) calc(var(--side-w) - 1px), var(--line) calc(var(--side-w) - 1px), var(--line) var(--side-w), transparent var(--side-w));
}

.sidebar {
  background: var(--side);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  align-self: start;
  height: 100vh;
  height: 100dvh;
  overflow-y: auto;
}

.sidebar .brand { display: block; padding: 22px 20px 18px; }
.sidebar .brand img { height: 12px; width: auto; display: block; }
.sidebar .club {
  margin: 0 12px 8px;
  padding: 9px 10px;
  border-radius: var(--radius-sm);
  background: var(--bg);
  font-size: 12px;
  line-height: 1.35;
}
.sidebar .club b { display: block; font-size: 12.5px; }
.sidebar .club span { color: var(--muted); }

.nav-group { padding: 10px 12px 4px; }
.nav-group > .label { display: block; padding: 6px 10px; font-size: 11px; color: var(--muted); }
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 10px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  color: var(--ink-soft);
  font-size: 13.5px;
}
.nav-item:hover { background: var(--hover); color: var(--ink); }
.nav-item.on { background: var(--ink); color: #fff; }
.nav-item .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: 0.35; flex: none; }
.nav-item.on .dot { opacity: 1; }
.nav-item .count { margin-left: auto; font-size: 11px; opacity: 0.7; }

.sidebar .me {
  margin-top: auto;
  position: sticky;
  bottom: 0;
  background: var(--side);
  border-top: 1px solid var(--line);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}
.sidebar .me:hover { background: var(--hover); }
.me-text { font-size: 12.5px; line-height: 1.3; min-width: 0; }
.me-text b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.me-text span { color: var(--muted); font-size: 11.5px; }

.avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--cream-line);
  color: var(--ink);
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 700;
  flex: none;
}

.content { min-width: 0; }
main { max-width: 1240px; margin: 0 auto; padding: 28px 32px 80px; }

.page-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 20px;
  margin-bottom: 20px;
}
.page-head .actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

.crumb { font-size: 12px; color: var(--muted); margin-bottom: 8px; }
.crumb a { text-decoration: none; }
.crumb a:hover { text-decoration: underline; }

/* The old top bar, still referenced by nothing new. */
.masthead { display: none; }

/* ---------- buttons & inputs ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 1px solid var(--accent);
  background: var(--accent);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  line-height: 1.2;
}
.btn:hover { background: #2c2c2c; }
.btn[disabled] { opacity: 0.4; cursor: not-allowed; }
.btn.ghost { background: var(--card); color: var(--ink); border-color: var(--line-strong); }
.btn.ghost:hover { background: var(--hover); }
.btn.small { padding: 5px 10px; font-size: 12px; }
.btn.wide { width: 100%; padding: 11px 14px; }

input[type="email"],
input[type="password"],
input[type="text"],
input[type="search"],
input[type="date"],
input[type="number"],
select,
textarea {
  width: 100%;
  font: inherit;
  font-size: 13.5px;
  padding: 8px 11px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--ink);
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--ink); outline-offset: 1px; border-color: var(--ink); }
/* Keyboard focus must be easy to see on every control. */
a:focus-visible, button:focus-visible, summary:focus-visible, [tabindex]:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.nav-item.on:focus-visible, .btn:not(.ghost):focus-visible { outline: none; box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--ink); }

label.field { display: block; margin-bottom: 14px; }
label.field span { display: block; margin-bottom: 6px; }

.toolbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.toolbar input[type="search"] { max-width: 320px; }
.toolbar input[type="date"] { max-width: 170px; }
.toolbar .spacer { flex: 1; }

/* ---------- surfaces ---------- */

.card, .panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px 22px;
}
.card.flush, .panel.flush { padding: 0; overflow: hidden; }
.section { margin-top: 22px; }
.section > .label { display: block; margin-bottom: 10px; }

.grid { display: grid; gap: 14px; }
.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.split { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(280px, 1fr); gap: 20px; align-items: start; }

/* ---------- tables ---------- */

.table-wrap { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
thead th {
  text-align: left;
  font-size: 11px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
  padding: 10px 14px;
  background: #fbfaf8;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
tbody td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--line);
  font-size: 13.5px;
  vertical-align: middle;
}
tbody tr:last-child td { border-bottom: none; }
tbody tr.clickable { cursor: pointer; }
tbody tr.clickable:hover td { background: #faf9f6; }
td.right, th.right { text-align: right; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
/* Tables written for the old layout sit straight on the page: give them the card. */
main > div > table, .section > table, .panel > table { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.panel > table { border: none; }

.pager { display: flex; justify-content: space-between; align-items: center; padding: 10px 14px; border-top: 1px solid var(--line); font-size: 12.5px; color: var(--muted); background: #fbfaf8; }

/* ---------- badges ---------- */

.badge {
  display: inline-flex;
  align-items: center;
  font-size: 11.5px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
  background: #efede9;
  color: var(--ink-soft);
  white-space: nowrap;
  border: none;
}
/* Black and white. Meaning is always in the words; fill and outline only add emphasis.
   done = solid black, todo/warn = black outline, off = grey outline, bad = red (errors and Misses only). */
.badge.done { background: var(--ink); color: #fff; }
.badge.todo { background: #fff; color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.badge.warn { background: #fff; color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--ink); font-weight: 700; }
.badge.off { background: #fff; color: var(--muted); box-shadow: inset 0 0 0 1px var(--line-strong); }
.badge.bad { background: var(--bad-bg); color: var(--bad); }

/* ---------- record page ---------- */

.fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 28px; }
.field-row { padding: 10px 0; border-bottom: 1px solid var(--line); min-width: 0; }
.field-row .label { display: block; margin-bottom: 3px; font-size: 10.5px; }
.field-row .value { font-size: 13.5px; overflow-wrap: anywhere; }
.field-row.wide { grid-column: 1 / -1; }
.field-row.wide .value { white-space: pre-wrap; color: var(--ink-soft); }

.related { margin-top: 18px; }
.related-head { display: flex; justify-content: space-between; align-items: center; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.related-head h3 { font-size: 13.5px; }

.other-club { color: var(--muted); font-style: italic; }

/* ---------- learning ---------- */

.course-card { display: flex; flex-direction: column; gap: 12px; text-decoration: none; transition: border-color 0.15s; }
.course-card:hover { border-color: var(--line-strong); }
.course-card .top { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.course-card .meta { font-size: 12.5px; color: var(--muted); }

.progress { height: 6px; background: #ece9e3; border-radius: 99px; overflow: hidden; flex: 1; }
.progress > i { display: block; height: 100%; background: var(--ink); border-radius: 99px; }
.progress-row { display: flex; align-items: center; gap: 12px; font-size: 12.5px; color: var(--muted); }

.lesson {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 13px 16px;
  border-bottom: 1px solid var(--line);
  text-decoration: none;
}
.lesson:last-child { border-bottom: none; }
.lesson:hover { background: #faf9f6; }
.lesson .n {
  width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center;
  font-size: 12px; font-weight: 700; background: #efede9; flex: none;
}
.lesson.done .n { background: var(--ink); color: #fff; }
.lesson .t { flex: 1; min-width: 0; }
.lesson .t b { display: block; font-size: 13.5px; }
.lesson .t span { font-size: 12px; color: var(--muted); }

.viewer { width: 100%; height: calc(100vh - 170px); min-height: 520px; border: 1px solid var(--line); border-radius: var(--radius); background: #525659; }

.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 20px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; font-size: 12.5px; color: var(--muted); }
.stat b { display: block; font-size: 26px; font-weight: 700; color: var(--ink); line-height: 1.2; }

.sop-body { font-size: 14px; line-height: 1.75; color: var(--ink-soft); white-space: pre-wrap; }

/* ---------- sign in ---------- */

.signin { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; background: var(--card); }
.signin-art { background: #111; color: #fff; padding: 44px; display: flex; flex-direction: column; justify-content: space-between; }
.signin-art img { height: 13px; width: auto; align-self: flex-start; }
.signin-art h1 { color: #fff; font-size: 30px; }
.signin-art p { color: #a0a0a0; font-size: 14px; max-width: 340px; }
.signin-art .label { color: #c0c0c0; }
.signin-art .foot { font-size: 11px; color: #b0b0b0; }
.signin-form { display: grid; place-items: center; padding: 44px; }
.signin-form form { width: 100%; max-width: 340px; }

/* ---------- modal ---------- */

.scrim { position: fixed; inset: 0; background: rgba(20, 20, 20, 0.45); display: grid; place-items: center; z-index: 60; padding: 24px; }
.modal { position: relative; background: #fff; border-radius: 14px; padding: 26px 28px; width: 100%; max-width: 440px; max-height: calc(100vh - 48px); overflow-y: auto; box-shadow: 0 20px 60px rgba(0, 0, 0, 0.18); }
.modal-x { position: absolute; top: 8px; right: 8px; width: 40px; height: 40px; border: 0; background: none; font-size: 26px; line-height: 1; color: var(--muted); cursor: pointer; border-radius: var(--radius-sm); }
.modal-x:hover { background: var(--hover); color: var(--ink); }
.modal h2 { padding-right: 28px; }

.pw-wrap { position: relative; }
.pw-wrap input { padding-right: 64px; }
.pw-toggle { position: absolute; top: 0; right: 0; height: 100%; min-width: 56px; border: 0; background: none; font-size: 12.5px; font-weight: 600; color: var(--ink-soft); cursor: pointer; border-radius: var(--radius-sm); }

.code-row { display: flex; gap: 8px; margin: 18px 0 20px; }
.code-row input { width: 44px; height: 50px; text-align: center; font-size: 20px; font-weight: 600; padding: 0; }

/* ---------- feedback ---------- */

.flash { border-radius: var(--radius-sm); padding: 10px 14px; font-size: 13px; margin-bottom: 14px; background: #fff; color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.flash.bad { background: var(--bad-bg); color: var(--bad); }

/* ---------- assessment ---------- */

.question { padding: 18px 0; border-bottom: 1px solid var(--line); }
.question p.prompt { font-size: 14.5px; margin: 0 0 10px; font-weight: 600; }
.option { display: flex; align-items: center; gap: 10px; padding: 6px 0; cursor: pointer; font-size: 14px; }
.option input { accent-color: #141414; }

/* ---------- watermark ---------- */

/* Whose screen this is, faintly, everywhere: a photo of member data carries a name. */
.watermark {
  position: fixed; inset: 0; pointer-events: none; z-index: 50;
  display: flex; flex-wrap: wrap; gap: 110px 80px; padding: 40px; overflow: hidden;
  transform: rotate(-18deg) scale(1.3); opacity: 0.045; font-size: 12px; user-select: none;
}
.watermark span { white-space: nowrap; }

@media print { main:has(.watermark) { display: none; } }

/* ---------- small screens ---------- */

.menu-toggle { display: none; }

@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; background: none; }
  /* Hidden menu links must not be reachable by keyboard or screen reader. */
  .sidebar { position: fixed; z-index: 70; top: 0; left: 0; width: 280px; max-width: 86vw; transform: translateX(-100%); visibility: hidden; transition: transform 0.2s, visibility 0s 0.2s; box-shadow: 0 0 40px rgba(0,0,0,0.15); }
  .app.menu-open .sidebar { transform: none; visibility: visible; transition: transform 0.2s; }
  .menu-toggle { display: inline-flex; margin: 14px 16px 0; min-height: 40px; padding: 8px 16px; }
  /* Fingers, not cursors: every control at least 40px tall. */
  .btn { min-height: 40px; }
  .btn.small { min-height: 40px; padding: 8px 12px; font-size: 13px; }
  input[type="email"], input[type="password"], input[type="text"], input[type="search"], input[type="date"], input[type="number"], select { min-height: 44px; font-size: 16px; }
  .nav-item { padding: 12px 10px; font-size: 14.5px; }
  .option { padding: 12px 10px; }
  input[type="checkbox"], input[type="radio"] { width: 20px; height: 20px; }
  button.badge { min-height: 36px; padding: 4px 12px; }
  .modal { padding: 22px 20px; }
  main { padding: 16px 16px 60px; }
  .split, .grid.two, .grid.three, .fields { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .signin { grid-template-columns: 1fr; }
  .signin-art { min-height: 200px; }
  .page-head { flex-direction: column; align-items: flex-start; }
}

.signin-points { list-style: none; padding: 0; margin: 30px 0 0; display: grid; gap: 16px; max-width: 360px; }
.signin-points li { color: #9a9a9a; font-size: 13.5px; padding-left: 16px; border-left: 2px solid #2e2e2e; }
.signin-points b { display: block; color: #fff; font-size: 14px; margin-bottom: 2px; }
.signin-form h2 { letter-spacing: -0.01em; }

/* Course editor: tables inside cards sit flat. */
.course-editor .card table { border: none; margin-top: 10px; }
.course-editor .card tbody td { padding-left: 0; }
.course-editor .card select { margin-top: 12px; }
.course-editor .card .btn { margin-top: 8px; }
.course-editor .section { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }

/* Quiz: each question on its own card. */
.question { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 22px; margin-bottom: 12px; }
.question .label { display: block; margin-bottom: 6px; }
.option { padding: 8px 10px; border-radius: var(--radius-sm); }
.option:hover { background: var(--hover); }

/* On a phone, CRM rows become small cards: label on the left, value on the right. */
@media (max-width: 900px) {
  table.records thead { display: none; }
  .table-wrap { overflow-x: visible; }
  table.records, table.records tbody, table.records tr, table.records td { display: block; width: 100%; }
  table.records tr { padding: 10px 14px; border-bottom: 1px solid var(--line); }
  table.records tbody td { border: none; padding: 5px 0; display: flex; justify-content: space-between; align-items: center; gap: 12px; text-align: right; min-width: 0; overflow-wrap: anywhere; }
  table.records tbody td[data-label]::before { content: attr(data-label); color: var(--muted); font-size: 12px; text-align: left; flex: none; }
  table.records tbody td:first-child { font-weight: 600; text-align: left; display: block; }
  table.records tbody td:first-child::before { display: none; }
  table.records tbody td:first-child { padding-top: 0; }
  table.records tbody td.right { justify-content: flex-start; }
  table.records tbody td.right > span { flex-wrap: wrap; }
  table.records td input[type="text"], table.records td input[type="number"], table.records td select { max-width: 60%; }
  .toolbar input[type="search"] { max-width: none; flex: 1 1 100%; }
}

/* The club film behind the sign-in panel, darkened so the white text stays readable. */
.signin-art { position: relative; overflow: hidden; isolation: isolate; }
.signin-art > *:not(.hero-media) { position: relative; z-index: 1; }
.hero-media { position: absolute; inset: 0; z-index: 0; background: #111 url('/hero-poster.jpg') center / cover no-repeat; }
.hero-media video { width: 100%; height: 100%; object-fit: cover; display: block; }
.hero-media::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(10, 10, 10, 0.6) 0%, rgba(10, 10, 10, 0.35) 55%, rgba(10, 10, 10, 0.1) 100%),
    linear-gradient(180deg, rgba(10, 10, 10, 0.5) 0%, rgba(10, 10, 10, 0.35) 30%, rgba(10, 10, 10, 0.55) 60%, rgba(10, 10, 10, 0.85) 100%);
}
@media (prefers-reduced-motion: reduce) { .hero-media video { display: none; } }
.signin-points li { border-left-color: rgba(255, 255, 255, 0.25); color: #c9c9c9; }
.signin-art p { color: #d6d6d6; }
.signin-art h1, .signin-art p, .signin-points li { text-shadow: 0 1px 12px rgba(0, 0, 0, 0.45); }

/* A drafted question, with the SOP sentence it came from. */
.draft .option { gap: 10px; }
.draft .option input[type="text"] { border-color: var(--line); }
.draft .note b { color: var(--ink); }

/* Head Office looking through someone else's account. */
.viewing-as {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 9px 20px;
  background: var(--ink);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
}

/* ---------- People dashboard (HR) ---------- */
.pd-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; align-items: start; }
.pd-card h2 { font-size: 13px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); margin: 0 0 14px; }
.pd-figs { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 16px; margin-bottom: 16px; }
.pd-fig { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.pd-label { font-size: 12.5px; color: var(--muted); }
.pd-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.pd-value { font-size: 24px; font-weight: 700; color: var(--ink); line-height: 1.2; }
.pd-fig.big .pd-value { font-size: 32px; }
.pd-empty { font-size: 14px; color: var(--faint); font-style: italic; padding: 4px 0; }
.pd-delta, .pd-target, .pd-note { font-size: 12px; color: var(--muted); }
.pd-card .table-wrap { border: 0; border-top: 1px solid var(--line); border-radius: 0; background: transparent; }
@media (max-width: 900px) { .pd-grid { grid-template-columns: minmax(0, 1fr); } }

/* Keyboard users skip the long menu. */
.skip { position: fixed; top: 8px; left: 8px; z-index: 100; padding: 10px 14px; background: var(--ink); color: #fff; border-radius: var(--radius-sm); transform: translateY(-200%); }
.skip:focus { transform: none; }
main:focus { outline: none; }

/* Phones: the confirm button stays within reach while reading. */
.sticky-confirm { display: none; }
@media (max-width: 900px) {
  .sticky-confirm { display: block; position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); background: #fff; border-top: 1px solid var(--line-strong); }
  main:has(.sticky-confirm) { padding-bottom: 96px; }
  .viewer { height: calc(100vh - 220px); min-height: 360px; }
}
