/* E2C CRM design system. Colors follow E2C's website (navy and gold) until the
   official brand kit arrives; change the tokens below to rebrand everything. */
:root {
  --navy: #003190;
  --navy-dark: #001a56;
  --navy-soft: #e8eefa;
  --gold: #eda229;
  --gold-soft: #fff4de;
  --gold-line: #f3cf8c;
  --ink: #1f2633;
  --text: #3d4451;
  --muted: #5d6676;
  --line: #e3e7ee;
  --soft: #f5f7fb;
  --bg: #f2f4f8;
  --card: #ffffff;
  --good: #1e7b4a;
  --good-soft: #e7f5ed;
  --warn: #8a4f00;
  --warn-soft: #fff4de;
  --bad: #b3261e;
  --bad-soft: #fdecea;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(16, 32, 64, .05), 0 4px 14px rgba(16, 32, 64, .05);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; /* the computer's own font, on purpose: no font file is loaded */
  --sidebar: 236px;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font: 15px/1.5 var(--font); color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; }
a { color: var(--navy); }
button, input, select, textarea { font: inherit; color: inherit; }
h1 { font-size: 26px; line-height: 1.2; margin: 0; color: var(--ink); font-weight: 600; }
h2 { font-size: 18px; margin: 0 0 12px; color: var(--ink); font-weight: 600; }
h3 { font-size: 12px; margin: 0 0 8px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.nowrap { white-space: nowrap; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row > select { width: auto; max-width: 100%; }
.spacer { flex: 1; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; }
.stack > * + * { margin-top: 14px; }
.icon { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ── app shell: sidebar + toolbar ── */
.shell { display: flex; min-height: 100vh; }
.sidebar { width: var(--sidebar); flex: none; background: var(--navy-dark); color: #d6def0; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; z-index: 30; }
.sidebar .brand { display: flex; align-items: center; gap: 10px; padding: 18px 18px 14px; color: #fff; text-decoration: none; }
.sidebar .mark { width: 36px; height: 36px; border-radius: 10px; background: var(--gold); color: var(--navy-dark); font-weight: 700; display: flex; align-items: center; justify-content: center; font-size: 14px; letter-spacing: .02em; flex: none; }
.sidebar .brand b { display: block; font-size: 15px; line-height: 1.2; }
.sidebar .brand div span { display: block; font-size: 11px; color: #9fb1d8; }
.sidebar nav { flex: 1; overflow-y: auto; padding: 6px 10px; }
.sidebar .group { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: #7f93c2; padding: 14px 10px 6px; }
.sidebar nav a { display: flex; align-items: center; gap: 11px; padding: 9px 10px; border-radius: 9px; color: #d6def0; text-decoration: none; position: relative; }
.sidebar nav a:hover { background: rgba(255,255,255,.07); color: #fff; }
.sidebar nav a.on { background: rgba(255,255,255,.12); color: #fff; font-weight: 600; }
.sidebar nav a.on::before { content: ""; position: absolute; left: -10px; top: 8px; bottom: 8px; width: 4px; border-radius: 0 4px 4px 0; background: var(--gold); }
.sidebar .me { border-top: 1px solid rgba(255,255,255,.1); padding: 12px 16px; font-size: 13px; }
.sidebar .me b { display: block; color: #fff; font-weight: 600; }
.sidebar .me button { margin-top: 8px; background: transparent; border: 1px solid rgba(255,255,255,.3); color: #fff; padding: 5px 10px; border-radius: 7px; cursor: pointer; font-size: 12px; }
.sidebar .collapse { margin: 0 10px 10px; background: transparent; border: 0; color: #9fb1d8; cursor: pointer; display: flex; align-items: center; gap: 8px; font-size: 12px; padding: 6px; }
/* The collapsed sidebar is for computer screens only: the phone menu always shows names and sign out */
@media (min-width: 861px) {
  body.mini .sidebar { width: 68px; }
  body.mini .sidebar .brand div, body.mini .sidebar .group, body.mini .sidebar nav a span, body.mini .sidebar .me, body.mini .sidebar .collapse span { display: none; }
  body.mini .sidebar nav a { justify-content: center; }
}
.mainwrap { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.stickytop { position: sticky; top: 0; z-index: 20; }
.toolbar { background: rgba(242,244,248,.92); backdrop-filter: blur(6px); display: flex; align-items: center; gap: 12px; padding: 12px 24px; border-bottom: 1px solid var(--line); }
.toolbar .menu { display: none; background: none; border: 0; cursor: pointer; color: var(--ink); padding: 4px; }
.crumbs { font-size: 13px; color: var(--muted); display: flex; gap: 6px; align-items: center; min-width: 0; }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--navy); }
.crumbs b { color: var(--ink); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gsearch { position: relative; margin-left: auto; width: min(360px, 40vw); }
.gsearch input[type=search] { padding-left: 34px; padding-right: 30px; }
.gsearch .icon { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.gsearch kbd { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); font: 11px var(--font); color: var(--muted); border: 1px solid var(--line); border-radius: 5px; padding: 1px 5px; background: #fff; }
.gsearch input:focus ~ kbd, .gsearch input:not(:placeholder-shown) ~ kbd { display: none; }
.gresults { position: absolute; top: calc(100% + 6px); left: 0; right: 0; background: #fff; border: 1px solid var(--line); border-radius: var(--radius-sm); box-shadow: var(--shadow); max-height: 60vh; overflow: auto; z-index: 40; }
.gresults a { display: block; padding: 9px 12px; text-decoration: none; color: var(--ink); border-bottom: 1px solid var(--soft); }
.gresults a:hover, .gresults a.on { background: var(--navy-soft); }
.gresults small { display: block; color: var(--muted); }
/* Read by screen readers, not shown */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
main { padding: 24px; max-width: 1360px; width: 100%; margin: 0 auto; }
.pagehead { display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.pagehead p { margin: 4px 0 0; color: var(--muted); }

/* ── surfaces ── */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; }
.card + .card { margin-top: 16px; }
.card.flat { box-shadow: none; }
.section-title { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.section-title h2 { margin: 0; }

/* ── controls ── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; border: 1px solid var(--line); background: #fff; padding: 8px 14px; min-height: 38px; border-radius: var(--radius-sm); cursor: pointer; text-decoration: none; color: var(--ink); font-weight: 500; white-space: nowrap; }
.btn:hover { border-color: #b9c3d6; background: var(--soft); }
.btn.primary { background: var(--navy); border-color: var(--navy); color: #fff; }
.btn.primary:hover { background: var(--navy-dark); }
.btn.accent { background: var(--gold); border-color: var(--gold); color: var(--navy-dark); }
.btn.danger { color: var(--bad); }
.btn.danger:hover { background: var(--bad-soft); border-color: #f2c4bf; }
.btn.ghost { border-color: transparent; background: transparent; }
.btn:disabled { opacity: .55; cursor: default; }
.btn.small { padding: 4px 10px; min-height: 30px; font-size: 13px; }
input[type=text], input[type=email], input[type=url], input[type=date], input[type=number], input[type=search], select, textarea {
  border: 1px solid #d6dce6; border-radius: var(--radius-sm); padding: 8px 11px; background: #fff; width: 100%; min-height: 40px; }
textarea { min-height: 96px; resize: vertical; }
input[type=file] { width: 100%; max-width: 100%; min-width: 0; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--navy); box-shadow: 0 0 0 3px rgba(0, 49, 144, .15); }
.btn:focus-visible, a:focus-visible, button:focus-visible, .seg button:focus-visible, [tabindex]:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
label.field { display: block; }
label.field > span { display: block; font-size: 13px; color: var(--muted); margin-bottom: 4px; font-weight: 500; }
.check { display: inline-flex; gap: 8px; align-items: center; }
.check input { width: 18px; height: 18px; }

/* segmented choice (attendance, phases, tabs) */
.seg { display: inline-flex; border: 1px solid #d6dce6; border-radius: var(--radius-sm); overflow: hidden; background: #fff; }
.seg button { border: 0; border-right: 1px solid #d6dce6; background: transparent; padding: 7px 13px; min-height: 38px; cursor: pointer; font-weight: 500; color: var(--text); }
.seg button:last-child { border-right: 0; }
.seg button.on { background: var(--navy); color: #fff; }
.seg button.on.P { background: var(--good); }
.seg button.on.E { background: #9a6100; } /* 5.1 to 1 with white text */
.seg button.on.U { background: var(--bad); }

/* tabs */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin: 0 0 18px; overflow-x: auto; }
.tabs button, .tabs a { border: 0; background: none; padding: 10px 14px; cursor: pointer; color: var(--muted); font-weight: 500; border-bottom: 3px solid transparent; margin-bottom: -1px; text-decoration: none; white-space: nowrap; }
.tabs .on { color: var(--navy); border-bottom-color: var(--gold); font-weight: 600; }
.tabs .count { font-size: 12px; background: var(--soft); border-radius: 999px; padding: 1px 7px; margin-left: 4px; }

/* badges */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 500; background: var(--soft); border: 1px solid var(--line); color: var(--text); white-space: nowrap; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .55; }
.badge.plain::before { display: none; }
.badge.good { background: var(--good-soft); border-color: #bfe0cb; color: var(--good); }
.badge.warn { background: var(--warn-soft); border-color: var(--gold-line); color: var(--warn); }
.badge.bad { background: var(--bad-soft); border-color: #f2c4bf; color: var(--bad); }
.badge.brand { background: var(--navy-soft); border-color: #c7d4f0; color: var(--navy); }

/* tables */
table.list { width: 100%; border-collapse: collapse; }
table.list th { text-align: left; font-size: 12px; color: var(--muted); font-weight: 600; padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; text-transform: uppercase; letter-spacing: .04em; }
table.list td { padding: 11px 12px; border-bottom: 1px solid var(--soft); vertical-align: middle; }
table.list tr:last-child td { border-bottom: 0; }
table.list tr.click { cursor: pointer; }
table.list tr.click:hover td { background: #f8faff; }
table.list td .sub { display: block; font-size: 13px; color: var(--muted); }
table.list td > a:first-child { font-weight: 600; text-decoration: none; color: var(--ink); }
table.list td > a:first-child:hover { color: var(--navy); text-decoration: underline; }
table.list select { min-width: 200px; }
.tablewrap { overflow-x: auto; }
td.barcell { width: 45%; }

/* filters */
.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.filters .grow { flex: 1 1 260px; }
.filters > select { width: auto; flex: 0 1 auto; max-width: 100%; min-width: 0; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { border: 1px solid #d6dce6; background: #fff; border-radius: 999px; padding: 5px 13px; cursor: pointer; font-size: 13px; font-weight: 500; color: var(--text); }
.chip.on { background: var(--navy); border-color: var(--navy); color: #fff; }

/* A button that reads as text (the subject of an Outbox message) */
.linkbtn { background: none; border: 0; padding: 0; font: inherit; color: inherit; cursor: pointer; text-align: left; }
.linkbtn:hover b { text-decoration: underline; }

/* People > Duplicates */
.dupperson { display: flex; gap: 12px; align-items: flex-start; padding: 10px 0; border-top: 1px solid var(--line); }
.dupgroup > .dupperson:first-of-type { border-top: 0; }
.dupperson input[type=radio] { margin-top: 4px; flex: none; }
.dupperson .grow { min-width: 0; overflow-wrap: anywhere; }
.stack.tight > * + * { margin-top: 4px; }
/* Tick boxes in a list, one per line */
.stack > label.check { display: flex; }

/* Zeffy, on Settings and on a profile */
.zeffycampaigns select { min-width: 170px; }
.zeffyfee { align-items: center; }
/* Mailchimp, on Settings and on a profile */
.mailchimpcard ul.plain li + li { margin-top: 4px; }
.mctags { display: inline-flex; flex-wrap: wrap; gap: 4px; }

/* Settings > Messages */
details.msg { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px 14px; }
details.msg summary { cursor: pointer; }
div.msg { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px 14px; }
.fills code { background: var(--soft); border-radius: 4px; padding: 1px 4px; font-size: 12px; }

/* Notes pinned to the top of a profile */
.pinned { border-left: 4px solid var(--gold); }
.pinned .section-title .icon { color: var(--gold); }
.pins { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.pins li + li { border-top: 1px solid var(--line); padding-top: 10px; }

/* Today's follow-ups: the bar under the top bar while a run is on */
.runbar { background: #fff; border-bottom: 3px solid var(--gold); padding: 10px 24px 12px; display: grid; gap: 8px; box-shadow: var(--shadow); max-height: 60vh; overflow: auto; }
.runbar.done { border-bottom-color: var(--good); }
.runbar .runhead { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.runbar .finish { gap: 6px; }
.runbar .finish .field { margin: 0; }

/* profile header (business card) */
.bizcard { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.avatar { width: 68px; height: 68px; border-radius: 50%; background: var(--navy); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 24px; font-weight: 600; flex: none; box-shadow: 0 0 0 4px var(--gold-soft); }
.bizcard .who { flex: 1; min-width: 220px; }
.bizcard .meta { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.bizcard .contact { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 8px; font-size: 14px; }
.bizcard .contact a { display: inline-flex; gap: 6px; align-items: center; text-decoration: none; }
.profile { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 18px; align-items: start; }
.side > * + * { margin-top: 14px; }
.side dl.facts { grid-template-columns: auto 1fr; gap: 6px 12px; }
.nextstep { border-radius: var(--radius); }
dl.facts { display: grid; grid-template-columns: 160px 1fr; gap: 10px 16px; margin: 0; }
dl.facts dt { color: var(--muted); font-size: 13px; }
dl.facts dd { margin: 0; color: var(--ink); overflow-wrap: anywhere; }
dl.facts dd.none { color: var(--muted); }
.nextstep { background: var(--gold-soft); border: 1px solid var(--gold-line); border-radius: var(--radius-sm); padding: 12px 14px; color: var(--ink); }
.nextstep b { display: block; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--warn); margin-bottom: 2px; }

/* activity timeline */
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { display: grid; grid-template-columns: 34px 1fr auto; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--soft); align-items: start; }
.timeline .when .badge { margin-left: 6px; }
.timeline .dot.call { background: var(--good-soft); color: var(--good); }
.timeline .dot.email { background: var(--gold-soft); color: var(--warn); }
.timeline .when { font-size: 12px; color: var(--muted); }

/* pipeline */
.board { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 10px; align-items: flex-start; }
.col { background: #e9edf4; border-radius: var(--radius); min-width: 250px; width: 250px; flex: 1 0 250px; padding: 10px; }
.col h4 { margin: 2px 4px 10px; font-size: 13px; display: flex; justify-content: space-between; color: var(--ink); }
.col.over { outline: 2px dashed var(--gold); }
.pcard { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 11px; margin-bottom: 8px; cursor: grab; box-shadow: 0 1px 2px rgba(16,32,64,.04); }
.pcard a { font-weight: 600; text-decoration: none; color: var(--ink); }
.pcard .hint { font-size: 12px; color: var(--muted); margin-top: 6px; }
.pcard select { margin-top: 8px; font-size: 13px; padding: 4px 6px; min-height: 32px; }

/* cohort: class entry */
.entry { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: #fff; container: entry / inline-size; }
/* Every row, the headings included, uses the same fixed columns, so each heading sits over its buttons */
.entry-row { display: grid; grid-template-columns: minmax(170px, 300px) 116px 150px 150px 92px 72px; justify-content: start; gap: 10px; align-items: start; padding: 10px 14px; border-bottom: 1px solid var(--soft); }
.entry-row .seg { min-width: max-content; }
.entry-row > .seg { justify-self: start; }
.entry-row .seg button { padding: 6px 10px; min-width: 33px; }
.entry-row .mini-label { display: none; font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.entry-row:last-child { border-bottom: 0; }
.entry-row.head { background: var(--soft); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 600; }
.entry-row.blank { background: #fffdf7; }
.entry-row .name a { font-weight: 600; text-decoration: none; color: var(--ink); }
.entry-row select { min-height: 36px; padding: 5px 8px; }
.entry-row .total { font-weight: 600; color: var(--ink); text-align: center; }
.entry-row.head { align-items: end; }
.entry-row.head > span:nth-child(5) { text-align: center; }
.entry-row:not(.head) > .total, .entry-row:not(.head) > .save-state { padding-top: 8px; }
.save-state { font-size: 12px; color: var(--muted); }
.save-state.ok { color: var(--good); }
.save-state.bad { color: var(--bad); display: grid; gap: 3px; justify-items: start; }

/* cohort: full tracker grid */
.gridwrap { overflow: auto; max-height: 70vh; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
table.att { border-collapse: separate; border-spacing: 0; font-size: 13px; }
table.att th, table.att td { border-bottom: 1px solid var(--line); border-right: 1px solid var(--soft); padding: 5px 7px; text-align: center; white-space: nowrap; background: #fff; }
table.att thead th { position: sticky; top: 0; z-index: 2; background: var(--soft); font-size: 11px; color: var(--muted); }
table.att .name { position: sticky; left: 0; z-index: 1; text-align: left; min-width: 180px; }
table.att .name a { font-weight: 600; text-decoration: none; color: var(--ink); }
table.att thead .name { z-index: 3; }
.cellbtn { border: 1px solid transparent; background: transparent; border-radius: 6px; min-width: 48px; padding: 3px 4px; cursor: pointer; }
.cellbtn:hover { border-color: var(--line); background: var(--soft); }
.mark-P { color: var(--good); font-weight: 700; }
.mark-E { color: #9a6200; font-weight: 700; }
.mark-U { color: var(--bad); font-weight: 700; }
.eng { display: block; font-size: 11px; color: var(--muted); }
.sessionhead { background: transparent; border: 0; cursor: pointer; font-size: 11px; color: var(--ink); }

/* stats */
.kpi { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; margin-bottom: 18px; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); text-align: left; display: block; color: inherit; text-decoration: none; }
button.stat, a.stat { cursor: pointer; font: inherit; width: 100%; }
button.stat:hover, a.stat:hover { border-color: var(--navy); }
.stat b { display: block; font-size: 28px; line-height: 1.1; color: var(--ink); font-weight: 600; }
.stat span { font-size: 13px; color: var(--muted); }
.stat.attn { border-left: 4px solid var(--gold); }

/* home */
.home { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 18px; align-items: start; }
.todo { list-style: none; margin: 0; padding: 0; }
.todo li { display: flex; gap: 12px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--soft); }
.todo li:last-child { border-bottom: 0; }
.card.today { margin-bottom: 18px; border-left: 4px solid var(--navy); }
.todo .n { min-width: 38px; height: 38px; border-radius: 10px; background: var(--gold-soft); color: var(--warn); font-weight: 700; display: flex; align-items: center; justify-content: center; }

/* modal */
.overlay { position: fixed; inset: 0; background: rgba(10, 22, 50, .4); display: flex; align-items: center; justify-content: center; z-index: 50; padding: 16px; }
.modal { background: #fff; border-radius: 14px; max-width: 560px; width: 100%; max-height: 90vh; overflow: auto; padding: 22px; box-shadow: 0 20px 60px rgba(0,0,0,.25); }
.modal h2 { margin-bottom: 14px; }
.modal .actions { margin-top: 18px; }
.choices { display: flex; gap: 6px; flex-wrap: wrap; }
.choices .btn.on { background: var(--navy); color: #fff; border-color: var(--navy); }

/* messages */
.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 11px 18px; border-radius: 10px; z-index: 60; max-width: 90vw; box-shadow: var(--shadow); }
.toast.bad { background: var(--bad); display: flex; align-items: center; gap: 12px; }
.toast-close { background: transparent; border: 1px solid rgba(255,255,255,.5); color: #fff; border-radius: 6px; min-width: 32px; min-height: 32px; font-size: 18px; line-height: 1; cursor: pointer; }
.notice { background: var(--gold-soft); border: 1px solid var(--gold-line); padding: 11px 14px; border-radius: var(--radius-sm); color: var(--ink); }
.error { background: var(--bad-soft); border: 1px solid #f2c4bf; color: var(--bad); padding: 11px 14px; border-radius: var(--radius-sm); }
.empty { color: var(--muted); padding: 28px; text-align: center; }
.skeleton { height: 14px; border-radius: 6px; background: linear-gradient(90deg, #eef1f6, #f7f9fc, #eef1f6); background-size: 200% 100%; animation: shimmer 1.2s infinite; margin: 10px 0; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* reports */
.bar { height: 10px; background: var(--soft); border-radius: 5px; overflow: hidden; border: 1px solid var(--line); }
.bar > i { display: block; height: 100%; background: var(--navy); }
.dist { display: grid; grid-template-columns: 110px 1fr 40px; gap: 8px; align-items: center; font-size: 13px; margin: 4px 0; }
.qcard { border: 1px solid var(--line); border-radius: 10px; padding: 14px; margin-bottom: 12px; }

/* survey preview */
.preview { background: var(--soft); border: 1px dashed #c9d2e2; border-radius: var(--radius); padding: 18px; }
.preview .pq { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; margin-top: 10px; }
.preview .scale { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-top: 8px; }
.preview .scale span { border: 1px solid var(--line); border-radius: 8px; padding: 7px; font-size: 13px; text-align: center; }

/* login */
.login { max-width: 400px; margin: 14vh auto; text-align: center; }
.login .mark { width: 54px; height: 54px; border-radius: 14px; background: var(--gold); color: var(--navy-dark); font-weight: 700; display: inline-flex; align-items: center; justify-content: center; font-size: 18px; margin-bottom: 10px; }
.login .btn { width: 100%; padding: 12px; font-size: 15px; }

pre.body { white-space: pre-wrap; font: inherit; margin: 0; }

/* printable agreement */
.printdoc { max-width: 780px; margin: 0 auto; background: #fff; padding: 40px; border: 1px solid var(--line); border-radius: var(--radius); }
.printdoc img.sig { max-width: 320px; border-bottom: 1px solid var(--ink); display: block; margin: 8px 0; }
@media print {
  body { background: #fff; }
  .sidebar, .toolbar, #runbar, .noprint, .tabs, .pagehead .row, #preview-banner, .toast { display: none !important; }
  .printonly { display: block; }
  .card { box-shadow: none; break-inside: avoid; }
  details { break-inside: avoid; }
  main { padding: 0; }
  .printdoc { border: 0; padding: 0; }
}

/* small pieces used across screens */
.grow { flex: 1 1 220px; min-width: 0; }
.row.tight { flex-wrap: nowrap; }
.row.tight .grow { flex: 1 1 auto; }
.sub { display: block; font-size: 13px; color: var(--muted); font-weight: 400; }
.req { color: var(--bad); }
a.badge { text-decoration: none; }
.btn .icon, .seg .icon { width: 16px; height: 16px; }
.bizcard .contact .icon { width: 15px; height: 15px; }
.avatar.sm { width: 34px; height: 34px; font-size: 13px; box-shadow: none; }
.namecell { display: flex; gap: 10px; align-items: center; min-width: 200px; }
.namecell a { font-weight: 600; text-decoration: none; color: var(--ink); }
.chip .count { margin-left: 6px; opacity: .75; font-size: 12px; }
.sidebar .me span { display: block; color: #9fb1d8; font-size: 12px; }
.todo li .grow a { font-weight: 600; text-decoration: none; color: var(--ink); }
.todo li .bar { margin-top: 6px; }
.card.empty .icon { width: 30px; height: 30px; color: var(--good); }

/* survey workspace: editor on the left, live member preview on the right */
.workspace { display: grid; grid-template-columns: minmax(0, 1fr) minmax(280px, 400px); gap: 18px; align-items: start; }
.preview-wrap { position: sticky; top: 76px; }
.preview .opts { list-style: none; padding: 0; margin: 8px 0 0; display: grid; gap: 4px; font-size: 14px; }
.preview .fakebox { height: 64px; border: 1px solid var(--line); border-radius: 8px; background: #fff; margin-top: 8px; }

/* tasks */
.tasklist { list-style: none; margin: 0; padding: 0; }
.task-row { display: flex; gap: 12px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--soft); }
.task-row:last-child { border-bottom: 0; }
.task-row .dot, .timeline .dot { width: 34px; height: 34px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: var(--navy-soft); color: var(--navy); flex: none; }
.task-row .dot.call { background: var(--good-soft); color: var(--good); }
.task-row .dot.email { background: var(--gold-soft); color: var(--warn); }
.task-row .dot .icon { width: 16px; height: 16px; }
.task-row.done .linkish, .task-row.done b, .task-row.canceled b { text-decoration: line-through; color: var(--muted); }
.task-row .sub a { color: var(--navy); }
.task-row .sub a[href^="tel:"] { white-space: nowrap; }
.task-actions { display: flex; gap: 6px; flex: none; }
.linkish { background: none; border: 0; padding: 0; font: inherit; font-weight: 600; color: var(--ink); cursor: pointer; text-align: left; }
.linkish:hover { color: var(--navy); text-decoration: underline; }
.linkish.small { font-size: 14px; font-weight: 500; color: var(--navy); }
.picklist { display: grid; gap: 4px; margin-top: 6px; }
.pick { text-align: left; background: #fff; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 8px 10px; cursor: pointer; font-weight: 500; }
.pick:hover { border-color: var(--navy); background: var(--navy-soft); }
.pick small { display: block; color: var(--muted); font-weight: 400; }
.checklist { max-height: 260px; overflow: auto; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px; }
.checklist > * + * { margin-top: 6px; }
.steprow { display: grid; grid-template-columns: auto 80px 120px 1fr auto; gap: 8px; align-items: center; }
ol.steps { margin: 6px 0 10px; padding-left: 20px; }
ol.steps li { margin: 4px 0; }
.card.off { opacity: .7; }

/* survey results */
label.inline { display: inline-flex; gap: 6px; align-items: center; font-size: 13px; color: var(--muted); }
label.inline input { width: auto; }
.filters > input, .filters > label { flex: 0 1 auto; }
table.crosstab th[scope=row] { text-align: left; font-weight: 600; color: var(--ink); text-transform: none; letter-spacing: 0; font-size: 13px; }
table.trend td.barcell { min-width: 120px; width: 25%; }
.printonly { display: none; }

/* alumni events */
.attend-row { display: grid; grid-template-columns: minmax(160px, 1fr) 150px 120px 72px; gap: 10px; align-items: center; padding: 10px 14px; border-bottom: 1px solid var(--soft); }
.attend-row:last-child { border-bottom: 0; }
.attend-row .name a { font-weight: 600; text-decoration: none; color: var(--ink); }
.attend-row .total { text-align: left; }
.btn.attend { justify-content: flex-start; }
.btn.attend.on { background: var(--good); border-color: var(--good); color: #fff; }
ul.eventlist { list-style: none; padding: 0; margin: 8px 0 0; display: grid; gap: 4px; }
ul.eventlist li.went { color: var(--ink); font-weight: 500; }
.schedform { border-top: 1px solid var(--line); padding-top: 14px; }

/* KPIs */
.kpigrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(420px, 1fr)); gap: 16px; align-items: start; }
.kpigrid > .card { margin: 0; }
.kpicard .section-title { align-items: flex-start; }
.kpicard h2 { font-size: 16px; flex: 1 1 0; min-width: 0; padding-top: 3px; }
.kpiright { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex: none; }
.kpinum { min-width: 28px; height: 28px; border-radius: 8px; background: var(--navy); color: #fff; font-weight: 600; font-size: 14px; display: inline-flex; align-items: center; justify-content: center; }
.kpiscore { display: flex; align-items: baseline; gap: 4px; }
.kpiscore b { font-size: 24px; color: var(--ink); font-weight: 600; }
.kpiscore span { font-size: 12px; color: var(--muted); }
table.kpitable td { padding: 8px 10px; }
table.kpitable td:first-child { padding-left: 0; }
table.kpitable td.num { text-align: right; font-weight: 600; color: var(--ink); }
table.kpitable td:last-child { text-align: right; padding-right: 0; min-width: 96px; }
.healthcard { display: grid; grid-template-columns: minmax(220px, 1.1fr) 2fr auto; gap: 24px; align-items: center; border-left: 4px solid var(--gold); }
.healthcard h3 { margin: 0; font-size: 13px; color: var(--ink); }
.healthscore { display: flex; align-items: baseline; gap: 6px; margin: 4px 0; }
.healthscore b { font-size: 46px; line-height: 1.1; color: var(--navy); font-weight: 600; }
.healthscore span { color: var(--muted); }
.domains { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 20px; }
.domain b { display: block; font-size: 20px; color: var(--ink); font-weight: 600; margin: 2px 0 4px; }
h2.kpihead { margin: 26px 0 12px; }
.surveypick .check { display: flex; }
details.kpimore { margin-top: 6px; border-top: 1px solid var(--soft); padding-top: 8px; }
details.kpimore summary { cursor: pointer; font-size: 13px; color: var(--navy); font-weight: 500; }
.grid4 { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; }
.partnerrow { display: grid; grid-template-columns: minmax(160px, 1.2fr) minmax(160px, 1fr) 90px minmax(180px, 2fr) auto; gap: 8px; align-items: center; }
.partnerrow .pct { display: flex; align-items: center; gap: 4px; }
table.kpiinputs th.grp { text-align: center; color: var(--ink); background: var(--navy-soft); }
table.kpiinputs thead tr:nth-child(2) th { top: 29px; }
table.kpiinputs td.inp { padding: 3px 4px; }
table.kpiinputs td.inp input { width: 76px; padding: 5px 6px; text-align: right; }
table.kpiinputs td.inp select { width: 70px; padding: 5px 6px; }
table.kpiinputs td .sub { white-space: nowrap; }
table.kpiinputs .saving { border-color: var(--gold); }
table.kpiinputs .ok { border-color: var(--good); background: var(--good-soft); }
table.kpiinputs .bad { border-color: var(--bad); background: var(--bad-soft); }
@media (max-width: 1100px) {
  .healthcard { grid-template-columns: 1fr; gap: 16px; }
}
/* The bigger buttons on a touch screen need wider columns */
@media (pointer: coarse) {
  .entry-row { grid-template-columns: minmax(170px, 300px) 140px 184px 184px 92px 72px; }
}
@media (max-width: 560px) {
  .kpigrid { grid-template-columns: 1fr; }
  .domains { grid-template-columns: 1fr 1fr; gap: 10px; }
  .healthscore b { font-size: 38px; }
  /* The goal moves under its number instead of leaving the screen */
  table.kpitable tr { display: grid; grid-template-columns: 1fr auto; align-items: baseline; border-bottom: 1px solid var(--soft); }
  table.kpitable td { border-bottom: 0; }
  table.kpitable td:first-child { grid-column: 1 / -1; padding: 8px 0 0; }
  table.kpitable td.num { text-align: left; padding: 2px 0 8px; }
  table.kpitable td:last-child { min-width: 0; padding: 2px 0 8px; }
  .partnerrow { grid-template-columns: 1fr; }
}

/* Program schedule, milestones, orientation */
.grid3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.grid3 textarea { min-height: 170px; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.checkgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 6px 14px; margin-top: 6px; }
.furow { display: grid; grid-template-columns: minmax(180px, 2fr) minmax(130px, 1fr) 150px auto; gap: 8px; align-items: center; }
.msblock { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px 14px; background: var(--soft); }
.msblock > summary { cursor: pointer; font-weight: 500; color: var(--ink); }
.msblock[open] > summary { margin-bottom: 10px; }
.pattern { border: 1px dashed var(--line); border-radius: var(--radius-sm); padding: 12px 14px; }
.pattern .row { align-items: center; }
.pattern input[type=number] { width: 70px; }
table.schedtable td { padding: 6px 8px; }
table.schedtable td.wk input { width: 70px; }
table.schedtable select { min-width: 0; }
table.att.appts td { min-width: 120px; }
table.att.appts .cellbtn { min-width: 110px; }
table.att.appts tfoot td, table.att.appts tfoot th { background: var(--soft); color: var(--muted); font-size: 12px; }
table.kpiinputs td.linked { font-size: 13px; color: var(--ink); }
.modal h3 { margin-top: 4px; }
/* Less motion for people who ask their device for it */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* ── responsive ── */
/* Class entry: the columns need 828 pixels of card (920 with touch sized buttons). Whenever the
   card is narrower, at any window size, zoom or with the menu open, each row stacks instead of
   running past the card's edge, where Class total and Saved would be cut off. */
@container entry (max-width: 827px) {
  .entry-row { grid-template-columns: 1fr 1fr; }
  .entry-row .mini-label { display: block; }
  .entry-row.head { display: none; }
  .entry-row .name { grid-column: 1 / -1; }
  .entry-row > .seg { grid-column: 1 / -1; justify-self: start; }
  .entry-row .seg button { padding: 8px 16px; }
  .entry-row .total { text-align: left; }
}
@media (pointer: coarse) {
  @container entry (max-width: 919px) {
    .entry-row { grid-template-columns: 1fr 1fr; }
    .entry-row .mini-label { display: block; }
    .entry-row.head { display: none; }
    .entry-row .name { grid-column: 1 / -1; }
    .entry-row > .seg { grid-column: 1 / -1; justify-self: start; }
    .entry-row .seg button { padding: 8px 16px; }
    .entry-row .total { text-align: left; }
  }
}
@media (max-width: 1100px) {
  .profile, .home, .workspace { grid-template-columns: minmax(0, 1fr); }
  .profile .side { order: -1; display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; align-items: start; }
  .profile .side > * + * { margin-top: 0; }
  .preview-wrap { position: static; }
}
@media (max-width: 860px) {
  .sidebar { position: fixed; left: 0; top: 0; transform: translateX(-100%); transition: transform .2s ease; }
  body.nav-open .sidebar { transform: none; box-shadow: 0 10px 40px rgba(0,0,0,.3); }
  .toolbar .menu { display: inline-flex; }
  .toolbar { padding: 10px 14px; }
  .runbar { padding: 8px 14px 10px; max-height: 50vh; }
  .gsearch { width: auto; flex: 1; }
  .gsearch kbd { display: none; }
  .crumbs { display: none; }
  main { padding: 16px; }
  dl.facts { grid-template-columns: 1fr; gap: 2px; }
  dl.facts dd { margin-bottom: 8px; }
  table.list.cards thead { display: none; }
  table.list.cards tr { display: block; border: 1px solid var(--line); border-radius: 10px; margin-bottom: 10px; padding: 6px 4px; background: #fff; }
  table.list.cards td { display: block; border: 0; padding: 3px 10px; overflow-wrap: anywhere; }
  table.list.cards td[data-label]::before { content: attr(data-label) ": "; color: var(--muted); font-size: 12px; }
  /* A long status in a stacked row wraps instead of running off a narrow phone */
  table.list.cards td .badge { white-space: normal; border-radius: 12px; }
}
/* Touch targets of at least 44 pixels where staff tap all day: phones, tablets, any touch screen */
@media (max-width: 860px), (pointer: coarse) {
  .entry-row .seg button, .seg button { min-height: 44px; min-width: 44px; }
  .choices .btn, .btn, .btn.small { min-height: 44px; }
  table.att .cellbtn { min-height: 44px; }
  .chip { min-height: 44px; }
  .toolbar .menu { min-width: 44px; min-height: 44px; align-items: center; justify-content: center; }
  .sidebar nav a, .sidebar .collapse { min-height: 44px; }
  select, .pcard select, .entry-row select, input[type=text], input[type=email], input[type=url], input[type=date], input[type=number], input[type=search] { min-height: 44px; }
}
@media (max-width: 560px) {
  .furow { grid-template-columns: 1fr 1fr; }
  .furow input[name=fu_title] { grid-column: 1 / -1; }
  .kpi { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .stat { padding: 12px 14px; }
  .stat b { font-size: 22px; }
  h1 { font-size: 22px; }
  .pagehead .row { width: 100%; }
  .attend-row { grid-template-columns: 1fr auto; }
  .attend-row .name { grid-column: 1 / -1; }
  .task-row { flex-wrap: wrap; }
  .task-row .grow { flex-basis: calc(100% - 46px); }
  .task-row > .badge { margin-left: 46px; }
  .steprow { grid-template-columns: auto 70px 1fr; }
  .steprow input[name=title] { grid-column: 1 / -1; }
}

/* Class entry on a narrow card: presence and contribution each take a full line */
@container entry (max-width: 520px) {
  .entry-row > div:nth-child(3), .entry-row > div:nth-child(4) { grid-column: 1 / -1; }
}

/* Quarterly check-ins on a profile: one column per quarter */
table.checkins th[scope=row] { text-align: left; vertical-align: top; font-weight: 600; min-width: 8rem; white-space: normal; text-transform: none; letter-spacing: normal; font-size: 14px; color: var(--text); }
table.checkins thead .sub { text-transform: none; letter-spacing: normal; font-weight: 400; }
/* The question stays in view while the quarters scroll sideways on a narrow screen */
table.checkins th:first-child { position: sticky; left: 0; z-index: 1; background: var(--card); }
table.checkins td { vertical-align: top; min-width: 8.5rem; }
table.checkins pre.body { margin: 0; }
ul.plain { list-style: none; margin: 0; padding: 0; }
/* Each response on survey results: the name opens the profile, the button shows the answers */
ul.responses > li.resp { border-top: 1px solid var(--soft); padding: 8px 0; }
ul.responses > li.resp:first-child { border-top: 0; }
ul.responses .row { align-items: center; flex-wrap: wrap; }
ul.responses .answers { margin: 8px 0 2px; padding-left: 18px; }
ul.plain li + li { margin-top: 2px; }

/* The master calendar: a month by day, and the same items day by day below it */
.calwrap { container: cal / inline-size; }
.calgrid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; }
.calhead { background: var(--soft); font-size: 12px; font-weight: 600; color: var(--muted); padding: 6px 8px; text-transform: uppercase; letter-spacing: .04em; }
.calday { min-height: 96px; border-top: 1px solid var(--line); border-left: 1px solid var(--line); padding: 4px 6px 6px; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.calday:nth-child(7n + 1) { border-left: 0; }
.calday.out { background: var(--soft); }
.calday.out .num { color: var(--muted); }
.calday.today .num { background: var(--navy); color: #fff; border-radius: 10px; padding: 0 7px; }
.calday .num { font-size: 12px; font-weight: 600; align-self: flex-start; }
/* Calendar items and "more" are at least 24 pixels tall to click, 44 on tablets and touch screens (below) */
.calitem { display: block; width: 100%; min-height: 24px; text-align: left; border: 0; border-left: 3px solid var(--navy); background: var(--navy-soft); color: var(--ink); font-size: 12px; line-height: 1.3; padding: 4px 5px; border-radius: 4px; cursor: pointer; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.calitem .when { font-weight: 600; margin-right: 4px; }
.calitem.k-event { border-left-color: var(--gold); background: #fff6e0; }
.calitem.k-deadline, .calitem.k-appointment_due { border-left-color: var(--bad); background: var(--bad-soft); }
.calitem.k-booking { border-left-color: var(--good); background: var(--good-soft); }
.calmore { min-height: 24px; border: 0; background: transparent; color: var(--navy); font-size: 12px; text-align: left; padding: 3px 5px; cursor: pointer; }
ul.calagenda li { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 4px 0; }
ul.calagenda .calitem { width: auto; max-width: 100%; white-space: normal; }
@media (max-width: 860px), (pointer: coarse) {
  .calitem, .calmore { min-height: 44px; padding-top: 12px; padding-bottom: 12px; }
}
/* On a narrow card the month moves under the heading as the day by day list, which has every
   item; the grid would be too small to read or tap */
.calnarrow { display: none; }
@container cal (max-width: 640px) {
  .calgrid { display: none; }
  .calnarrow { display: block; }
}
table.list.plan td { vertical-align: top; }
table.list.plan .planactions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
table.list.plan td .sub { overflow-wrap: anywhere; }

