/* InRatio — Certification Register prototype
   Branding-adjacent palette: sages, terracottas, greens, whites.
   Not Naturally Learning's brand. Keeps product ownership open. */

:root {
  /* surfaces — clean cool off-whites, not beige; sage is the only real colour */
  --bg: #EEF2EC;
  --surface: #FFFFFF;
  --surface-2: #F5F8F4;
  --sidebar: #4A6A54;       /* mid forest green: rich and clearly green, not near-black */
  --sidebar-2: #416049;
  --sidebar-ink: #E9F0E7;
  --sidebar-line: rgba(255,255,255,.13);

  /* ink */
  --ink: #2A2E2A;
  --ink-soft: #6A716A;
  --ink-faint: #9BA199;
  --line: #E7E2D7;
  --line-soft: #F0ECE3;

  /* brand */
  --sage: #5E7A66;
  --sage-deep: #3A4A3F;
  --sage-soft: #E9F0EA;
  --terracotta: #BE6A4B;
  --terracotta-soft: #F6E8E1;

  /* status */
  --red: #B23A2E;       --red-bg: #F8E6E2;     --red-line:#E9C3BC;
  --amber: #BC842B;     --amber-bg: #F8EFDB;   --amber-line:#EAD6A8;
  --amber-2: #D0A24E;   /* softer amber for the 31 to 90 day tier */
  --blue: #4E6E85;      --blue-bg: #E7EFF4;    --blue-line:#C7DBE6;
  --green: #4E7A57;     --green-bg: #E7F0E8;   --green-line:#C5DBC8;
  --grey: #868B82;      --grey-bg: #EEEEE9;    --grey-line:#DEDED7;
  --prog: #6C6AA0;      --prog-bg: #ECEBF4;    --prog-line:#D3D1E6;  /* in training */

  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(40,45,40,.04), 0 8px 24px rgba(40,45,40,.05);
  --shadow-lg: 0 12px 40px rgba(40,45,40,.16);
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, system-ui, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
button { font-family: inherit; cursor: pointer; }

/* ---------- App shell ---------- */
.app { display: grid; grid-template-columns: 248px 1fr; min-height: 100vh; }

.sidebar {
  background: linear-gradient(180deg, var(--sidebar) 0%, var(--sidebar-2) 100%);
  color: var(--sidebar-ink);
  padding: 26px 18px;
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh;
  border-right: 1px solid var(--sidebar-2);
}
.brand { display: flex; align-items: center; gap: 11px; padding: 4px 8px 26px; }
.brand-mark { flex: 0 0 auto; }
.brand-name { font-size: 19px; font-weight: 700; letter-spacing: -.01em; color: #FFFFFF; }
.brand-name .ratio { color: #CFAE74; }
.brand-sub { font-size: 11px; color: #A4BAA8; margin-top: 1px; letter-spacing: .02em; }

.nav { display: flex; flex-direction: column; gap: 3px; margin-top: 6px; }
.nav-item {
  display: flex; align-items: center; gap: 11px;
  padding: 11px 13px; border-radius: var(--radius-sm);
  color: #C6D5C8; font-size: 13.5px; font-weight: 500;
  background: none; border: none; text-align: left; width: 100%;
  transition: background .12s, color .12s, box-shadow .12s;
}
.nav-item:hover { background: rgba(255,255,255,.1); color: #fff; }
.nav-item.active { background: #FFFFFF; color: #2E3B32; font-weight: 600; box-shadow: 0 1px 3px rgba(20,30,22,.18); }
.nav-item.active .nav-ico { color: var(--sage); }
.nav-ico { width: 18px; height: 18px; flex: 0 0 auto; color: #93A896; }
.nav-item .badge { margin-left: auto; }

.sidebar-foot { margin-top: auto; padding: 16px 10px 2px; border-top: 1px solid var(--sidebar-line); }
.sidebar-foot .who { font-size: 12.5px; color: #E7EFE7; font-weight: 700; }
.sidebar-foot .who small { display:block; font-weight:400; color:#A4BAA8; font-size:11px; margin-top:2px;}
.synthetic-tag {
  margin-top: 14px; font-size: 10.5px; line-height: 1.45; color: #AABBAC;
  background: rgba(0,0,0,.14); border: 1px solid rgba(255,255,255,.1); border-radius: 8px; padding: 8px 10px;
}

/* ---------- Main ---------- */
.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  display: flex; align-items: center; gap: 16px;
  padding: 22px 48px; border-bottom: 1px solid var(--line);
  background: var(--surface); position: sticky; top: 0; z-index: 20;
}
.topbar h1 { font-size: 19px; margin: 0; font-weight: 700; letter-spacing: -.01em; }
.topbar .sub { color: var(--ink-soft); font-size: 12.5px; margin-top: 2px; }
.topbar-spacer { flex: 1; }
.asof { font-size: 12px; color: var(--ink-soft); text-align: right; }
.asof b { color: var(--ink); }

.search {
  display: flex; align-items: center; gap: 8px;
  background: var(--surface-2); border: 1px solid var(--line);
  border-radius: 999px; padding: 8px 14px; width: 340px;
}
.search:focus-within { border-color: var(--sage); background: var(--surface); }
.search input { border: none; background: none; outline: none; font-size: 13px; width: 100%; color: var(--ink); }
.search svg { color: var(--ink-faint); flex: 0 0 auto; }

.content { padding: 38px 48px 90px; max-width: 1120px; }

/* ---------- Reusable ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.section-title { font-size: 15px; font-weight: 700; margin: 0; letter-spacing: -.01em; }
.section-head { display: flex; align-items: center; gap: 12px; margin: 38px 0 18px; }
table.grid th.sortable { cursor: pointer; user-select: none; }
table.grid th.sortable:hover { color: var(--ink); background: var(--sage-soft); }
table.grid th.sortable.active { color: var(--sage); }
.sortcar { font-size: 9px; }
.section-head .section-title { margin: 0; }
.muted { color: var(--ink-soft); }
.faint { color: var(--ink-faint); }

.pill {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 600;
  border: 1px solid transparent; white-space: nowrap;
}
.pill .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill.red    { color: var(--red);   background: var(--red-bg);   border-color: var(--red-line); }
.pill.amber  { color: var(--amber); background: var(--amber-bg); border-color: var(--amber-line); }
.pill.blue   { color: var(--blue);  background: var(--blue-bg);  border-color: var(--blue-line); }
.pill.green  { color: var(--green); background: var(--green-bg); border-color: var(--green-line); }
.pill.grey   { color: var(--grey);  background: var(--grey-bg);  border-color: var(--grey-line); }
.pill.prog   { color: var(--prog);  background: var(--prog-bg);  border-color: var(--prog-line); }

.badge {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px;
  font-size: 11px; font-weight: 700; background: rgba(40,45,40,.07); color: var(--ink-soft);
}
.badge.red { background: var(--red); color: #fff; }

.btn {
  display: inline-flex; align-items: center; gap: 7px;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  padding: 8px 14px; border-radius: var(--radius-sm); font-size: 13px; font-weight: 600;
  transition: background .12s, border-color .12s;
}
.btn:hover { background: var(--surface-2); border-color: var(--ink-faint); }
.btn.primary { background: var(--sage); border-color: var(--sage); color: #fff; }
.btn.primary:hover { background: var(--sage-deep); border-color: var(--sage-deep); }
.btn.sm { padding: 5px 10px; font-size: 12px; }

select, .select {
  border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  padding: 7px 12px; border-radius: var(--radius-sm); font-size: 13px; font-weight: 500;
  outline: none; cursor: pointer;
}
.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.filters label { font-size: 12px; color: var(--ink-soft); font-weight: 600; margin-right: -4px; }

/* ---------- Stat cards ---------- */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.stat {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px 18px; box-shadow: var(--shadow); text-align: left;
  cursor: pointer; transition: transform .1s, box-shadow .1s, border-color .1s;
  position: relative; overflow: hidden;
}
.stat:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.stat .stat-accent { position: absolute; left: 0; top: 0; bottom: 0; width: 4px; }
.stat .num { font-size: 30px; font-weight: 800; letter-spacing: -.02em; line-height: 1; }
.stat .lbl { font-size: 12.5px; color: var(--ink-soft); margin-top: 7px; font-weight: 600; }
.stat .meta { font-size: 11.5px; color: var(--ink-faint); margin-top: 3px; }
.stat.is-red .num { color: var(--red); }       .stat.is-red .stat-accent { background: var(--red); }
.stat.is-amber .num { color: var(--amber); }    .stat.is-amber .stat-accent { background: var(--amber); }
.stat.is-blue .num { color: var(--blue); }      .stat.is-blue .stat-accent { background: var(--blue); }
.stat.is-green .num { color: var(--green); }     .stat.is-green .stat-accent { background: var(--green); }
.stat.selected { border-color: var(--ink); }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; }
table.grid { width: 100%; border-collapse: collapse; font-size: 13px; }
table.grid th {
  text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .04em;
  color: var(--ink-faint); font-weight: 700; padding: 11px 14px; border-bottom: 1px solid var(--line);
  background: var(--surface-2); position: sticky; top: 0;
}
table.grid td { padding: 11px 14px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
table.grid tr:last-child td { border-bottom: none; }
table.grid tbody tr { transition: background .1s; }
table.grid tbody tr.clickable:hover { background: var(--sage-soft); cursor: pointer; }
.name-cell { font-weight: 600; }
.name-cell .role { font-weight: 400; color: var(--ink-soft); font-size: 12px; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }

.days-left { font-weight: 700; }
.days-left.red { color: var(--red); }
.days-left.amber { color: var(--amber); }
.days-left.green { color: var(--green); }

.empty { padding: 40px; text-align: center; color: var(--ink-faint); }

/* ---------- Matrix ---------- */
.matrix-wrap { overflow-x: auto; }
table.matrix { border-collapse: collapse; font-size: 12.5px; width: 100%; }
table.matrix th.cred { writing-mode: vertical-rl; transform: rotate(180deg); white-space: nowrap;
  font-size: 11px; font-weight: 700; color: var(--ink-soft); padding: 10px 4px; height: 120px; vertical-align: bottom; }
table.matrix th.who { text-align: left; padding: 10px 14px; background: var(--surface-2); position: sticky; left: 0; z-index: 2;
  border-bottom: 1px solid var(--line); font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-faint); }
table.matrix td.who { text-align: left; padding: 9px 14px; position: sticky; left: 0; background: var(--surface);
  font-weight: 600; white-space: nowrap; border-right: 1px solid var(--line); z-index: 1; }
table.matrix td.who .role { font-weight: 400; color: var(--ink-soft); font-size: 11.5px; }
table.matrix td.cell { text-align: center; padding: 6px; }
table.matrix tr:hover td.who { background: var(--sage-soft); }
.cellmark {
  display: inline-flex; align-items: center; justify-content: center;
  width: 26px; height: 26px; border-radius: 7px; font-size: 12px; font-weight: 700; cursor: default;
}
.cellmark.green { background: var(--green-bg); color: var(--green); }
.cellmark.amber { background: var(--amber-bg); color: var(--amber); }
.cellmark.red   { background: var(--red-bg);   color: var(--red); }
.cellmark.blue  { background: var(--blue-bg);  color: var(--blue); }
.cellmark.prog  { background: var(--prog-bg);  color: var(--prog); }
.cellmark.grey  { background: transparent;     color: var(--ink-faint); }

/* site compliance summary */
.compliance { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; margin-bottom: 18px; }
.comp-card { border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; background: var(--surface); }
.comp-card .ck { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--ink-soft); font-weight: 600; }
.comp-card .cv { font-size: 18px; font-weight: 800; margin-top: 6px; letter-spacing: -.01em; }
.comp-card .cnote { font-size: 11.5px; color: var(--ink-faint); margin-top: 2px; }
.comp-card.ok { border-left: 4px solid var(--green); }
.comp-card.warn { border-left: 4px solid var(--amber); }
.comp-card.bad { border-left: 4px solid var(--red); }

/* tabs */
.tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.tab { padding: 8px 15px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface);
  font-size: 13px; font-weight: 600; color: var(--ink-soft); }
.tab:hover { border-color: var(--ink-faint); }
.tab.active { background: var(--sage-deep); border-color: var(--sage-deep); color: #fff; }

/* ---------- Calendar ---------- */
.cal-head { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; }
.cal-title { font-size: 17px; font-weight: 700; min-width: 190px; }
.cal-nav { display: flex; gap: 6px; }
.icon-btn { width: 34px; height: 34px; display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--line); background: var(--surface); border-radius: var(--radius-sm); color: var(--ink); }
.icon-btn:hover { background: var(--surface-2); }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; }
.cal-dow { font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-faint); font-weight: 700; text-align: center; padding: 4px 0; }
.cal-cell { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm);
  min-height: 96px; padding: 7px 8px; display: flex; flex-direction: column; gap: 4px; }
.cal-cell.other { background: var(--surface-2); opacity: .55; }
.cal-cell.today { border-color: var(--sage); box-shadow: 0 0 0 1px var(--sage); }
.cal-date { font-size: 12px; font-weight: 700; color: var(--ink-soft); }
.cal-cell.today .cal-date { color: var(--sage); }
.cal-evt { font-size: 11px; padding: 3px 6px; border-radius: 5px; font-weight: 600; cursor: pointer;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-evt.red { background: var(--red-bg); color: var(--red); }
.cal-evt.amber { background: var(--amber-bg); color: var(--amber); }
.cal-evt.more { background: var(--line-soft); color: var(--ink-soft); }
.cal-legend { display: flex; gap: 16px; margin-top: 16px; font-size: 12px; color: var(--ink-soft); }
.cal-legend span { display: inline-flex; align-items: center; gap: 6px; }
.cal-legend .sw { width: 11px; height: 11px; border-radius: 3px; }

/* ---------- Modal / person card ---------- */
.scrim { position: fixed; inset: 0; background: rgba(35,40,35,.42); z-index: 100; display: flex; justify-content: flex-end; }
.drawer { width: 520px; max-width: 94vw; background: var(--bg); height: 100vh; overflow-y: auto;
  box-shadow: var(--shadow-lg); animation: slidein .18s ease; }
@keyframes slidein { from { transform: translateX(30px); opacity: .6; } to { transform: none; opacity: 1; } }
.drawer-head { padding: 22px 26px; background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 2; }
.drawer-head .row { display: flex; align-items: flex-start; gap: 14px; }
.avatar { width: 46px; height: 46px; border-radius: 12px; background: var(--sage-soft); color: var(--sage-deep);
  display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 17px; flex: 0 0 auto; }
.drawer-head h2 { margin: 0; font-size: 19px; letter-spacing: -.01em; }
.drawer-head .meta { color: var(--ink-soft); font-size: 13px; margin-top: 2px; }
.drawer-close { margin-left: auto; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.chip { font-size: 11.5px; font-weight: 600; padding: 3px 9px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); color: var(--ink-soft); }
.chip.role { background: var(--sage-soft); border-color: var(--green-line); color: var(--sage-deep); }
.drawer-body { padding: 20px 26px 60px; }

.cred-row { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px 16px; margin-bottom: 10px; }
.cred-row .top { display: flex; align-items: center; gap: 10px; }
.cred-row .cname { font-weight: 700; font-size: 13.5px; }
.cred-row .cdates { font-size: 12px; color: var(--ink-soft); margin-top: 4px; }
.cred-row .evidence { font-size: 11.5px; color: var(--ink-faint); margin-top: 3px; }
.stage-row { display: flex; align-items: center; gap: 8px; margin-top: 11px; padding-top: 11px; border-top: 1px dashed var(--line); }
.stage-row label { font-size: 11.5px; color: var(--ink-soft); font-weight: 600; }
.stage-steps { display: flex; gap: 5px; flex-wrap: wrap; }
.stage-pip { font-size: 11.5px; font-weight: 600; padding: 4px 10px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink-soft); }
.stage-pip:hover { border-color: var(--sage); }
.stage-pip.on { background: var(--sage); border-color: var(--sage); color: #fff; }

/* activity feed */
.feed-item { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line-soft); }
.feed-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--sage); margin-top: 5px; flex: 0 0 auto; }
.feed-item .fwhen { font-size: 11.5px; color: var(--ink-faint); }
.feed-item .faction { font-weight: 600; font-size: 13px; }
.feed-item .fdetail { font-size: 12.5px; color: var(--ink-soft); }

