:root {
  /* Consumer Help Group brand — from the CHG logo */
  --ink: #0c0c0e; --ink-2: #1a1a1d;            /* logo black */
  --paper: #f2eee8;                            /* logo off-white */
  --flame: #f67730;                            /* logo orange (use on dark only) */
  --steel: #6f98b0; --steel-50: #ebf2f6; --steel-700: #2f5d78;  /* logo steel blue */
  --brand: #c2560f; --brand-700: #a9470c; --brand-50: #fff4ec; --brand-100: #ffe1cc;  /* accessible orange */
  --bg: #f5f4f2; --card: #ffffff; --line: #e6e3de; --line-2: #d3cec6;
  --text: #17161a; --text-2: #3a3833; --muted: #6b675f;
  --green: #12805a; --green-50: #e7f6ef; --amber: #a65f00; --amber-50: #fff4e0;
  --red: #b42318; --red-50: #fdecea; --gray-50: #f3f1ee;
  --radius: 12px; --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(20, 16, 10, .05), 0 1px 3px rgba(20, 16, 10, .06);
  --shadow-lg: 0 20px 50px rgba(20, 16, 10, .2);
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body { background: var(--bg); color: var(--text); font: 14.5px/1.5 var(--font); -webkit-font-smoothing: antialiased; }
a { color: var(--brand-700); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 24px; line-height: 1.25; margin: 0; letter-spacing: -.01em; }
h2 { font-size: 17px; margin: 0; }
h3 { font-size: 14px; margin: 0 0 8px; }
p { margin: 0; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.block { display: block; }
.nowrap { white-space: nowrap; }
.grow { flex: 1; min-width: 0; }
.req { color: var(--red); }
.icon { flex: none; }
button { font: inherit; color: inherit; }
input, select, textarea {
  font: inherit; color: var(--text); width: 100%; background: #fff;
  border: 1px solid var(--line-2); border-radius: var(--radius-sm); padding: 10px 12px; outline: none;
  transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-100); }
input:disabled { background: var(--gray-50); color: var(--muted); }
textarea { resize: vertical; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; border: 1px solid transparent;
  border-radius: var(--radius-sm); padding: 9px 16px; font-weight: 600; font-size: 14px; cursor: pointer; white-space: nowrap;
  transition: background .15s, border-color .15s, color .15s; min-height: 40px; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--brand-700); }
