/* Dispatch - AMwaves Wellness Plus theme. Colours come from the logo: charcoal #221f20, leaf green #77b956, gold #c9b06b. */
:root {
  --night: #221f20; --night-2: #2d2a2b; --night-3: #3a3637; --night-ink: #e9e6e2; --night-muted: #9c968f;
  --leaf: #77b956; --gold: #c9b06b; --gold-ink: #7d6420;
  --bg: #f4f4f1; --surface: #ffffff; --surface-2: #fafaf8; --ink: #1d1b1c; --muted: #6c6862; --line: #e6e4df; --line-2: #d6d3cc;
  --brand: #367a25; --brand-ink: #ffffff; --brand-soft: #edf6e7; --brand-line: #cfe6c2;
  --warn: #8a5a00; --warn-soft: #fcf3dc; --bad: #a12f2f; --bad-soft: #fcebea; --ok: #2b6d1f; --ok-soft: #e7f4e1;
  --info: #24507f; --info-soft: #e8eff8;
  --radius: 12px; --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(34, 31, 32, .05), 0 1px 1px rgba(34, 31, 32, .03);
  --shadow-lg: 0 10px 30px rgba(34, 31, 32, .12);
  --side-w: 248px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink);
  font: 15px/1.55 Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; -webkit-font-smoothing: antialiased; }