.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(20px);
  background: var(--sage-deep); color: #fff; padding: 11px 18px; border-radius: 999px; font-size: 13px; font-weight: 600;
  box-shadow: var(--shadow-lg); opacity: 0; transition: opacity .2s, transform .2s; z-index: 200; pointer-events: none; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

.minibars { display: flex; flex-direction: column; gap: 9px; }
.minibar { display: grid; grid-template-columns: 130px 1fr 40px; align-items: center; gap: 12px; }
.minibar .mb-name { font-size: 12.5px; font-weight: 600; }
.minibar .mb-track { height: 9px; background: var(--line-soft); border-radius: 999px; overflow: hidden; display: flex; }
.minibar .mb-seg { height: 100%; }
.minibar .mb-seg.red { background: var(--red); }
.minibar .mb-seg.amber { background: var(--amber); }
.minibar .mb-seg.blue { background: var(--blue); }
.minibar .mb-count { font-size: 12px; font-weight: 700; text-align: right; }

/* ---------- Worklist (home) ---------- */
.wl-summary { display: flex; align-items: flex-start; gap: 18px; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius); padding: 26px 30px; box-shadow: var(--shadow); margin-bottom: 30px; }
.wl-sum-icon { width: 44px; height: 44px; border-radius: 12px; display: flex; align-items: center; justify-content: center;
  font-size: 22px; font-weight: 800; flex: 0 0 auto; }
