/* Staff screens on the Stuart McBain Ltd brand (H-26, H-27). Tokens and components from docs/design/onboard-ux-v1.html. */
:root {
  --charcoal: #20272B; --teal: #11A59E; --green: #3FBB6C; --lime: #7BD356; --neutral: #F4F5F4;
  --teal-deep: #0B7F7A; --teal-50: #E7F6F5; --green-50: #EAF7EF; --lime-50: #F1FAEA;
  --amber: #B97A0F; --amber-50: #FBF3E2; --red: #C0392B; --red-50: #FBEAE8;
  --ink: #20272B; --muted: #5B666C; --line: #DFE3E1; --card: #FFFFFF;
  --background: var(--neutral); --foreground: var(--charcoal); --primary: var(--teal-deep);
  --primary-foreground: #FFFFFF; --ring: var(--teal); --radius: 12px;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--background); color: var(--foreground);
  font: 15px/1.55 Inter, system-ui, "Segoe UI", sans-serif; }
h1, h2, h3, h4 { font-weight: 600; line-height: 1.25; margin: 0 0 .5em; }
h1 { font-size: 28px; letter-spacing: -.02em; }
h2 { font-size: 18px; letter-spacing: -.01em; }
h3 { font-size: 15.5px; }
p { margin: 0 0 .8em; }
a { color: var(--teal-deep); }
.i { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.i.sm { width: 15px; height: 15px; }
.muted { color: var(--muted); } .small { font-size: 12.5px; } .tiny { font-size: 11.5px; }
.bad { color: var(--red); }
.row { display: flex; align-items: center; gap: 10px; } .between { justify-content: space-between; } .wrapf { flex-wrap: wrap; }
.note { background: var(--amber-50); border: 1px solid #F0DDB2; border-radius: 10px; padding: 8px 12px; font-size: 13.5px; }

/* Buttons and badges */
[hidden] { display: none !important; }
button, .btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 34px; padding: 0 14px;
  border-radius: 8px; font: 600 13px Inter, system-ui, sans-serif; border: 1px solid transparent; white-space: nowrap;
  cursor: pointer; text-decoration: none; background: var(--primary); color: #fff; }
button:focus-visible, .btn:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--ring); outline-offset: 2px; }
button:disabled { opacity: .5; cursor: default; }
.btn-p { background: var(--primary); color: #fff; }
.btn-o, button.quiet { background: #fff; border-color: var(--line); color: var(--ink); }
.btn-g { background: transparent; color: var(--muted); }
.btn-g:hover { background: #EBEEEC; }
.btn-lg { height: 44px; padding: 0 20px; font-size: 15px; border-radius: 10px; }
button.link { background: none; border: 0; padding: 0; height: auto; color: inherit; text-decoration: underline; font-weight: 500; }
button.wide { width: 100%; margin-bottom: 8px; height: 44px; }
.badge, .pill { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; font-weight: 600; padding: 2px 9px; border-radius: 999px; white-space: nowrap; }
.pill { background: var(--teal-50); color: var(--teal-deep); }
.b-done { background: var(--green-50); color: #1C7444; }
.b-prog { background: var(--teal-50); color: var(--teal-deep); }
.b-wait { background: var(--amber-50); color: #85570A; }
.b-bad { background: var(--red-50); color: #9C2A1F; }
.b-grey { background: #ECEFEE; color: var(--muted); }
.count { font-size: 12px; font-weight: 600; background: #E4E9E7; color: var(--muted); border-radius: 99px; padding: 1px 8px; margin-left: 6px; vertical-align: middle; }
.bar { height: 8px; background: #E4E9E7; border-radius: 99px; overflow: hidden; }
.bar > i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--teal), var(--green) 70%, var(--lime)); }
.bar.thin { height: 5px; }
.bar.amber > i { background: var(--amber); } .bar.red > i { background: var(--red); }
.avatar { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 600; color: #fff; flex: none; }
.avatar.lg { width: 48px; height: 48px; font-size: 16px; }

/* Shell */
.shell { display: grid; grid-template-columns: 228px 1fr; min-height: 100vh; }
.side { background: var(--charcoal); color: #D5DEDB; padding: 18px 12px; display: flex; flex-direction: column; gap: 4px;
  position: sticky; top: 0; height: 100vh; }
.side .brand { display: flex; align-items: center; gap: 10px; padding: 0 8px 16px; color: #fff; text-decoration: none; }
.side .brand b { display: block; font-size: 13.5px; }
.side .brand .tiny { color: #9FB1AC; }
.side nav { display: flex; flex-direction: column; gap: 2px; }
.side nav[hidden] { display: none; }
.side .grp { font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; color: #8A9894; padding: 14px 10px 4px; }
.side nav a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; font-size: 14px; color: inherit; text-decoration: none; }
.side nav a:hover { background: rgba(255, 255, 255, .06); }
.side nav a.on { background: rgba(17, 165, 158, .20); color: #fff; box-shadow: inset 3px 0 0 var(--teal); }
.side .n { margin-left: auto; font-size: 11px; font-weight: 600; background: var(--teal); color: #fff; border-radius: 99px; padding: 0 7px; }
.side .n.g { background: #3A464C; color: #CFD8D5; }
.side .light { margin-left: auto; }
.side .foot { margin-top: auto; font-size: 12.5px; padding: 10px; border-top: 1px solid #36424A; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.side .foot:empty { display: none; }
.side .foot .link { color: #9FB1AC; font-size: 12px; }
.main { min-width: 0; padding: 18px 28px 40px; }
.topbar { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; }
.topbar[hidden] { display: none; }
.topbar .btn-p { margin-left: auto; }
.search { flex: 1; max-width: 460px; justify-content: flex-start; background: #fff; border: 1px solid var(--line); border-radius: 10px;
  height: 38px; padding: 0 12px; color: var(--muted); font-size: 13.5px; font-weight: 400; }
.kbd { margin-left: auto; font-size: 11px; border: 1px solid var(--line); border-radius: 5px; padding: 0 6px; background: #F6F7F6; }
main { max-width: 1180px; }
.head { margin-bottom: 18px; }
.head h1 { margin-bottom: 2px; }
.crumb { font-size: 13px; color: var(--muted); margin-bottom: 10px; }
.crumb a { color: var(--muted); }

/* Panels, cards, lists */
.panel, .card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; margin-bottom: 14px; }
.panel.narrow { max-width: 440px; margin: 60px auto; }
.panel h2 { font-size: 15.5px; display: flex; align-items: center; gap: 6px; }
.kpis { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; margin-bottom: 16px; }
.kpis > div { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; }
.kpis b { display: block; font-size: 26px; font-weight: 700; letter-spacing: -.02em; line-height: 1.2; }
.kpis span { font-size: 12.5px; color: var(--muted); }
.cols { display: grid; grid-template-columns: 1.55fr 1fr; gap: 16px; }
.cols > * { min-width: 0; }
.stage-row { display: grid; grid-template-columns: 170px 1fr 34px; align-items: center; gap: 10px; font-size: 13px; padding: 5px 0; }
.stage-row b { text-align: right; }
.list-item { display: flex; gap: 12px; align-items: center; padding: 11px 0; border-top: 1px solid var(--line); }
.list-item:first-child { border-top: 0; }
.group { margin-bottom: 22px; }
.group > h2 { font-size: 14px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.empty { text-align: center; padding: 34px 18px; color: var(--muted); }

/* Work cards */
.qcard { display: grid; grid-template-columns: 34px 1fr auto; gap: 14px; align-items: start; padding: 16px; margin-bottom: 12px; }
.qcard.now { border-left: 4px solid var(--red); }
.qcard.today { border-left: 4px solid var(--amber); }
.qcard.soon { border-left: 4px solid var(--teal); }
.qcard .kind { font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--teal-deep); }
.qcard h3 { margin: 2px 0 4px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.qcard p { margin: 0 0 6px; font-size: 14px; }
.qcard .buttons { display: flex; flex-direction: column; gap: 6px; align-items: stretch; min-width: 130px; }
.qcard .buttons .more { display: flex; gap: 4px; justify-content: flex-end; }
.qcard .buttons .more button { height: 28px; padding: 0 8px; font-size: 12px; }
.buttons { display: flex; gap: 8px; flex-wrap: wrap; }

/* Client page */
.case-head { display: grid; grid-template-columns: auto 1fr auto; gap: 16px; align-items: center; }
.case-head h1 { margin: 0; }
.stepper { display: grid; gap: 4px; margin: 14px 0 2px; }
.step { text-align: center; font-size: 11px; color: var(--muted); line-height: 1.3; }
.step .dot { height: 6px; border-radius: 99px; background: #DCE2DF; margin-bottom: 6px; }
.step.done .dot { background: var(--green); }
.step.cur .dot { background: var(--teal); box-shadow: 0 0 0 3px var(--teal-50); }
.step.cur { color: var(--ink); font-weight: 600; }
.next { border-left: 4px solid var(--teal); }
.question { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.question:first-of-type { border-top: 0; }
.tabs { display: inline-flex; background: #E7EBE9; border-radius: 10px; padding: 3px; gap: 2px; margin: 6px 0 12px; flex-wrap: wrap; }
.tabs button { background: transparent; color: var(--muted); font-weight: 500; height: 30px; }
.tabs button.on { background: #fff; color: var(--ink); box-shadow: 0 1px 2px rgba(0, 0, 0, .08); font-weight: 600; }
.timeline { list-style: none; margin: 0; padding: 0 0 0 16px; border-left: 2px solid var(--line); margin-left: 6px; }
.timeline li { position: relative; padding: 4px 0 10px; font-size: 13.5px; }
.timeline li::before { content: ""; position: absolute; left: -22px; top: 9px; width: 10px; height: 10px; border-radius: 50%; background: #fff; border: 2px solid var(--teal); }
.tasks { list-style: none; margin: 0 0 12px; padding: 0; }
.tasks li { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding: 7px 0; border-top: 1px solid var(--line); font-size: 14px; }
.tasks li.done span:first-child, .tasks li.skipped span:first-child { color: var(--muted); }
.tasks details { flex-basis: 100%; font-size: 13px; }
.tasks dl { display: grid; grid-template-columns: max-content 1fr; gap: 2px 12px; margin: 6px 0; }
.tasks dd { margin: 0; overflow-wrap: anywhere; }
.flags { margin: 0; padding-left: 18px; font-size: 13.5px; }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: 4px 12px; margin: 0; font-size: 13.5px; }
.facts dt { color: var(--muted); } .facts dd { margin: 0; }
#intake-link { overflow-wrap: anywhere; margin-top: 8px; }

/* Clients */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; font-weight: 600; font-size: 12.5px; color: var(--muted); padding: 8px 10px; border-bottom: 1px solid var(--line); }
td { padding: 10px; border-top: 1px solid var(--line); vertical-align: middle; }
tr:first-child td { border-top: 0; }
td .bar { width: 110px; }

/* Waiting on others */
.board { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.lane { background: #EBEEEC; border-radius: var(--radius); padding: 10px; min-width: 0; }
.lane h2 { margin: 2px 4px 10px; font-size: 13px; display: flex; justify-content: space-between; }
.wcard { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 11px; margin-bottom: 8px; font-size: 13px; }
.wcard.late { border-color: #E9B8B2; }
.wcard a { font-weight: 600; text-decoration: none; }
.wcard .bar { margin: 8px 0 4px; }
.light { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: #8A9894; flex: none; }
.light.ok { background: var(--green); } .light.bad { background: var(--red); }

/* New client wizard */
.wiz { max-width: 760px; }
.wiz-steps { display: flex; gap: 8px; margin-bottom: 16px; font-size: 13px; color: var(--muted); flex-wrap: wrap; }
.wiz-steps span.on { color: var(--teal-deep); font-weight: 600; }
.choice { border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; display: flex; gap: 12px; align-items: center; background: #fff;
  margin-bottom: 8px; cursor: pointer; }
.choice.on { border-color: var(--teal); box-shadow: 0 0 0 3px var(--teal-50); }
.choice input[type=radio], .choice input[type=checkbox] { accent-color: var(--teal-deep); width: 18px; height: 18px; margin: 0; flex: none; }
.choice .grow { flex: 1; min-width: 0; }
.fee { display: grid; grid-template-columns: auto 1fr 110px 92px; gap: 10px; align-items: center; padding: 8px 0; border-top: 1px solid var(--line); font-size: 14px; }
.fee input[type=number] { width: 100%; }
.total { font-size: 18px; font-weight: 700; }

/* Forms */
label { display: block; font-size: 13.5px; font-weight: 500; margin-bottom: 12px; }
input, select, textarea { display: block; width: 100%; margin-top: 4px; font: 14px Inter, system-ui, sans-serif; color: var(--ink);
  border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; background: #fff; min-height: 38px; }
input[type=checkbox], input[type=radio] { display: inline-block; width: auto; min-height: 0; margin: 0 6px 0 0; vertical-align: middle; accent-color: var(--teal-deep); }
label.inline { display: inline-flex; align-items: center; margin: 0; font-weight: 400; }
textarea { min-height: 90px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.hits { margin: -4px 0 12px; }
.hits button { display: flex; width: 100%; justify-content: space-between; background: #fff; color: var(--ink); border-color: var(--line); margin-bottom: 4px; font-weight: 500; height: auto; padding: 8px 12px; white-space: normal; text-align: left; }

/* Toast, dialog, search box */
#toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: var(--charcoal); color: #fff; padding: 10px 18px;
  border-radius: 10px; font-size: 14px; z-index: 50; max-width: calc(100% - 32px); box-shadow: 0 10px 24px rgba(0, 0, 0, .2); }
#toast.bad { background: var(--red); }
dialog { border: 1px solid var(--line); border-radius: 14px; padding: 20px; width: min(420px, calc(100% - 32px)); box-shadow: 0 30px 60px rgba(32, 39, 43, .25); }
dialog::backdrop { background: rgba(32, 39, 43, .35); }
dialog .buttons { justify-content: flex-end; }
dialog.cmd { padding: 0; width: min(560px, calc(100% - 32px)); margin-top: 70px; }
.cmd input { border: 0; border-bottom: 1px solid var(--line); border-radius: 0; margin: 0; padding: 14px 16px; font-size: 15px; outline: none; }
.cmd input:focus-visible { outline: none; }
#cmd-list { max-height: 360px; overflow-y: auto; padding: 6px 0; }
.cmd .it { display: flex; gap: 10px; align-items: center; padding: 9px 16px; font-size: 14px; color: var(--ink); text-decoration: none; }
.cmd .it.on { background: var(--teal-50); }
.cmd .it .muted { margin-left: auto; font-size: 12px; }
.welcome { border: 1px solid #D3EBDD; background: linear-gradient(135deg, #F4FBEF 0, #EAF7F5 100%); }
.welcome ol { margin: 0 0 10px; padding-left: 20px; }
.welcome li { margin: 4px 0; }

@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; padding: 10px 12px; gap: 6px; }
  .side .brand { padding: 0 8px 0 0; }
  .side nav { flex-direction: row; flex-wrap: wrap; flex-basis: 100%; }
  .side nav a { padding: 6px 8px; font-size: 13px; }
  .side nav a .i { display: none; }
  .side .grp { display: none; }
  .side .foot { margin: 0 0 0 auto; border: 0; padding: 0; }
  .main { padding: 14px 16px 30px; }
  .topbar .search .kbd { display: none; }
  h1 { font-size: 23px; }
  .kpis { grid-template-columns: 1fr 1fr; }
  .cols, .board, .grid2 { grid-template-columns: 1fr; }
  .qcard { grid-template-columns: 34px 1fr; }
  .qcard .buttons { grid-column: 1 / -1; flex-direction: row; flex-wrap: wrap; min-width: 0; }
  .qcard .buttons > button { flex: 1; }
  .case-head { grid-template-columns: auto 1fr; }
  .case-head > :last-child { grid-column: 1 / -1; }
  .stepper .step span { display: none; }
  .stage-row { grid-template-columns: 110px 1fr 28px; }
  .fee { grid-template-columns: auto 1fr; }
  .fee input[type=number], .fee select { grid-column: 2; }
}

/* Previews of what is coming: always labelled "Not live yet", dashed edge, example figures greyed */
.b-soon { background: var(--amber-50); color: #85570A; border: 1px solid #F0DDB2; vertical-align: middle; }
.side .n.s { background: transparent; border: 1px solid #4A575D; color: #AEBBB7; font-weight: 500; }
.notlive { border: 1px dashed #E2C27A; background: #FFFCF5; }
.preview { opacity: .72; pointer-events: none; user-select: none; }
.sample { width: 100%; border-collapse: collapse; font-size: 13.5px; margin-bottom: 10px; }
.sample th, .sample td { text-align: left; padding: 7px 8px; border-bottom: 1px solid var(--line); }
.sample th { font-size: 12px; color: var(--muted); font-weight: 600; }
.notlive input[disabled] { width: 100%; height: 34px; border: 1px solid var(--line); border-radius: 8px; padding: 0 10px; background: #F7F7F6; }
