/* AVC-TIMS — Aurum Vitae Consulting brand: navy, blue, gold */
:root {
  --navy: #051338; --navy-2: #0c1f52; --blue: #0262fe; --blue-soft: #e8f0ff; --gold: #fec83c;
  --ink: #111827; --muted: #5b6477; --line: #e2e6ef; --bg: #f4f6fb; --card: #fff;
  --ok: #0f7b4f; --ok-soft: #e3f5ec; --warn: #9a6200; --warn-soft: #fff3d6; --bad: #b42318; --bad-soft: #fde8e6;
  --radius: 10px; --shadow: 0 1px 2px rgba(5,19,56,.06), 0 4px 16px rgba(5,19,56,.05);
  font-family: Poppins, "Segoe UI", system-ui, -apple-system, Roboto, Helvetica, Arial, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--ink); font-size: 15px; line-height: 1.45; }
h1 { font-size: 1.45rem; margin: 0; } h2 { font-size: 1.1rem; margin: 0 0 .6rem; } h3 { font-size: .95rem; margin: 0 0 .4rem; }
a { color: var(--blue); text-decoration: none; } a:hover { text-decoration: underline; }
.muted { color: var(--muted); } .small { font-size: .85rem; } .right { text-align: right; } .nowrap { white-space: nowrap; }
.hidden { display: none !important; }