.wl-sum-icon.bad { background: var(--red-bg); color: var(--red); }
.wl-sum-icon.warn { background: var(--amber-bg); color: var(--amber); }
.wl-sum-icon.ok { background: var(--green-bg); color: var(--green); }
.wl-summary .big { font-size: 21px; font-weight: 800; letter-spacing: -.015em; line-height: 1.2; }
.wl-summary .sub { color: var(--ink-soft); font-size: 13.5px; margin-top: 6px; line-height: 1.5; }

.wl-toolbar { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }

.worklist { display: flex; flex-direction: column; gap: 20px; }
.wl-group { border: 1px solid var(--line); border-radius: 14px; background: var(--surface);
  box-shadow: var(--shadow); overflow: hidden; }
.wl-group.red { border-left: 4px solid var(--red); }
.wl-group.amber { border-left: 4px solid var(--amber); }
.wl-group.blue { border-left: 4px solid var(--blue); }
.wl-group.later { border-left: 4px solid var(--grey-line); }

.wl-head { display: flex; align-items: center; gap: 12px; width: 100%; padding: 18px 24px;
  background: none; border: none; text-align: left; font-size: 15px; font-weight: 700; color: var(--ink); }
.wl-head:hover { background: var(--surface-2); }
.wl-caret { color: var(--ink-faint); font-size: 11px; width: 12px; flex: 0 0 auto; }
.wl-dot { width: 9px; height: 9px; border-radius: 50%; flex: 0 0 auto; }
.wl-dot.red { background: var(--red); } .wl-dot.amber { background: var(--amber); }
.wl-dot.blue { background: var(--blue); } .wl-dot.later { background: var(--grey); }
.wl-title { flex: 0 0 auto; }
.wl-blurb { color: var(--ink-faint); font-weight: 400; font-size: 12.5px; margin-left: 6px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wl-count { margin-left: auto; min-width: 28px; text-align: center; background: var(--surface-2);
  border: 1px solid var(--line); border-radius: 999px; padding: 3px 12px; font-size: 13px; font-weight: 700; color: var(--ink-soft); flex: 0 0 auto; }

.wl-body { border-top: 1px solid var(--line); }
.wl-row { display: flex; align-items: center; gap: 18px; padding: 16px 24px; border-bottom: 1px solid var(--line-soft); transition: background .1s; }
.wl-row:last-child { border-bottom: none; }
.wl-row:hover { background: var(--sage-soft); cursor: pointer; }
.wl-person { width: 240px; flex: 0 0 auto; min-width: 0; }
.wl-name { font-weight: 600; display: block; }
.wl-meta { display: block; font-size: 12px; color: var(--ink-soft); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wl-cred { flex: 1; min-width: 120px; font-size: 13.5px; }
.wl-status { flex: 0 0 auto; width: 140px; }
.wl-actions { flex: 0 0 auto; display: flex; gap: 8px; align-items: center; }
.wl-chev { color: var(--ink-faint); flex: 0 0 auto; font-size: 16px; }
.wl-showall { display: block; width: 100%; text-align: center; padding: 13px; background: var(--surface-2);
  border: none; border-top: 1px solid var(--line-soft); color: var(--sage); font-weight: 600; font-size: 13px; }
.wl-showall:hover { background: var(--sage-soft); }

@media (max-width: 980px) {
  .wl-person { width: 180px; }
  .wl-blurb { display: none; }
  .wl-status { width: auto; }
}

/* ---------- About / overview ---------- */
.about-intro { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 24px 28px; box-shadow: var(--shadow); margin-bottom: 8px; border-left: 4px solid var(--sage); }
.about-intro h2 { margin: 0 0 8px; font-size: 18px; letter-spacing: -.01em; }
.about-intro p { margin: 0 0 10px; color: var(--ink-soft); font-size: 13.5px; line-height: 1.55; max-width: 72ch; }
.totals { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.total { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px 22px; box-shadow: var(--shadow); border-left: 4px solid var(--sage); }
.total .tnum { font-size: 32px; font-weight: 800; letter-spacing: -.02em; line-height: 1; color: var(--sage-deep); }
.total .tlbl { font-size: 12.5px; color: var(--ink-soft); margin-top: 9px; font-weight: 600; }
.about-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; align-items: start; }
@media (max-width: 820px) { .totals { grid-template-columns: repeat(2, 1fr); } .about-cols { grid-template-columns: 1fr; } }

/* ---------- Certificate currency / health ---------- */
.currency-chip { display: flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--ink-soft);
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 999px; padding: 7px 13px; white-space: nowrap; }
.currency-chip b { color: var(--ink); font-weight: 700; }
.cc-dot { width: 8px; height: 8px; border-radius: 50%; flex: 0 0 auto; }
.cc-dot.green { background: var(--green); } .cc-dot.amber { background: var(--amber); } .cc-dot.red { background: var(--red); }

.health { display: grid; grid-template-columns: 1.45fr 1fr; gap: 16px; }
.health-main { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 26px 30px; border-left: 5px solid var(--green); }
.health-main.amber { border-left-color: var(--amber); } .health-main.red { border-left-color: var(--red); }
.health-main .hpct { font-size: 50px; font-weight: 800; letter-spacing: -.025em; line-height: 1; color: var(--green); }
.health-main.amber .hpct { color: var(--amber); } .health-main.red .hpct { color: var(--red); }
.health-main .hlbl { font-size: 14px; color: var(--ink); margin-top: 14px; font-weight: 600; max-width: 38ch; }
.health-main .hsub { font-size: 12.5px; color: var(--ink-soft); margin-top: 7px; }
.health-side { display: grid; gap: 16px; }
.hstat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px 22px; }
.hstat .hs-num { font-size: 26px; font-weight: 800; letter-spacing: -.01em; color: var(--sage-deep); line-height: 1; }
.hstat .hs-lbl { font-size: 12.5px; color: var(--ink-soft); margin-top: 8px; font-weight: 600; }