a { color: var(--brand); text-decoration-thickness: 1px; text-underline-offset: 2px; }
h1 { font-size: 24px; line-height: 1.25; margin: 0 0 4px; letter-spacing: -.015em; font-weight: 700; }
h2 { font-size: 16px; margin: 0 0 12px; font-weight: 650; letter-spacing: -.005em; }
h3 { font-size: 13.5px; margin: 16px 0 6px; font-weight: 650; }
.muted { color: var(--muted); } .small { font-size: 13px; } .right { text-align: right; } .nowrap { white-space: nowrap; }
.mono { font-family: ui-monospace, SFMono-Regular, Consolas, Menlo, monospace; font-size: 13px; }
.ic { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* ---------------------------------------------------------------- shell */
.app .main { margin-left: var(--side-w); min-height: 100vh; }
.wrap { max-width: 1200px; margin: 0 auto; padding: 28px 32px 64px; }
.side { position: fixed; inset: 0 auto 0 0; width: var(--side-w); background: var(--night); color: var(--night-ink);
  display: flex; flex-direction: column; z-index: 20; }
.side-logo { display: block; padding: 18px 20px 14px; border-bottom: 1px solid var(--night-3); }
.side-logo img { display: block; width: 100%; max-width: 190px; height: auto; }
.side-nav { padding: 14px 12px; display: flex; flex-direction: column; gap: 2px; flex: 1; overflow-y: auto; }
.side-nav a { display: flex; align-items: center; gap: 11px; padding: 9px 12px; border-radius: var(--radius-sm);
  color: var(--night-ink); text-decoration: none; font-weight: 500; font-size: 14.5px; position: relative; }
.side-nav a .ic { color: var(--night-muted); }
.side-nav a:hover { background: var(--night-2); }
.side-nav a.on { background: var(--night-3); color: #fff; }
.side-nav a.on .ic { color: var(--leaf); }
.side-nav a.on::before { content: ""; position: absolute; left: -12px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: var(--leaf); }
.side-user { display: flex; align-items: center; gap: 10px; padding: 14px 14px 16px; border-top: 1px solid var(--night-3); }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--night-3); color: var(--gold); display: grid; place-items: center; font-weight: 700; flex: none; }
.side-user .who { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.side-user .who b { font-size: 13.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.role { font-size: 11.5px; color: var(--gold); font-weight: 600; letter-spacing: .02em; }
.icon-btn { background: transparent; border: 0; color: var(--night-muted); padding: 7px; border-radius: var(--radius-sm); cursor: pointer; display: grid; place-items: center; }
.icon-btn:hover { background: var(--night-2); color: #fff; }
.mtop, .scrim { display: none; }

@media (max-width: 960px) {
  .app .main { margin-left: 0; }
  .wrap { padding: 18px 16px 56px; }
  .mtop { display: flex; align-items: center; gap: 10px; position: sticky; top: 0; z-index: 15; height: 56px; padding: 0 10px;
    background: var(--night); }
  .mtop-logo { height: 34px; width: auto; display: block; }
  .mtop-btn { background: transparent; border: 0; color: #fff; padding: 8px; border-radius: var(--radius-sm); cursor: pointer; display: grid; }
  .side { transform: translateX(-100%); transition: transform .2s ease; box-shadow: var(--shadow-lg); }
  body.nav-open .side { transform: none; }
  body.nav-open .scrim { display: block; position: fixed; inset: 0; background: rgba(0, 0, 0, .4); z-index: 18; }
}

/* ---------------------------------------------------------------- layout */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; margin-bottom: 16px; box-shadow: var(--shadow); }
.card > h2 { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.grid { display: grid; gap: 16px; } .g2 { grid-template-columns: 1fr 1fr; } .g3 { grid-template-columns: repeat(3, 1fr); }
.cols { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 18px; align-items: start; }
@media (max-width: 1100px) { .cols { grid-template-columns: 1fr; } }
@media (max-width: 760px) { .g2, .g3 { grid-template-columns: 1fr; } }
.head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; flex-wrap: wrap; margin-bottom: 20px; }
.head h1 { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* ---------------------------------------------------------------- controls */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid var(--line-2); background: var(--surface);
  color: var(--ink); padding: 8px 14px; border-radius: var(--radius-sm); cursor: pointer; font: inherit; font-size: 14px; font-weight: 500;
  text-decoration: none; line-height: 1.3; transition: background .12s, border-color .12s, box-shadow .12s; }
.btn:hover { border-color: #bdb9b1; background: var(--surface-2); }
.btn:focus-visible, .input:focus-visible, .chip:focus-visible, .side-nav a:focus-visible { outline: 3px solid rgba(119, 185, 86, .45); outline-offset: 1px; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); box-shadow: 0 1px 0 rgba(0, 0, 0, .08); }
.btn.primary:hover { background: #2e6a1f; border-color: #2e6a1f; }
.btn.danger { color: var(--bad); border-color: #ebc9c7; }
.btn.danger:hover { background: var(--bad-soft); }
.btn.sm { padding: 5px 10px; font-size: 13px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
form.inline { display: inline; }

.badge { display: inline-flex; align-items: center; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; background: #efeee9; color: #4a4743; white-space: nowrap; line-height: 1.6; }
.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(--info-soft); color: var(--info); }
.badge.gold { background: #f6efdc; color: var(--gold-ink); }

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; background: var(--surface-2); }
thead th:first-child { border-top-left-radius: var(--radius-sm); } thead th:last-child { border-top-right-radius: var(--radius-sm); }
tbody tr:hover td { background: #fbfbf9; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
tr:last-child td { border-bottom: 0; }
.scroll { overflow-x: auto; }
td a b { color: var(--ink); } td a:hover b { color: var(--brand); }

.chips { display: flex; gap: 8px; flex-wrap: wrap; margin: 0 0 16px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; border: 1px solid var(--line); background: var(--surface); border-radius: 999px;
  text-decoration: none; color: var(--ink); font-size: 13.5px; font-weight: 500; box-shadow: var(--shadow); }
.chip:hover { border-color: var(--line-2); }
.chip.on { background: var(--night); color: #fff; border-color: var(--night); }
.chip b { font-weight: 700; min-width: 20px; padding: 0 6px; border-radius: 999px; background: var(--brand-soft); color: var(--brand); font-size: 12px; text-align: center; }
.chip.on b { background: var(--leaf); color: var(--night); }

.msgs { list-style: none; padding: 0; margin: 0 0 16px; }
.msgs li { padding: 11px 14px 11px 16px; border-radius: var(--radius-sm); margin-bottom: 8px; border: 1px solid var(--line); border-left-width: 4px; background: var(--surface); box-shadow: var(--shadow); }
.msgs li.success { background: var(--ok-soft); border-color: var(--brand-line); border-left-color: var(--brand); }
.msgs li.error { background: var(--bad-soft); border-color: #efcfcd; border-left-color: var(--bad); }
.msgs li.warning { background: var(--warn-soft); border-color: #eedca9; border-left-color: #c48a12; }
.msgs li.info { background: var(--info-soft); border-left-color: var(--info); }
.note { padding: 10px 12px; border-radius: var(--radius-sm); background: var(--warn-soft); color: #5e4000; font-size: 14px; margin: 8px 0; }
.note.bad { background: var(--bad-soft); color: #6d1f1f; } .note.ok { background: var(--ok-soft); color: #1d4a14; } .note.info { background: var(--info-soft); color: #1f3a62; }

label { display: block; font-size: 13px; font-weight: 600; margin: 0 0 5px; color: #3a3735; }
.input, select.input, textarea.input { width: 100%; padding: 9px 11px; border: 1px solid var(--line-2); border-radius: var(--radius-sm); font: inherit; font-size: 14.5px;
  background: #fff; color: var(--ink); transition: border-color .12s, box-shadow .12s; }
.input:hover { border-color: #c2beb6; }
.row .input { max-width: 100%; }
.input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(119, 185, 86, .25); }
textarea.input { resize: vertical; }
.field { margin-bottom: 14px; } .errorlist { color: var(--bad); margin: 4px 0 0; padding: 0; list-style: none; font-size: 13px; }
.help { color: var(--muted); font-size: 12.5px; margin-top: 4px; }
.checkrow { display: flex; gap: 8px; align-items: center; margin: 6px 0 12px; } .checkrow label { margin: 0; font-weight: 500; }
.checkrow input, input[type=checkbox] { width: 17px; height: 17px; accent-color: var(--brand); }
.formgrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 18px; } @media (max-width: 700px) { .formgrid { grid-template-columns: 1fr; } }
.span2 { grid-column: 1 / -1; }
table.items td { padding: 6px 6px; } table.items .input { padding: 7px 8px; }
table.items td.w-desc { min-width: 220px; } table.items td.w-sm { width: 84px; } table.items td.w-md { width: 110px; }

dl.kv { display: grid; grid-template-columns: 140px 1fr; gap: 6px 12px; margin: 0; } dl.kv dt { color: var(--muted); } dl.kv dd { margin: 0; }
.totals { margin-left: auto; width: 320px; max-width: 100%; } .totals td { border: 0; padding: 3px 0; } .totals tr:hover td { background: none; }
.totals tr.grand td { border-top: 2px solid var(--night); font-weight: 700; font-size: 17px; padding-top: 8px; }
details.more { margin-top: 12px; } details.more > summary { cursor: pointer; color: var(--brand); font-weight: 600; font-size: 14px; }
.timeline { list-style: none; margin: 0; padding: 0; } .timeline li { padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 13.5px; } .timeline li:last-child { border: 0; }
.step { display: flex; gap: 10px; align-items: center; }
.step .dot { width: 24px; height: 24px; border-radius: 50%; background: #e7e5e0; color: var(--muted); display: inline-flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; flex: none; }
.step .dot.done { background: var(--brand); color: #fff; }

/* ---------------------------------------------------------------- settings */
.stabs { display: flex; gap: 4px; flex-wrap: wrap; border-bottom: 1px solid var(--line); margin: 0 0 20px; }
.stabs a { padding: 10px 14px; color: var(--muted); text-decoration: none; font-weight: 550; font-size: 14px; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.stabs a:hover { color: var(--ink); }
.stabs a.on { color: var(--ink); border-bottom-color: var(--leaf); }
.sec { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 24px; padding: 20px 0; border-top: 1px solid var(--line); }
.sec:first-of-type { border-top: 0; padding-top: 4px; }
.sec-intro h2 { margin-bottom: 6px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; } .sec-intro p { margin: 0; color: var(--muted); font-size: 13.5px; }
@media (max-width: 900px) { .sec { grid-template-columns: 1fr; gap: 10px; } }
.src { display: inline-block; font-size: 11.5px; margin-top: 4px; color: var(--muted); }
.src::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: #cfccc5; margin-right: 6px; vertical-align: 1px; }
.src.page::before { background: var(--leaf); } .src.env::before { background: var(--gold); }
.hook { display: flex; gap: 8px; align-items: center; background: var(--surface-2); border: 1px dashed var(--line-2); border-radius: var(--radius-sm); padding: 8px 8px 8px 12px; margin: 6px 0 2px; }
.hook code { flex: 1; min-width: 0; overflow-wrap: anywhere; font-size: 12.5px; }
.status { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; padding: 2px 10px; border-radius: 999px; }
.status.on { background: var(--ok-soft); color: var(--ok); } .status.off { background: #efeee9; color: var(--muted); }
.status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.with-btn { display: flex; gap: 6px; } .with-btn .input { flex: 1; }
.matrix td, .matrix th { text-align: center; } .matrix td:first-child, .matrix th:first-child { text-align: left; }
.tick { color: var(--brand); font-weight: 700; } .dash { color: #c9c5bd; }
.rolecards { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px; margin-bottom: 16px; }
.rolecard { border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; background: var(--surface); box-shadow: var(--shadow); }
.rolecard b { display: block; margin-bottom: 4px; } .rolecard p { margin: 0; font-size: 13px; color: var(--muted); }
.rolecard.role-admin { border-top: 3px solid var(--night); } .rolecard.role-manager { border-top: 3px solid var(--brand); }
.rolecard.role-staff { border-top: 3px solid var(--leaf); } .rolecard.role-accounts { border-top: 3px solid var(--gold); }
label.radio { display: flex; gap: 10px; align-items: flex-start; font-weight: 500; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); margin-bottom: 8px; cursor: pointer; }
label.radio:hover { border-color: var(--line-2); } label.radio input { margin-top: 3px; accent-color: var(--brand); }
label.radio:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); }
label.radio span b { display: block; font-weight: 600; } label.radio span small { color: var(--muted); font-size: 12.5px; }

/* ---------------------------------------------------------------- sign-in */
.guest .main { min-height: 100vh; display: grid; place-items: center; background:
  radial-gradient(1200px 500px at 10% -10%, rgba(119, 185, 86, .14), transparent 60%),
  radial-gradient(900px 500px at 110% 110%, rgba(201, 176, 107, .14), transparent 60%), var(--night); }
.guest .wrap { width: 100%; max-width: 420px; padding: 24px 16px; }
.login-logo { display: block; width: 260px; max-width: 80%; margin: 0 auto 22px; }
.login-card { background: var(--surface); border-radius: 16px; padding: 28px 28px 24px; box-shadow: 0 20px 60px rgba(0, 0, 0, .35); }
.login-card h1 { font-size: 21px; } .login-card .btn.primary { width: 100%; padding: 11px; font-size: 15px; margin-top: 4px; }
.login-foot { text-align: center; color: var(--night-muted); font-size: 12.5px; margin-top: 18px; }

/* ---------------------------------------------------------------- customer-facing */
body.public { background: var(--bg); }
.pub-top { background: var(--night); padding: 14px 16px; text-align: center; }
.pub-top img { height: 54px; width: auto; display: inline-block; }
.pub-top .tag { color: var(--night-muted); font-size: 12.5px; margin-top: 4px; }
.pub { max-width: 640px; margin: 0 auto; padding: 20px 16px 48px; }
.pub .biz { text-align: center; margin-bottom: 14px; } .pub .biz b { font-size: 18px; }
.pub .card { padding: 20px; } .pub .btn.primary { width: 100%; padding: 13px; font-size: 16px; text-align: center; }
.pub .input { padding: 11px 12px; font-size: 16px; }
.pub table td, .pub table th { padding: 8px 6px; }
.big-ok { font-size: 40px; text-align: center; } .center { text-align: center; }
.pub-foot { text-align: center; color: var(--muted); font-size: 12.5px; padding: 0 16px 28px; }

.envbar { background: repeating-linear-gradient(45deg, #f0b429, #f0b429 12px, #f5c451 12px, #f5c451 24px); color: #2b1d00;
  font-weight: 700; font-size: 12.5px; letter-spacing: .04em; text-align: center; padding: 6px 12px; }
.empty { text-align: center; padding: 36px 16px; color: var(--muted); }
.empty h2 { color: var(--ink); justify-content: center; }