/* shell */
.shell { display: grid; grid-template-columns: 232px minmax(0, 1fr); min-height: 100%; }
.shell > div { min-width: 0; }   /* the page never grows wider than the window: wide tables scroll inside their own box (1.4) */
.side { background: var(--navy); color: #fff; padding: 18px 14px; display: flex; flex-direction: column; gap: 4px; position: sticky; top: 0; height: 100vh; }
.brand { background: #fff; border-radius: 8px; padding: 6px 10px; margin-bottom: 4px; display: flex; justify-content: center; }
.brand img { height: 46px; display: block; }
.product { color: var(--gold); font-weight: 700; letter-spacing: .14em; font-size: .72rem; padding: 4px 6px 12px; text-transform: uppercase; }
.side a.nav { color: #dfe6fb; padding: 9px 12px; border-radius: 8px; display: flex; justify-content: space-between; align-items: center; font-weight: 500; }
.side a.nav:hover { background: var(--navy-2); text-decoration: none; }
.side a.nav.on { background: var(--blue); color: #fff; }
.side .pill { background: var(--gold); color: var(--navy); border-radius: 99px; padding: 0 8px; font-size: .75rem; font-weight: 700; }
.side .who { margin-top: auto; font-size: .82rem; color: #b9c4e6; padding: 10px 6px 0; border-top: 1px solid rgba(255,255,255,.14); }
.side .who b { color: #fff; display: block; }
.main { padding: 22px 26px 60px; min-width: 0; }
.topbar { display: none; }
.head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.head .sub { color: var(--muted); margin-top: 2px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.crumb { font-size: .85rem; color: var(--muted); margin-bottom: 4px; }

/* building blocks */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px 18px; margin-bottom: 16px; }
.grid { display: grid; gap: 14px; } .g2 { grid-template-columns: repeat(2, minmax(0,1fr)); } .g3 { grid-template-columns: repeat(3, minmax(0,1fr)); } .g4 { grid-template-columns: repeat(4, minmax(0,1fr)); }
.kpi { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; border-top: 3px solid var(--blue); }
.kpi.gold { border-top-color: var(--gold); } .kpi .n { font-size: clamp(1.15rem, 2.1vw, 1.6rem); font-weight: 700; color: var(--navy); overflow-wrap: anywhere; }
.kpi { min-width: 0; } .kpi .l { color: var(--muted); font-size: .85rem; }
.dl { display: grid; grid-template-columns: max-content 1fr; gap: 6px 18px; margin: 0; } .dl dt { color: var(--muted); } .dl dd { margin: 0; font-weight: 500; overflow-wrap: anywhere; }
button, .btn { font: inherit; border: 1px solid var(--line); background: #fff; color: var(--ink); padding: 8px 14px; border-radius: 8px; cursor: pointer; font-weight: 600; display: inline-flex; align-items: center; gap: 6px; }
button:hover { border-color: #c5ccdc; } button:disabled { opacity: .55; cursor: not-allowed; }
button.primary { background: var(--blue); border-color: var(--blue); color: #fff; } button.primary:hover { background: #0153d8; }
button.gold { background: var(--gold); border-color: var(--gold); color: var(--navy); }
button.danger { color: var(--bad); border-color: #f1c2bd; } button.link { border: 0; background: none; color: var(--blue); padding: 2px 4px; font-weight: 600; }
button.sm { padding: 4px 10px; font-size: .85rem; }
.badge { display: inline-block; padding: 2px 9px; border-radius: 99px; font-size: .78rem; font-weight: 600; background: #eef1f7; color: #3b4660; white-space: nowrap; }
.badge.ok { background: var(--ok-soft); color: var(--ok); } .badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.bad { background: var(--bad-soft); color: var(--bad); } .badge.info { background: var(--blue-soft); color: #0146b8; }
.note { background: var(--blue-soft); border-left: 4px solid var(--blue); padding: 10px 14px; border-radius: 6px; margin-bottom: 14px; }
.note.warn { background: var(--warn-soft); border-left-color: var(--gold); } .note.bad { background: var(--bad-soft); border-left-color: var(--bad); }

/* tables */
.tablewrap { overflow-x: auto; max-width: 100%; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
table { border-collapse: collapse; width: 100%; font-size: .92rem; }
th { text-align: left; background: #f7f9fd; color: var(--muted); font-weight: 600; font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; padding: 9px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 9px 12px; border-bottom: 1px solid #eef1f6; vertical-align: middle; }
tr:last-child td { border-bottom: 0; } tr.click { cursor: pointer; } tr.click:hover td { background: #f9fbff; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
td input, td select { padding: 5px 7px; width: 84px; }
.empty { padding: 26px; text-align: center; color: var(--muted); }
.toolbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 10px; }
.toolbar input[type=search] { max-width: 280px; }

/* tabs */
.tabs { display: flex; gap: 2px; border-bottom: 2px solid var(--line); margin-bottom: 16px; overflow-x: auto; }
.tabs a { padding: 9px 14px; color: var(--muted); font-weight: 600; border-bottom: 3px solid transparent; margin-bottom: -2px; white-space: nowrap; }
.tabs a.on { color: var(--navy); border-bottom-color: var(--gold); } .tabs a:hover { text-decoration: none; color: var(--navy); }

/* forms */
label { display: block; font-weight: 600; font-size: .86rem; margin-bottom: 4px; }
label .req { color: var(--bad); } .hint { color: var(--muted); font-size: .8rem; margin-top: 3px; font-weight: 400; }
input, select, textarea { font: inherit; width: 100%; padding: 9px 11px; border: 1px solid #cfd5e3; border-radius: 8px; background: #fff; color: var(--ink); }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--blue); outline-offset: 1px; border-color: var(--blue); }
input[type=checkbox] { width: auto; margin-right: 8px; transform: scale(1.15); }
.fields { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 12px 14px; } .fields .full { grid-column: 1 / -1; }
.check { display: flex; align-items: flex-start; font-weight: 500; }
dialog { border: 0; border-radius: 14px; padding: 0; width: min(640px, 94vw); box-shadow: 0 20px 60px rgba(5,19,56,.35); }
dialog::backdrop { background: rgba(5,19,56,.55); }
dialog .dh { background: var(--navy); color: #fff; padding: 14px 20px; font-weight: 700; border-bottom: 3px solid var(--gold); }
dialog .db { padding: 18px 20px; max-height: 68vh; overflow: auto; } dialog .df { padding: 12px 20px 16px; display: flex; justify-content: flex-end; gap: 8px; border-top: 1px solid var(--line); }
.err { color: var(--bad); font-weight: 600; margin-top: 10px; }
#toasts { position: fixed; right: 18px; bottom: 18px; display: grid; gap: 8px; z-index: 50; }
.toast { background: var(--navy); color: #fff; padding: 11px 16px; border-radius: 10px; box-shadow: var(--shadow); max-width: 380px; border-left: 4px solid var(--gold); }
.toast.bad { background: var(--bad); border-left-color: #fff; }

/* sign-in and public forms */
.centre { min-height: 100%; display: grid; place-items: start center; padding: 28px 14px 60px; background: linear-gradient(180deg, var(--navy) 0, var(--navy) 210px, var(--bg) 210px); }
.sheet { width: min(640px, 100%); }
.sheet .logo { background: #fff; border-radius: 10px; padding: 8px 14px; display: inline-block; margin-bottom: 14px; } .sheet .logo img { height: 54px; display: block; }
.sheet .kicker { color: var(--gold); font-weight: 700; letter-spacing: .16em; font-size: .75rem; text-transform: uppercase; }
.sheet h1 { color: #fff; margin: 2px 0 18px; font-size: 1.5rem; }
.sheet .card { padding: 20px; }
.sheet .big { font-size: 1.05rem; padding: 12px 18px; width: 100%; justify-content: center; }
.facts { display: grid; gap: 4px; margin: 0 0 4px; } .facts div { display: flex; gap: 8px; } .facts span:first-child { color: var(--muted); min-width: 74px; }
.success { text-align: center; padding: 26px 16px; } .success .tick { width: 62px; height: 62px; border-radius: 50%; background: var(--ok-soft); color: var(--ok); font-size: 2rem; display: grid; place-items: center; margin: 0 auto 12px; }
.success .ref { font-size: 1.3rem; font-weight: 700; color: var(--navy); letter-spacing: .04em; }
.qr { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; } .qr canvas { border: 1px solid var(--line); border-radius: 8px; }
.linkbox { display: flex; gap: 8px; } .linkbox input { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .82rem; }
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; } .pair .card { margin: 0; }

@media (max-width: 860px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .side { position: fixed; inset: 0 auto 0 0; width: 250px; transform: translateX(-102%); transition: transform .18s; z-index: 30; }
  .side.open { transform: none; box-shadow: 0 0 0 100vw rgba(5,19,56,.5); }
  .topbar { display: flex; align-items: center; gap: 10px; background: var(--navy); color: #fff; padding: 10px 14px; position: sticky; top: 0; z-index: 20; font-weight: 700; }
  .topbar button { background: transparent; color: #fff; border-color: rgba(255,255,255,.35); padding: 5px 10px; }
  .main { padding: 16px 14px 60px; }
  .g2, .g3, .g4, .fields, .pair { grid-template-columns: 1fr; } .g4 { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .dl { grid-template-columns: 1fr; gap: 0; } .dl dd { margin-bottom: 8px; }
}
@media print { .side, .topbar, .actions, .tabs, #toasts { display: none !important; } .shell { display: block; } .main { padding: 0; } }

/* ---------- release 1.1: tick-box groups, form section headings, link buttons, team builder ---------- */
.checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 4px 12px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; max-height: 190px; overflow: auto; background: #fff; }
.checks .check { font-size: .9rem; margin: 0; align-items: center; }
.fhead { margin: 10px 0 0; padding-top: 12px; border-top: 1px solid var(--line); color: var(--navy); }
.sheet h3.fhead { margin-top: 22px; font-size: 1.1rem; border-top: 0; padding-top: 0; }
a.btn.primary { background: var(--blue); border-color: var(--blue); color: #fff; }
a.btn.sm { padding: 4px 10px; font-size: .85rem; }
a.btn { text-decoration: none; display: inline-block; }
dialog .df { align-items: center; }
dialog .toolbar { flex-wrap: wrap; }

dialog .toolbar input[type=search] { flex: 1 1 260px; max-width: none; }
dialog .toolbar select { width: auto; min-width: 150px; flex: 0 0 auto; }
dialog .toolbar input[type=number] { width: 90px; }
dialog td select { min-width: 190px; width: auto; }

/* new password page */
.pwrules { list-style: none; padding: 0; margin: 10px 0 6px; font-size: .88rem; color: var(--muted); }
.pwrules li { padding: 1px 0; } .pwrules li::before { content: '○'; display: inline-block; width: 1.5em; }
.pwrules li.ok { color: var(--ok); font-weight: 600; } .pwrules li.ok::before { content: '✓'; }

/* email the team (release 1.2) */
dialog .db.mailgrid { display: grid; grid-template-columns: minmax(280px, 360px) 1fr; gap: 22px; max-height: 74vh; }
.mailgrid > div { min-width: 0; } .mailgrid > div:first-child { position: sticky; top: 0; align-self: start; }
.chips { display: flex; flex-wrap: wrap; gap: 2px 6px; align-items: center; margin-bottom: 8px; }
.recips { border: 1px solid var(--line); border-radius: 8px; max-height: 52vh; overflow: auto; background: #fff; }
.recip { display: flex; gap: 10px; align-items: flex-start; padding: 9px 12px; border-bottom: 1px solid var(--line); font-weight: 400; margin: 0; cursor: pointer; }
.recip:last-child { border-bottom: 0; } .recip:hover { background: #f8fafd; } .recip input { margin-top: 4px; }
.recip.off { opacity: .6; cursor: default; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.seg button { border: 0; border-radius: 0; padding: 5px 12px; } .seg button.on { background: var(--navy); color: #fff; }
.mailpreview { background: var(--bg); border-radius: 8px; padding: 14px; max-height: 52vh; overflow: auto; }
.mailcard { background: #fff; border-radius: 10px; overflow: hidden; box-shadow: var(--shadow); max-width: 620px; }
.mailhead { background: var(--navy); border-bottom: 4px solid var(--gold); padding: 12px 20px; }
.mailhead img { height: 38px; background: #fff; border-radius: 6px; padding: 3px 8px; display: block; }
.mailbody { padding: 18px 22px 6px; } .mailbody p { margin: 0 0 14px; }
pre.mailtext { white-space: pre-wrap; font-family: inherit; background: var(--bg); padding: 14px; border-radius: 8px; margin: 10px 0 0; }
.note.ok { background: var(--ok-soft); border-left-color: var(--ok); }
@media (max-width: 860px) { dialog .db.mailgrid { grid-template-columns: 1fr; } .mailgrid > div:first-child { position: static; } }
.markers { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 8px; }
.mk { display: inline-block; padding: 2px 9px; border-radius: 99px; font-size: .8rem; background: #eef1f7; color: var(--muted); }
.mk.ok { background: var(--ok-soft); color: var(--ok); font-weight: 600; } .mk.warn { background: var(--warn-soft); color: var(--warn); font-weight: 600; }

/* release 1.3: demonstration banner, signatures, certificates */
.demobar { background: #fff4d6; border-bottom: 2px solid var(--gold); color: #5a4300; padding: 8px 24px; font-size: .9rem; }
.demobar a { margin-left: 6px; }
.who a.whoLink { color: inherit; opacity: .85; font-size: .85rem; }
.sigwrap { position: relative; border: 1px dashed var(--line); border-radius: 10px; background: #fff; }
.sigpad { display: block; width: 100%; height: auto; aspect-ratio: 3 / 1; touch-action: none; cursor: crosshair; }
.sigline { position: absolute; left: 8%; right: 8%; bottom: 22%; border-top: 1px solid #9aa3b5; font-size: .75rem; color: var(--muted); padding-top: 2px; pointer-events: none; }
.sigshow img { max-width: 320px; max-height: 110px; display: block; background: repeating-linear-gradient(45deg, #fafbfd, #fafbfd 8px, #f3f5fa 8px, #f3f5fa 16px); border-radius: 8px; padding: 6px 10px; }
.logos { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; } .logos img { height: 56px; max-width: 140px; object-fit: contain; border: 1px solid var(--line); border-radius: 6px; padding: 4px; background: #fff; }
.checklist { list-style: none; padding: 0; margin: 0 0 12px; } .checklist li { padding: 4px 0; } .checklist li::before { content: '○  '; color: var(--muted); }
.checklist li.ok::before { content: '✓  '; color: var(--ok); font-weight: 700; } .checklist li.warn::before { content: '!  '; color: var(--warn); font-weight: 700; }
.afemgrid { display: grid; grid-template-columns: minmax(220px, 300px) 1fr; gap: 18px; } .afemgrid textarea { min-height: 300px; font-family: ui-monospace, monospace; }
@media (max-width: 860px) { .afemgrid { grid-template-columns: 1fr; } }

/* ---------- release 1.4: course administration, AFEM credentialing, the sandbox ---------- */
.demobar.sandbox { background: #e8f1ff; border-bottom-color: #0262fe; color: #0b2a66; }
.cred { display: inline-flex; align-items: center; gap: 6px; padding: 2px 9px; border-radius: 999px; font-size: .8rem; font-weight: 600; white-space: nowrap; }
.cred::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.cred.green { background: #e6f6ec; color: #11713a; }
.cred.amber { background: #fff3d6; color: #8a5a00; }
.cred.red { background: #fde8e8; color: #b42318; }
.credbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 10px; border: 1px solid var(--line); }
.credbar .dot { width: 14px; height: 14px; border-radius: 50%; flex: none; }
.credbar.green { background: #f0faf4; border-color: #b7e3c6; } .credbar.green .dot { background: #1f9d55; }
.credbar.amber { background: #fff8e6; border-color: #f3d58a; } .credbar.amber .dot { background: #e0a100; }
.credbar.red { background: #fff1f1; border-color: #f4b4b4; } .credbar.red .dot { background: #d92d20; }
.debriefs { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.debrief { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; background: #fff; }
.debrief.done { border-color: #b7e3c6; } .debrief.due { border-color: #f3d58a; background: #fffcf3; }
.debrief .dhd { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 4px; }
.debrief .dhd button { margin-left: auto; }
.debrief .dl { margin: 6px 0 0; font-size: .88rem; }
.fbreq { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 2px 0; }
.fbreq button.link { font-size: .85rem; }
details.members { margin-top: 10px; }
details.members > summary { cursor: pointer; font-weight: 600; margin-bottom: 8px; }

/* participant check-in on the facilitator's link (1.4) */
.checkin { display: grid; gap: 8px; }
.ckrow { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; background: #fff; }
.ckrow.done { border-color: #b7e3c6; background: #f6fcf8; }
.ckmain { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.ckmain > div:first-child { min-width: 0; flex: 1 1 220px; }
.ckstate { text-align: right; }
.ckpanel { margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--line); }
.ckbtns { display: flex; gap: 8px; flex-wrap: wrap; }
.note.ok { background: #effaf3; border-color: #b7e3c6; }