.currbars { display: flex; flex-direction: column; gap: 13px; }
.currbar { display: grid; grid-template-columns: 150px 1fr 52px; align-items: center; gap: 14px; }
.currbar .cb-name { font-size: 13px; font-weight: 600; }
.currbar .cb-track { height: 10px; background: var(--line-soft); border-radius: 999px; overflow: hidden; }
.currbar .cb-fill { height: 100%; border-radius: 999px; }
.currbar .cb-fill.green { background: var(--green); } .cb-fill.amber { background: var(--amber); } .cb-fill.red { background: var(--red); }
.currbar .cb-val { font-size: 13px; font-weight: 700; text-align: right; }
@media (max-width: 820px) { .health { grid-template-columns: 1fr; } }

/* ---------- Redesign additions (runway, cohorts, programmes) ---------- */
.chip.prog { background: var(--prog-bg); border-color: var(--prog-line); color: var(--prog); }
.btn.block { width: 100%; justify-content: center; }
.btn:disabled { opacity: .5; cursor: default; }
.btn:disabled:hover { background: var(--sage); border-color: var(--sage); }

/* dashboard runway preview */
.preview-card { margin-top: 26px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 18px 22px; cursor: pointer; transition: border-color .12s, box-shadow .12s; }
.preview-card:hover { border-color: var(--sage); box-shadow: var(--shadow-lg); }
.pv-head { display: flex; align-items: baseline; gap: 12px; }
.pv-title { font-weight: 700; font-size: 14px; }
.pv-link { margin-left: auto; color: var(--sage); font-weight: 600; font-size: 13px; }
.pv-body { margin-top: 10px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.mini-chip { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; color: var(--ink-soft);
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 999px; padding: 4px 10px; cursor: pointer; }
.mini-chip b { color: var(--sage-deep); }
.mini-note { font-size: 12.5px; color: var(--ink-soft); }

/* horizon selector + segment toggle */
.horizon { display: flex; align-items: center; gap: 8px; }
.hz-lbl { font-size: 12px; color: var(--ink-soft); font-weight: 600; }
.hz-btn { padding: 6px 13px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface);
  font-size: 12.5px; font-weight: 600; color: var(--ink-soft); }