.btn-ghost { background: #fff; border-color: var(--line-2); color: var(--text); }
.btn-ghost:hover:not(:disabled) { background: var(--gray-50); }
.btn-outline { background: #fff; border-color: var(--brand); color: var(--brand); }
.btn-outline:hover:not(:disabled) { background: var(--brand-50); }
.btn-danger { background: var(--red); color: #fff; }
.btn-danger:hover:not(:disabled) { background: #93190f; }
.btn-success { background: var(--green); color: #fff; }
.btn-text, .btn-text-danger { background: none; color: var(--brand); padding: 9px 8px; }
.btn-text-danger { color: var(--red); }
.btn-text:hover, .btn-text-danger:hover { text-decoration: underline; }
.btn-block { width: 100%; }
.btn-lg { min-height: 50px; font-size: 16px; }
.icon-btn { background: none; border: 0; padding: 7px; border-radius: 8px; color: var(--muted); cursor: pointer; display: inline-flex; }
.icon-btn:hover { background: var(--gray-50); color: var(--text); }
.linkish { background: none; border: 0; color: var(--brand); cursor: pointer; padding: 0; font-weight: 500; }
.linkish:hover { text-decoration: underline; }
.spinner { width: 15px; height: 15px; border: 2px solid rgba(255,255,255,.45); border-top-color: #fff; border-radius: 50%; animation: spin .7s linear infinite; display: inline-block; }
.spinner.dark { border-color: var(--line-2); border-top-color: var(--brand); }
.btn-ghost .spinner, .btn-outline .spinner, .btn-text .spinner { border-color: var(--line-2); border-top-color: var(--brand); }
@keyframes spin { to { transform: rotate(360deg); } }
.loading { display: flex; align-items: center; gap: 10px; color: var(--muted); padding: 30px 0; }

/* ---------- layout ---------- */
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row-end { display: flex; gap: 10px; justify-content: flex-end; align-items: center; flex-wrap: wrap; }
.row-between { display: flex; gap: 10px; justify-content: space-between; align-items: center; flex-wrap: wrap; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.stack-lg { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.center-screen { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); }
.card.narrow { max-width: 440px; display: flex; flex-direction: column; gap: 14px; }
.card-title { display: flex; align-items: center; gap: 8px; font-size: 16px; margin-bottom: 14px; }
.card-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.divider { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); border-top: 1px solid var(--line); padding-top: 14px; }

.shell { display: grid; grid-template-columns: 248px 1fr; min-height: 100vh; }
.sidebar { background: #fff; border-right: 1px solid var(--line); display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; }
.brand { display: flex; gap: 11px; align-items: center; padding: 18px 18px 8px; }
.brand strong { display: block; font-size: 15px; line-height: 1.2; }
.brand span { font-size: 12px; color: var(--muted); }
.brand-org { display: flex; gap: 7px; align-items: center; font-size: 12.5px; color: var(--text-2); padding: 4px 20px 14px; border-bottom: 1px solid var(--line); }
.scope { padding: 14px 14px 4px; }
.scope-label { display: flex; gap: 6px; align-items: center; font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.scope select { padding: 8px 10px; font-size: 13.5px; }
.sidebar nav { padding: 12px 10px; display: flex; flex-direction: column; gap: 2px; flex: 1; overflow-y: auto; }
.nav-item { display: flex; gap: 11px; align-items: center; padding: 9px 12px; border-radius: 9px; color: var(--text-2); font-weight: 500; }
.nav-item:hover { background: var(--gray-50); text-decoration: none; }
.nav-item.active { background: var(--brand-50); color: var(--brand); font-weight: 600; }
.sidebar-foot { border-top: 1px solid var(--line); padding: 12px; display: flex; align-items: center; gap: 6px; }
.me { flex: 1; min-width: 0; display: flex; gap: 10px; align-items: center; background: none; border: 0; cursor: pointer; padding: 6px; border-radius: 9px; text-align: left; }
.me:hover { background: var(--gray-50); }
.me-text { min-width: 0; }
.me-text strong, .me-text small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.me-text small { color: var(--muted); font-size: 12px; }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--brand-50); color: var(--brand); font-weight: 700; display: grid; place-items: center; flex: none; }
.mobilebar, .scrim { display: none; }
.main { min-width: 0; }
.page { max-width: 1180px; margin: 0 auto; padding: 32px 32px 60px; display: flex; flex-direction: column; gap: 22px; }
.page-form { max-width: 860px; }
.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; }
.page-head p { margin-top: 4px; }
.meta { display: flex; flex-wrap: wrap; gap: 6px 16px; }
.meta span { display: inline-flex; align-items: center; gap: 5px; }
.back { display: inline-flex; align-items: center; gap: 7px; color: var(--text-2); font-weight: 500; font-size: 13.5px; }

/* ---------- tiles / lists ---------- */
.tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.tile { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; color: var(--text); box-shadow: var(--shadow); display: block; }
a.tile:hover { text-decoration: none; border-color: var(--line-2); }
.tile-accent { background: linear-gradient(180deg, #fff8f2, #ffeede); border-color: #f7cfb2; }
.tile-label { display: flex; align-items: center; gap: 9px; color: var(--text-2); font-size: 14px; }
.tile-label .icon { color: var(--brand); }
.tile-value { font-size: 30px; font-weight: 700; margin-top: 8px; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.section { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.section-head { display: flex; justify-content: space-between; align-items: center; }
.link-sm { display: inline-flex; align-items: center; gap: 5px; font-size: 13px; font-weight: 600; color: var(--text-2); }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
.team { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.team-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; display: flex; gap: 12px; align-items: center; }
.team-card strong, .team-card small { display: block; }
.team-card small { color: var(--muted); font-size: 12.5px; }
.team-ic, .list-ic { width: 36px; height: 36px; border-radius: 10px; background: var(--brand-50); color: var(--brand); display: grid; place-items: center; flex: none; }
.list { display: flex; flex-direction: column; gap: 10px; }
.list-row { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; display: flex; gap: 14px; align-items: center; color: var(--text); }
a.list-row:hover { text-decoration: none; border-color: #efb58c; box-shadow: var(--shadow); }
.list-row strong { display: block; }
.list-row small { display: block; color: var(--muted); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; }
.list-row.inactive { opacity: .6; }
.list-cta { display: inline-flex; align-items: center; gap: 4px; color: var(--brand); font-weight: 600; font-size: 13px; }
.notice { display: flex; align-items: center; gap: 9px; background: var(--amber-50); border: 1px solid #f4d9a8; color: #7a4a00; padding: 12px 16px; border-radius: var(--radius); }
.notice:hover { text-decoration: none; }
.notice-red { background: var(--red-50); border-color: #f5c2bc; color: var(--red); }
.empty { display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; padding: 38px 16px; background: #fff; border: 1px dashed var(--line-2); border-radius: var(--radius); color: var(--muted); }
.empty strong { color: var(--text); }

/* ---------- badges ---------- */
.badge { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; line-height: 1.5; }
.badge-gray { background: var(--gray-50); color: #475569; border: 1px solid var(--line); }
.badge-blue { background: var(--steel-50); color: var(--steel-700); }
.badge-green { background: var(--green-50); color: var(--green); }
.badge-amber { background: var(--amber-50); color: var(--amber); }
.badge-red { background: var(--red-50); color: var(--red); }
.dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; flex: none; }
.dot-green { background: #22a06b; } .dot-blue { background: var(--steel); } .dot-gray { background: #c3ccd8; } .dot-red { background: var(--red); }
.docdots { display: inline-flex; gap: 5px; }

/* ---------- tables / toolbars ---------- */
.toolbar { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; align-items: center; }
.tabs { display: flex; gap: 4px; background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 4px; flex-wrap: wrap; }
.tab { border: 0; background: none; padding: 6px 12px; border-radius: 7px; cursor: pointer; font-weight: 500; color: var(--text-2); font-size: 13.5px; }
.tab.on { background: var(--brand); color: #fff; }
.tab:not(.on):hover { background: var(--gray-50); }
.search { position: relative; min-width: 260px; flex: 0 1 340px; }
.search .icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.search input { padding-left: 36px; }
.table-wrap { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow-x: auto; box-shadow: var(--shadow); }
.table-wrap.flat { box-shadow: none; border: 0; margin: 0 -22px -22px; border-radius: 0; }
.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th { text-align: left; font-weight: 600; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; padding: 11px 16px; border-bottom: 1px solid var(--line); background: #fafbfd; white-space: nowrap; }
.table td { padding: 12px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:not(.static) { cursor: pointer; }
.table tbody tr:not(.static):hover td { background: #fffaf6; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.pager { display: flex; justify-content: space-between; align-items: center; }
.daterange input { width: auto; padding: 7px 10px; }

/* ---------- forms ---------- */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field-label { font-weight: 500; font-size: 14px; color: var(--text); }
.hint { font-size: 12px; color: var(--muted); }
.field-error { font-size: 12.5px; color: var(--red); font-weight: 500; }
.input-wrap { position: relative; }
.input-wrap.has-icon > .icon, .input-wrap .prefix { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.input-wrap.has-icon input { padding-left: 38px; }
.check { display: inline-flex; gap: 8px; align-items: center; cursor: pointer; font-size: 14px; }
.check input { width: 16px; height: 16px; accent-color: var(--brand); }
.alert { display: flex; gap: 9px; align-items: flex-start; padding: 11px 14px; border-radius: var(--radius-sm); font-size: 13.5px; }
.alert .icon { margin-top: 2px; }
.alert-error { background: var(--red-50); color: var(--red); border: 1px solid #f5c2bc; }
.alert-warn { background: var(--amber-50); color: #7a4a00; border: 1px solid #f4d9a8; }
.alert-info { background: var(--steel-50); color: var(--steel-700); border: 1px solid #cfe0ea; }
.copybox { display: flex; gap: 8px; }
.copybox input { font-size: 13px; background: var(--gray-50); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { border: 1px solid var(--line-2); background: #fff; border-radius: 999px; padding: 6px 12px; cursor: pointer; font-size: 13px; }
.chip.on { background: var(--brand-50); border-color: var(--brand); color: var(--brand); font-weight: 600; }
.codeblock { display: block; background: var(--gray-50); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; font-size: 12.5px; line-height: 1.7; word-break: break-word; }
.integ { display: flex; gap: 10px; align-items: center; }
.integ strong, .integ small { display: block; }

/* ---------- lead form ---------- */
.draft-banner { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; background: var(--amber-50); border: 1px solid #f4d9a8; border-radius: var(--radius); padding: 12px 16px; }
.form-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; }
.crumb { font-size: 12.5px; color: var(--brand-700); font-weight: 600; margin-bottom: 4px; }
.step-count { white-space: nowrap; }
.progress { height: 8px; background: #e8e4de; border-radius: 99px; overflow: hidden; margin-top: -8px; }
.progress div { height: 100%; background: var(--brand); border-radius: 99px; transition: width .3s; }
.stepper { display: flex; justify-content: space-between; margin-top: -6px; }
.step-dot { width: 34px; height: 34px; border-radius: 50%; border: 0; background: #ebe7e1; color: #8d877d; display: grid; place-items: center; cursor: pointer; }
.step-dot.done { background: #e0dbd3; color: var(--text-2); }
.step-dot.current { background: var(--brand); color: #fff; box-shadow: 0 0 0 4px var(--brand-100); }
.step-dot:disabled { cursor: default; }
.form-card h2 { font-size: 18px; }
.form-card > .muted { margin: 4px 0 20px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px 16px; }
.ff.full { grid-column: 1 / -1; }
.ff-heading { font-weight: 500; margin-bottom: -10px; }
.small-label .field-label, .ff .small-label { font-size: 13px; }
.q { font-weight: 500; margin-bottom: 10px; }
.opts { display: grid; gap: 10px; }
.cols-2 { grid-template-columns: repeat(2, 1fr); } .cols-3 { grid-template-columns: repeat(3, 1fr); } .cols-4 { grid-template-columns: repeat(4, 1fr); }
.opt { display: flex; align-items: center; gap: 10px; border: 1px solid var(--line-2); border-radius: var(--radius-sm); padding: 12px 14px; cursor: pointer; background: #fff; transition: border-color .15s, background .15s; min-height: 46px; }
.opt:hover { border-color: #e9a87a; }
.opt.on { border-color: var(--brand); background: var(--brand-50); }
.opt input, .consent input { position: absolute; opacity: 0; pointer-events: none; }
.radio { width: 17px; height: 17px; border-radius: 50%; border: 2px solid #a8a197; flex: none; position: relative; }
.opt.on .radio { border-color: var(--brand); }
.opt.on .radio::after { content: ''; position: absolute; inset: 2.5px; border-radius: 50%; background: var(--brand); }
.box { width: 18px; height: 18px; border-radius: 5px; border: 2px solid #a8a197; flex: none; display: grid; place-items: center; color: transparent; }
.opt.on .box, .consent.on .box { background: var(--brand); border-color: var(--brand); color: #fff; }
.opt:has(input:focus-visible), .consent:has(input:focus-visible) { box-shadow: 0 0 0 3px var(--brand-100); }
.consent { display: flex; gap: 12px; align-items: flex-start; border: 1px solid var(--line-2); border-radius: var(--radius-sm); padding: 16px; cursor: pointer; position: relative; }
.consent .box { margin-top: 2px; }
.consent.on { border-color: var(--brand); background: #fffaf6; }
.consent + .field-error { display: block; margin-top: 8px; }
.infobox { background: var(--gray-50); border-radius: var(--radius-sm); padding: 14px 16px; }
.infobox.warm { background: #fff7ec; border: 1px solid #f6e0bd; }
.infobox strong { display: block; margin-bottom: 3px; }
.infobox p { color: var(--muted); font-size: 13.5px; }
.form-actions { display: flex; flex-direction: column; gap: 14px; }

/* ---------- lead detail ---------- */
.detail-grid { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.wf { border-color: #ecd9ca; }
.wf-row { display: flex; gap: 14px; padding: 16px 0; border-top: 1px solid var(--line); }
.wf-row:first-of-type { border-top: 0; padding-top: 4px; }
.wf-ic { width: 36px; height: 36px; border-radius: 50%; background: var(--gray-50); color: var(--text-2); display: grid; place-items: center; flex: none; }
.wf-title { display: flex; gap: 10px; align-items: center; font-weight: 600; flex-wrap: wrap; }
.wf-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 10px; }
.wf-extra { margin: -6px 0 12px 50px; display: flex; flex-direction: column; gap: 6px; }
.wf-extra.full { margin: 4px 0 0; width: 100%; }
.pay-form { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; width: 100%; }
.pay-form .field { width: 130px; }
.pay-form .check { padding-bottom: 10px; }
.status-ctl { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.status-ctl select { width: auto; min-width: 180px; font-weight: 600; }
.answers { padding: 4px 0 14px; border-top: 1px solid var(--line); padding-top: 14px; }
.answers:first-of-type { border-top: 0; padding-top: 0; }
.answers h3 { color: var(--brand-700); font-size: 13px; text-transform: uppercase; letter-spacing: .04em; }
.answers dl { margin: 0; display: grid; gap: 8px; }
.answers dl div { display: grid; grid-template-columns: 1.3fr 1fr; gap: 12px; }
.answers dt { color: var(--muted); font-size: 13.5px; }
.answers dd { margin: 0; font-weight: 500; }
.contact { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 12px; }
.contact li { display: flex; gap: 10px; align-items: flex-start; }
.contact .icon { color: var(--muted); margin-top: 2px; }
.note-form { display: flex; flex-direction: column; gap: 8px; align-items: flex-end; margin-bottom: 16px; }
.timeline { list-style: none; margin: 0; padding: 0 0 0 16px; border-left: 2px solid var(--line); display: flex; flex-direction: column; gap: 14px; }
.timeline li { position: relative; }
.timeline li::before { content: ''; position: absolute; left: -22px; top: 6px; width: 10px; height: 10px; border-radius: 50%; background: #fff; border: 2px solid var(--brand); }
.timeline li.is-note::before { border-color: var(--amber); }
.timeline strong { display: block; font-size: 13.5px; }
.timeline p { font-size: 13.5px; color: var(--text-2); white-space: pre-wrap; }
.timeline small { font-size: 12px; }
.id-img { width: 100%; border-radius: 8px; border: 1px solid var(--line); }

/* ---------- reports ---------- */
.bars { display: flex; flex-direction: column; gap: 10px; }
.bar-row { display: grid; grid-template-columns: minmax(110px, 38%) 1fr auto; gap: 10px; align-items: center; font-size: 13.5px; }
.bar-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-2); }
.bar-track { height: 10px; background: var(--gray-50); border-radius: 99px; overflow: hidden; }
.bar-fill { display: block; height: 100%; background: var(--brand); border-radius: 99px; min-width: 3px; }
.bar-val { font-weight: 600; font-variant-numeric: tabular-nums; min-width: 26px; text-align: right; }
.daychart { display: flex; align-items: flex-end; gap: 3px; height: 160px; position: relative; padding-bottom: 22px; }
.daycol { flex: 1; height: 100%; display: flex; align-items: flex-end; }
.daybar { width: 100%; background: var(--brand); border-radius: 3px 3px 0 0; min-height: 2px; opacity: .9; }
.daycol:hover .daybar { opacity: 1; background: var(--ink); }
.dayaxis { position: absolute; bottom: 0; left: 0; right: 0; display: flex; justify-content: space-between; font-size: 11.5px; color: var(--muted); }

/* ---------- modal / toast ---------- */
.modal-backdrop { position: fixed; inset: 0; background: rgba(15, 25, 45, .55); display: grid; place-items: center; z-index: 50; padding: 16px; overflow-y: auto; }
.modal { background: #fff; border-radius: 14px; width: 100%; max-width: 480px; box-shadow: var(--shadow-lg); max-height: calc(100vh - 32px); display: flex; flex-direction: column; }
.modal-wide { max-width: 760px; }
.modal-head { display: flex; justify-content: space-between; gap: 12px; padding: 20px 22px 4px; }
.modal-head p { margin-top: 3px; font-size: 13.5px; }
.modal-body { padding: 14px 22px 22px; overflow-y: auto; }
.toasts { position: fixed; bottom: 18px; right: 18px; display: flex; flex-direction: column; gap: 8px; z-index: 60; }
.toast { background: var(--ink); color: #fff; padding: 11px 16px; border-radius: 10px; box-shadow: var(--shadow-lg); font-weight: 500; max-width: 360px; animation: pop .2s ease-out; }
.toast-warn { background: #8a4b00; }
@keyframes pop { from { transform: translateY(8px); opacity: 0; } }

/* ---------- auth ---------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; }
.auth-side { background: radial-gradient(700px 420px at 105% 110%, rgba(246,119,48,.35) 0%, transparent 60%), radial-gradient(700px 420px at -10% -10%, rgba(111,152,176,.28) 0%, transparent 60%), var(--ink); color: var(--paper); padding: 40px 48px; display: flex; flex-direction: column; justify-content: space-between; }
.auth-brand { display: flex; align-items: center; gap: 12px; font-size: 19px; font-weight: 700; }
.auth-pitch h2 { font-size: 30px; line-height: 1.2; max-width: 440px; letter-spacing: -.02em; }
.auth-pitch ul { list-style: none; padding: 0; margin: 26px 0 0; display: flex; flex-direction: column; gap: 14px; color: #cfcac2; }
.auth-pitch li .icon { color: var(--flame); }
.auth-pitch li { display: flex; gap: 10px; align-items: center; }
.auth-side small { color: #8d877d; }
.auth-main { display: grid; place-items: center; padding: 32px 16px; }
.auth-card { width: 100%; max-width: 400px; display: flex; flex-direction: column; gap: 10px; }
.auth-card form { margin-top: 12px; }
.auth-mobile-brand { display: none; align-items: center; gap: 10px; margin-bottom: 16px; }

/* ---------- public (client) pages ---------- */
.public { min-height: 100vh; background: var(--bg); }
.public-head { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 14px 16px; background: var(--ink); }
.public-head img { height: 40px; width: auto; }
.public-main { padding: 20px 16px 40px; display: flex; justify-content: center; }
.public-card { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 24px 20px; max-width: 480px; width: 100%; display: flex; flex-direction: column; gap: 16px; box-shadow: var(--shadow); }
.public-card h1 { font-size: 22px; }
.public-card.center { text-align: center; align-items: center; }
.big-ok { color: var(--green); }
.photo { display: flex; flex-direction: column; gap: 8px; }
.photo-label { font-weight: 600; }
.photo-drop { border: 2px dashed #e9b48f; border-radius: 12px; padding: 28px 16px; display: flex; flex-direction: column; align-items: center; gap: 8px; color: var(--brand-700); background: #fffaf6; cursor: pointer; font-weight: 600; position: relative; }
.photo-drop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.photo-preview { display: flex; flex-direction: column; gap: 6px; align-items: center; }
.photo-preview img { width: 100%; border-radius: 10px; border: 1px solid var(--line); }

/* ---------- responsive ---------- */
@media (max-width: 1080px) {
  .tiles { grid-template-columns: repeat(2, 1fr); }
  .detail-grid, .two-col { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; z-index: 40; left: 0; top: 0; width: 270px; transform: translateX(-100%); transition: transform .2s; box-shadow: var(--shadow-lg); }
  .menu-open .sidebar { transform: none; }
  .menu-open .scrim { display: block; position: fixed; inset: 0; background: rgba(15,25,45,.4); z-index: 30; }
  .mobilebar { display: flex; align-items: center; gap: 10px; padding: 10px 12px; background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
  .page { padding: 20px 16px 48px; gap: 18px; }
  .auth { grid-template-columns: 1fr; }
  .auth-side { display: none; }
  .auth-mobile-brand { display: flex; }
  .cols-3, .cols-4 { grid-template-columns: repeat(2, 1fr); }
  .search { min-width: 0; flex: 1 1 100%; }
}
@media (max-width: 560px) {
  .tiles { gap: 10px; }
  .tile { padding: 14px; }
  .tile-value { font-size: 24px; }
  .form-grid, .grid2 { grid-template-columns: 1fr; }
  .cols-2, .cols-3, .cols-4 { grid-template-columns: 1fr; }
  .card { padding: 18px 16px; }
  .table-wrap.flat { margin: 0 -16px -18px; }
  .stepper .step-dot { width: 30px; height: 30px; }
  .answers dl div { grid-template-columns: 1fr; gap: 2px; }
  .wf-extra { margin-left: 0; }
  .row-between > .btn { flex: 1; }
  h1 { font-size: 21px; }
}

/* ---------- payments ---------- */
.acct-line { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-2); width: 100%; }
.alert.full, .full { width: 100%; }
.muted-ic { background: var(--gray-50); color: var(--muted); }
.pay-summary { display: flex; justify-content: space-between; align-items: center; gap: 12px; background: var(--gray-50); border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; }
.pay-summary strong { font-size: 24px; letter-spacing: -.01em; }
.is-loading .tiles, .is-loading .section { opacity: .5; transition: opacity .15s; }
.tiles-3 { grid-template-columns: repeat(3, 1fr); }
.kv { display: grid; gap: 8px; }
.kv > div { display: grid; grid-template-columns: 130px 1fr; gap: 10px; align-items: center; font-size: 14px; }
.kv span:first-child { color: var(--muted); font-size: 13px; }
.center-card { align-items: center; text-align: center; max-width: 560px; margin: 20px auto; }
.center-card .field { width: 100%; text-align: left; }
.row-center { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.opt-inline { display: inline-flex; min-height: 44px; padding: 10px 16px; position: relative; }
.preview-col { position: sticky; top: 20px; }
.preview-label { display: flex; align-items: center; gap: 6px; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin-bottom: 8px; }
.sms-bubble { background: #e9e9eb; color: #111; border-radius: 18px 18px 18px 4px; padding: 10px 14px; font-size: 14px; line-height: 1.4; max-width: 92%; }
.email-preview { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; font-size: 13.5px; }
.ep-head { background: var(--ink); padding: 10px 14px; border-bottom: 3px solid var(--flame); }
.ep-head img { height: 26px; width: auto; display: block; }
.ep-body { padding: 14px; display: flex; flex-direction: column; gap: 8px; }
.ep-row { display: flex; justify-content: space-between; gap: 10px; border-bottom: 1px solid var(--line); padding-bottom: 6px; }
.ep-row span { color: var(--muted); }
.ep-btn { background: var(--brand); color: #fff; border-radius: 7px; padding: 9px 14px; font-weight: 700; text-align: center; margin-top: 4px; }
@media (max-width: 1080px) { .preview-col { position: static; } }
@media (max-width: 560px) { .tiles-3 { grid-template-columns: 1fr; } .kv > div { grid-template-columns: 1fr; gap: 2px; } }
.kv > div > .badge { justify-self: start; }

/* ---------- brand: dark sidebar with CHG logo ---------- */
.sidebar { background: var(--ink); border-right: 0; color: #d9d5ce; }
.brand { padding: 22px 18px 10px; }
.brand-logo { display: block; width: 100%; max-width: 204px; height: auto; }
.brand-role { display: block; font-size: 11.5px; letter-spacing: .08em; text-transform: uppercase; color: #8d877d; padding: 0 20px 4px; }
.brand-org { color: #b9b4ab; border-bottom: 1px solid rgba(255,255,255,.08); }
.scope-label { color: #8d877d; }
.scope select { background: var(--ink-2); color: #eee9e2; border-color: #34322e; }
.nav-item { color: #c9c4bc; }
.nav-item:hover { background: rgba(255,255,255,.06); color: #fff; }
.nav-item.active { background: rgba(246,119,48,.14); color: #fff; box-shadow: inset 3px 0 0 var(--flame); }
.nav-item.active .icon { color: var(--flame); }
.sidebar-foot { border-top: 1px solid rgba(255,255,255,.08); }
.sidebar .me:hover, .sidebar .icon-btn:hover { background: rgba(255,255,255,.07); color: #fff; }
.sidebar .me-text strong { color: #f2eee8; }
.sidebar .me-text small, .sidebar .icon-btn { color: #8d877d; }
.sidebar .avatar { background: rgba(246,119,48,.18); color: var(--flame); }
.mobilebar { background: var(--ink); border-bottom: 0; color: #fff; }
.mobilebar .icon-btn { color: #e8e3dc; }
.mobilebar img { height: 30px; width: auto; }
.logo-mark { border-radius: 9px; display: block; }
.auth-brand img { height: 64px; width: auto; }
.auth-mobile-brand { justify-content: center; background: var(--ink); border-radius: 12px; padding: 14px; }
.auth-mobile-brand img { height: 44px; width: auto; }
.btn-outline { border-color: var(--brand); color: var(--brand-700); }
.step-dot.current { background: var(--brand); color: #fff; box-shadow: 0 0 0 4px var(--brand-100); }
.daycol:hover .daybar { background: var(--brand-700); }
.toast { background: var(--ink); border-left: 4px solid var(--flame); }
.tile-note { font-size: 12.5px; color: var(--amber); font-weight: 600; margin-top: 2px; }

/* ---------- demo build only ---------- */
.demo-bar { background: #1c140d; color: #f6dcc8; border-bottom: 2px solid var(--flame); font-size: 13px; position: sticky; top: 0; z-index: 25; }
.demo-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; padding: 8px 20px; }
.demo-client { border-top: 1px solid rgba(255,255,255,.08); background: #24190f; }
.demo-tag { background: var(--flame); color: #1c140d; font-weight: 800; letter-spacing: .08em; padding: 2px 8px; border-radius: 5px; font-size: 11.5px; }
.demo-msg { color: #f6dcc8; }
.demo-as { display: inline-flex; align-items: center; gap: 8px; margin-left: auto; color: #e9c9b0; }
.demo-as select { width: auto; padding: 5px 8px; font-size: 13px; background: #2b2017; color: #fff; border-color: #5a4330; }
.demo-reset, .demo-act { background: transparent; border: 1px solid #8a5a3a; color: #fff; border-radius: 7px; padding: 5px 11px; cursor: pointer; font-size: 13px; display: inline-flex; gap: 6px; align-items: center; }
.demo-act { background: var(--flame); border-color: var(--flame); color: #1c140d; font-weight: 700; }
.demo-act.ghost { background: transparent; color: #fff; border-color: #8a5a3a; font-weight: 500; }
.demo-act:hover, .demo-reset:hover { filter: brightness(1.1); }
.demo-public .demo-row { justify-content: center; }
.demo-login { background: var(--brand-50); border: 1px solid var(--brand-100); border-radius: 10px; padding: 12px 14px; font-size: 13.5px; display: flex; flex-direction: column; gap: 8px; }
.stripe-demo { min-height: calc(100vh - 44px); display: grid; grid-template-columns: 1fr 1fr; background: #fff; font-family: -apple-system, 'Segoe UI', Roboto, sans-serif; }
.sd-left { background: #f6f9fc; padding: 60px 48px; display: flex; flex-direction: column; gap: 10px; border-right: 1px solid #e6ebf1; }
.sd-merchant { font-weight: 600; color: #30313d; }
.sd-desc { color: #6a7383; margin-top: 18px; }
.sd-amount { font-size: 36px; font-weight: 700; color: #30313d; }
.sd-note { margin-top: auto; font-size: 12.5px; color: #8792a2; max-width: 360px; }
.sd-right { padding: 60px 48px; display: flex; flex-direction: column; gap: 14px; max-width: 460px; }
.sd-right label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: #30313d; font-weight: 500; }
.sd-right input { background: #fff; border-color: #e0e6eb; }
.sd-two { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.sd-pay { background: #635bff; color: #fff; border: 0; border-radius: 6px; padding: 13px; font-weight: 600; font-size: 15px; cursor: pointer; margin-top: 8px; }
.sd-cancel { background: none; border: 0; color: #6a7383; cursor: pointer; }
@media (max-width: 760px) { .stripe-demo { grid-template-columns: 1fr; } .sd-left, .sd-right { padding: 28px 20px; } .demo-as { margin-left: 0; } }
.new-client-wrap { padding: 14px 12px 0; }
.btn.new-client { min-height: 44px; font-size: 15px; background: var(--brand); color: #fff; text-decoration: none; }
.btn.new-client:hover { background: var(--brand-700); text-decoration: none; }
a.btn { text-decoration: none; }
.edit-charge { background: var(--gray-50); border: 1px solid var(--line); border-radius: 10px; padding: 14px; }

/* ---------- Permissions ---------- */
.switch { position: relative; width: 42px; height: 24px; border-radius: 999px; border: 0; background: var(--line-2); cursor: pointer; flex: none; transition: background .15s; padding: 0; }
.switch span { position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.25); transition: transform .15s; }
.switch.on { background: var(--brand); }
.switch.on span { transform: translateX(18px); }
.switch:disabled { opacity: .6; cursor: wait; }
.switch:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.role-ladder { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 26px; }
.role-ladder > div { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.role-ladder p { margin: 8px 0 0; font-size: 13px; color: var(--text-2); line-height: 1.45; }
.perm-list { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.perm-head, .perm-row { display: grid; grid-template-columns: minmax(170px, 1.6fr) repeat(4, minmax(90px, 1fr)) 110px; align-items: center; gap: 10px; padding: 12px 16px; }
.perm-head { background: var(--gray-50, #faf9f7); font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600; border-bottom: 1px solid var(--line); }
.perm-row + .perm-row { border-top: 1px solid var(--line); }
.perm-row.inactive { opacity: .55; }
.perm-who strong { display: block; } .perm-who small { color: var(--muted); font-size: 12.5px; }
.perm-cell { display: flex; align-items: center; cursor: pointer; }
.perm-cell-label { display: none; }
.perm-actions { text-align: right; }
.perm-legend { margin: 12px 0 0; padding-left: 18px; font-size: 13px; color: var(--muted); line-height: 1.6; }
.perm-org { cursor: pointer; }
.choice-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.choice { display: flex; gap: 10px; align-items: flex-start; border: 1px solid var(--line-2); border-radius: var(--radius-sm); padding: 12px; cursor: pointer; }
.choice.on { border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand) inset; }
.choice input { margin-top: 3px; accent-color: var(--brand); }
.choice b { display: block; font-size: 14px; } .choice small { color: var(--muted); font-size: 12.5px; line-height: 1.4; }
@media (max-width: 900px) {
  .role-ladder { grid-template-columns: 1fr 1fr; }
  .perm-head { display: none; }
  .perm-row { grid-template-columns: 1fr 1fr; }
  .perm-who { grid-column: 1 / -1; }
  .perm-cell { justify-content: space-between; gap: 8px; background: var(--bg); border-radius: 8px; padding: 8px 10px; }
  .perm-cell-label { display: inline; font-size: 13px; }
  .perm-actions { grid-column: 1 / -1; text-align: left; }
}
@media (max-width: 560px) { .role-ladder, .choice-cards { grid-template-columns: 1fr; } }