.hz-btn:hover { border-color: var(--ink-faint); }
.hz-btn.on { background: var(--sage); border-color: var(--sage); color: #fff; }
.seg { display: inline-flex; background: var(--surface-2); border: 1px solid var(--line); border-radius: 999px; padding: 3px; }
.seg-btn { padding: 6px 16px; border-radius: 999px; border: none; background: none; font-size: 12.5px; font-weight: 600; color: var(--ink-soft); }
.seg-btn.on { background: var(--surface); color: var(--sage-deep); box-shadow: 0 1px 2px rgba(40,45,40,.12); }

/* overdue banner on runway */
.rw-banner { display: flex; align-items: center; gap: 10px; background: var(--red-bg); border: 1px solid var(--red-line);
  color: var(--red); border-radius: var(--radius); padding: 13px 18px; font-weight: 600; font-size: 13.5px; cursor: pointer; margin-bottom: 6px; }
.rw-banner:hover { filter: brightness(.98); }
.rw-bang { width: 20px; height: 20px; border-radius: 50%; background: var(--red); color: #fff; display: inline-flex;
  align-items: center; justify-content: center; font-weight: 800; font-size: 13px; flex: 0 0 auto; }

/* cohort insight cards (who is due together) */
.cohort-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.cohort-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 16px 18px; border-left: 4px solid var(--sage); }
.ch-name { font-weight: 700; font-size: 13.5px; }
.ch-nums { font-size: 13px; color: var(--ink-soft); margin-top: 6px; }
.ch-nums b { font-size: 20px; font-weight: 800; color: var(--sage-deep); letter-spacing: -.02em; }
.ch-dl { font-size: 12px; color: var(--ink-soft); margin: 4px 0 14px; }
.ch-warn { color: var(--amber); font-weight: 600; }
.ch-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* the runway itself */
.runway-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.rw-month { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 14px 16px; border-top: 3px solid var(--line); }
.rw-month.red { border-top-color: var(--red); }
.rw-month.amber { border-top-color: var(--amber); }
.rw-month.amber2 { border-top-color: var(--amber-2); }
.rw-month.green { border-top-color: var(--green); }
.rw-month.booked { border-top-color: var(--grey); }
.rw-month.empty-month { opacity: .5; box-shadow: none; }
.rw-mhead { display: flex; align-items: baseline; gap: 10px; margin-bottom: 10px; }
.rw-mname { font-weight: 700; font-size: 13px; }
.rw-mcount { margin-left: auto; font-size: 12px; font-weight: 700; color: var(--ink-soft); background: var(--surface-2);
  border: 1px solid var(--line); border-radius: 999px; padding: 1px 10px; }
.rw-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.rw-chip { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 600; padding: 3px 9px;
  border-radius: 999px; border: 1px solid transparent; }
.rw-chip.red { color: var(--red); background: var(--red-bg); border-color: var(--red-line); }
.rw-chip.amber { color: var(--amber); background: var(--amber-bg); border-color: var(--amber-line); }
.rw-chip.amber2 { color: #9A7A34; background: #FBF4E6; border-color: #EEDFBC; }
.rw-chip.green { color: var(--green); background: var(--green-bg); border-color: var(--green-line); }
.rw-chip.booked { color: var(--grey); background: var(--grey-bg); border-color: var(--grey-line); }
.rw-chip.clickable { cursor: pointer; }
.rw-chip.clickable:hover { filter: brightness(.96); box-shadow: 0 0 0 1px currentColor inset; }

/* matrix caption */
.matrix-caption { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 12.5px; color: var(--ink-soft); margin: 14px 0; }

/* course planner drawer */
.drawer-foot { position: sticky; bottom: 0; background: var(--surface); border-top: 1px solid var(--line);
  padding: 14px 26px; display: flex; align-items: center; gap: 12px; }
.pl-datebar { display: flex; align-items: center; gap: 12px; margin-bottom: 6px; }
.pl-datebar label { font-size: 12.5px; font-weight: 600; color: var(--ink-soft); }
.pl-datebar input[type=date] { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 8px 12px; font-family: inherit; font-size: 13px; color: var(--ink); }
.pl-list { display: flex; flex-direction: column; gap: 6px; }
.pl-row { display: flex; align-items: center; gap: 12px; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-sm); padding: 10px 14px; cursor: pointer; }
.pl-row:hover { border-color: var(--sage); }
.pl-row input { width: 17px; height: 17px; accent-color: var(--sage); flex: 0 0 auto; }
.pl-name { flex: 1; font-weight: 600; font-size: 13px; }
.pl-name small { display: block; font-weight: 400; color: var(--ink-soft); font-size: 11.5px; margin-top: 1px; }
.pl-row .pill { margin-left: auto; }
.cred-row.prog { border-left: 4px solid var(--prog); }

@media (max-width: 820px) { .runway-grid, .cohort-grid { grid-template-columns: 1fr; } }

/* smart search */
.search-bar-lg { display: flex; align-items: center; gap: 11px; background: var(--surface); border: 1px solid var(--line);
  border-radius: 12px; padding: 15px 18px; box-shadow: var(--shadow); margin-bottom: 22px; }
.search-bar-lg:focus-within { border-color: var(--sage); box-shadow: 0 0 0 3px var(--sage-soft); }
.search-bar-lg svg { color: var(--ink-faint); flex: 0 0 auto; }
.search-bar-lg input { border: none; background: none; outline: none; font-size: 16px; width: 100%; color: var(--ink); font-family: inherit; }
.search-head { display: flex; align-items: flex-start; gap: 14px; margin-bottom: 18px; }
.search-answer { font-size: 20px; font-weight: 800; letter-spacing: -.015em; line-height: 1.25; }
.search-interp { margin-top: 8px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.search-interp::before { content: "Read as:"; font-size: 12px; color: var(--ink-soft); font-weight: 600; margin-right: 2px; }
.search-interp .chip { background: var(--sage-soft); border-color: var(--green-line); color: var(--sage-deep); }
.qchips { display: flex; flex-wrap: wrap; gap: 8px; }
.qchip { padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface);
  font-size: 13px; font-weight: 500; color: var(--ink); box-shadow: var(--shadow); }
.qchip:hover { border-color: var(--sage); background: var(--sage-soft); color: var(--sage-deep); }
.qlink { border: none; background: none; padding: 0; color: var(--sage); font-weight: 600; font-size: 12px; text-decoration: underline; }

@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; }
  .nav { flex-direction: row; flex-wrap: wrap; margin: 0; }
  .sidebar-foot { display: none; }
  .stats { grid-template-columns: repeat(2, 1fr); }
}

/* ===== additions for the live build (login, modals, help, coverage) ===== */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: var(--bg); padding: 20px; }
.login-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 34px 38px; width: 100%; max-width: 420px; }
.login-card h2 { margin: 0 0 6px; font-size: 20px; }
.login-card form { display: flex; flex-direction: column; gap: 10px; margin-top: 14px; }
.login-card input[type=email] { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 11px 14px;
  font-family: inherit; font-size: 14px; color: var(--ink); }
.login-card input[type=email]:focus { outline: none; border-color: var(--sage); box-shadow: 0 0 0 3px var(--sage-soft); }

.modal-form { display: flex; flex-direction: column; gap: 12px; }
.modal-form label { font-size: 12.5px; font-weight: 600; color: var(--ink-soft); display: flex; flex-direction: column; gap: 5px; }
.modal-form input, .modal-form textarea, .modal-form select { border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 9px 12px; font-family: inherit; font-size: 13.5px; color: var(--ink); }
.modal-form input:focus, .modal-form textarea:focus { outline: none; border-color: var(--sage); box-shadow: 0 0 0 3px var(--sage-soft); }
.modal-issues { border: 1px solid var(--amber-line); background: var(--amber-bg); color: var(--amber); border-radius: var(--radius-sm);
  padding: 10px 14px; font-size: 12.5px; display: flex; flex-direction: column; gap: 4px; }
.modal-issues.error { border-color: var(--red-line); background: var(--red-bg); color: var(--red); }
.cred-actions-extra { display: flex; gap: 8px; margin-top: 8px; }
.linklike { border: none; background: none; padding: 0; color: var(--ink-faint); font-size: 11.5px; text-decoration: underline; cursor: pointer; }
.linklike:hover { color: var(--ink-soft); }

.help-body { max-width: 88ch; }
.help-body h2 { font-size: 17px; margin: 26px 0 8px; }
.help-body h3 { font-size: 14px; margin: 18px 0 6px; }
.help-body p, .help-body li { font-size: 13.5px; line-height: 1.6; color: var(--ink); }
.help-body code { background: var(--surface-2); border: 1px solid var(--line); border-radius: 4px; padding: 1px 6px; font-size: 12.5px; }
.trouble { border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); padding: 4px 18px; margin: 10px 0; }
.trouble summary { font-weight: 700; font-size: 13.5px; cursor: pointer; padding: 10px 0; }

.gap-row { display: grid; grid-template-columns: 1.4fr 1.4fr auto; align-items: center; gap: 12px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px 16px; }
.coverage-note { font-size: 12px; color: var(--ink-soft); }
.pill.violet { color: #6B5CA5; background: #F0EDF9; border-color: #DCD5F0; }
.pill.grey .dot { background: var(--grey); }

.history-list { margin-top: 6px; border-top: 1px dashed var(--line); padding-top: 6px; }
.history-row { font-size: 11.5px; color: var(--ink-faint); padding: 2px 0; }
.history-row .void { color: var(--red); font-weight: 600; }

/* The hidden attribute must always win — .app/.login-wrap set display and
   would otherwise override the UA's [hidden] { display: none }. */
[hidden] { display: none !important; }
