.shell { display: flex; min-height: 100dvh; }

/* sidebar */
.side {
  position: sticky;
  top: 0;
  flex: none;
  width: 248px;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--sidebar);
  color: var(--sidebar-text);
}
.side-brand { display: flex; align-items: center; gap: 11px; padding: 19px 18px 14px; }
.side-logo { width: 38px; height: 38px; display: grid; place-items: center; flex: none; border-radius: 11px; background: var(--purple-mid); color: #fff; font-size: 18px; }
.side-logo svg { stroke-width: 2.6; }
.side-brand strong { display: block; font-size: 17px; font-weight: 700; letter-spacing: .4px; color: #fff; line-height: 1.15; }
.side-brand small { font-size: 9px; letter-spacing: 1.4px; color: #BDB2D0; }
.side-nav { flex: 1; min-height: 0; overflow-y: auto; padding: 0 12px 12px; }
.side-label { margin: 14px 8px 5px; font-size: 10px; font-weight: 700; letter-spacing: 1.2px; text-transform: uppercase; color: var(--sidebar-muted); }
.side-nav a {
  position: relative;
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 38px;
  padding: 0 10px;
  border-radius: 9px;
  font-size: 13px;
  color: var(--sidebar-text);
  text-decoration: none;
}
.side-nav a svg { font-size: 16px; flex: none; }
.side-nav a span { flex: 1; }
.side-nav a:hover { background: rgba(255, 255, 255, .06); }
.side-nav a.on { background: var(--sidebar-active); color: #fff; font-weight: 600; }
.side-nav a.on::before { content: ''; position: absolute; left: 0; top: 8px; bottom: 8px; width: 3px; border-radius: 3px; background: var(--sidebar-accent); }
.side-nav em { min-width: 20px; padding: 1px 6px; border-radius: 10px; background: var(--sidebar-accent); color: var(--sidebar); font-size: 11px; font-style: normal; font-weight: 700; text-align: center; }
.side-user { display: flex; align-items: center; gap: 10px; padding: 13px 18px; border-top: 1px solid #453653; }
.side-avatar { width: 36px; height: 36px; display: grid; place-items: center; flex: none; border-radius: 50%; background: #7251A0; color: #fff; font-size: 12px; font-weight: 700; }
.side-user b { display: block; font-size: 13px; font-weight: 600; color: #fff; }
.side-user small { font-size: 11px; color: var(--sidebar-muted); }
.scrim { display: none; }

/* topbar */
.workspace { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.top {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 76px;
  padding: 10px 26px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.crumb { flex: 1; min-width: 0; }
.crumb small { display: block; font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.crumb h1 { font-size: 19px; font-weight: 700; line-height: 1.3; }
.search { position: relative; display: flex; align-items: center; gap: 8px; width: 260px; height: 38px; padding: 0 11px; background: #F8F6FB; border: 1px solid var(--line); border-radius: 9px; color: var(--muted); }
.search:focus-within { border-color: var(--purple); box-shadow: 0 0 0 3px rgba(84, 38, 168, .12); }
.search input { flex: 1; min-width: 0; height: 100%; border: 0; outline: 0; background: none; font-size: 13px; color: var(--ink); }
.search-results { position: absolute; top: 44px; right: 0; left: 0; z-index: 30; padding: 5px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow-lg); }
.search-results[hidden] { display: none; }
.search-results a { display: flex; align-items: center; gap: 10px; min-height: 42px; padding: 5px 9px; border-radius: 7px; color: var(--ink); text-decoration: none; font-size: 13px; }
.search-results a:hover, .search-results a:focus { background: var(--purple-soft); }
.search-results svg { color: var(--purple); flex: none; }
.search-results b { display: block; font-weight: 600; }
.search-results small { font-size: 11px; color: var(--muted); }
.search-results p { padding: 9px; font-size: 13px; color: var(--muted); }
.icon-btn { position: relative; width: 40px; height: 40px; flex: none; display: grid; place-items: center; border: 0; border-radius: 50%; background: var(--purple-soft); color: var(--purple); font-size: 17px; }
.bell i { position: absolute; top: 9px; right: 10px; width: 8px; height: 8px; border-radius: 50%; background: var(--bad); box-shadow: 0 0 0 2px var(--purple-soft); }
.top-avatar { width: 40px; height: 40px; flex: none; display: grid; place-items: center; border-radius: 50%; background: #E9E2F5; color: var(--purple); font-size: 12.5px; font-weight: 700; }
.menu-btn { display: none; }

/* page */
.page { display: flex; flex-direction: column; gap: 16px; padding: 22px 26px 34px; }
.page-head { display: flex; justify-content: space-between; align-items: center; gap: 14px; flex-wrap: wrap; }
.page-head h2 { font-size: 20px; font-weight: 700; }
.page-head p { margin-top: 1px; font-size: 13px; color: var(--muted); }
.range select { height: 40px; padding: 0 12px; background: var(--surface); border: 1px solid var(--line-2); border-radius: 9px; font-size: 13px; font-weight: 500; color: var(--ink); }
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.kpi { padding: 15px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.kpi-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; min-height: 34px; font-size: 12.5px; color: var(--ink-2); }
.kpi-top i { width: 32px; height: 32px; flex: none; display: grid; place-items: center; border-radius: 9px; background: var(--purple-soft); color: var(--purple); font-size: 15px; }
.kpi strong { display: block; margin-top: 6px; font-size: 25px; font-weight: 700; letter-spacing: -.3px; line-height: 1.2; }
.kpi-foot { margin-top: 7px; font-size: 12px; color: var(--muted); }
.kpi-foot a { font-weight: 600; }
.delta { display: inline-flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.delta svg { color: var(--ink-2); }
.delta b { color: var(--ink); font-weight: 700; }
.row { display: grid; gap: 16px; }
.row > * { min-width: 0; }
.row.two-one { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.row.even { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.box { padding: 17px 18px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.box-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 10px; min-height: 32px; }
.box-head h3 { font-size: 15px; font-weight: 700; }
.box-head a { font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.btn.small { min-height: 32px; padding: 0 10px; font-size: 12px; gap: 6px; }

/* chart */
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 0 0 8px; padding: 0; list-style: none; font-size: 12px; color: var(--ink-2); }
.legend li { display: flex; align-items: center; gap: 6px; }
.legend i { width: 16px; height: 3px; border-radius: 2px; }
.chart { position: relative; min-height: 240px; }
.chart svg { display: block; outline-offset: 3px; }
.grid { stroke: var(--line); stroke-width: 1; }
.grid.base { stroke: var(--line-2); }
.tick { font-size: 11px; fill: var(--muted); font-variant-numeric: tabular-nums; }
.line { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.dot { stroke: var(--surface); stroke-width: 2; }
.end { font-size: 12px; font-weight: 600; fill: var(--ink-2); }
.cross { stroke: var(--muted); stroke-width: 1; stroke-dasharray: 3 3; }
.hit { fill: transparent; }
.tip { position: absolute; z-index: 5; min-width: 208px; padding: 9px 11px; background: var(--ink); color: #fff; border-radius: 9px; font-size: 12px; box-shadow: var(--shadow-lg); pointer-events: none; }
.tip[hidden] { display: none; }
.tip b { display: block; margin-bottom: 4px; font-weight: 600; }
.tip span { display: flex; align-items: center; gap: 6px; padding: 1px 0; }
.tip i { width: 9px; height: 9px; flex: none; border-radius: 50%; box-shadow: 0 0 0 1px rgba(255, 255, 255, .6); }
.tip em { margin-left: auto; padding-left: 12px; font-style: normal; font-weight: 600; }

/* lists */
.stack { margin: 0; padding: 0; list-style: none; }
.int { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 10px; align-items: center; padding: 11px 0; border-bottom: 1px solid var(--line); }
.int:first-child { padding-top: 2px; }
.int:last-child { border-bottom: 0; padding-bottom: 0; }
.int-name b { display: block; font-size: 13.5px; font-weight: 600; }
.int-name small { font-size: 12px; color: var(--muted); }
.int-detail { grid-column: 1 / -1; margin-top: 3px; font-size: 12px; color: var(--ink-2); }
.table-wrap { overflow-x: auto; }
.table-wrap:focus-visible { outline: 2px solid var(--purple); outline-offset: 2px; }
.chart-table { max-height: 300px; overflow-y: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { position: sticky; top: 0; padding: 8px 12px 8px 0; background: var(--surface); border-bottom: 1px solid var(--line-2); font-size: 11px; font-weight: 600; text-align: left; white-space: nowrap; color: var(--muted); }
td { padding: 10px 12px 10px 0; border-bottom: 1px solid var(--line); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
td b { display: block; font-weight: 600; }
td small { display: block; font-size: 11px; color: var(--muted); }
td.mono { font-size: 12px; }
th.r, td.r { text-align: right; padding-right: 18px; }
.nowrap { white-space: nowrap; }
td .pill { white-space: nowrap; }
.attn { display: flex; align-items: center; gap: 11px; min-height: 56px; padding: 7px 0; border-bottom: 1px solid var(--line); color: var(--ink); text-decoration: none; }
.stack li:last-child .attn { border-bottom: 0; }
.attn > svg { color: var(--muted); flex: none; }
.attn-count { min-width: 36px; height: 36px; display: grid; place-items: center; flex: none; border-radius: 10px; font-size: 14px; font-weight: 700; color: var(--ink); }
.attn-count.warn { background: var(--warn-bg); }
.attn-count.bad { background: var(--bad-bg); }
.attn-count.info { background: var(--info-bg); }
.attn-txt { flex: 1; min-width: 0; }
.attn-txt b { display: block; font-size: 13.5px; font-weight: 600; }
.attn-txt small { display: block; font-size: 12px; color: var(--muted); }
.ops { margin: 0; padding: 0; list-style: none; }
.ops li { display: flex; gap: 13px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.ops li:first-child { padding-top: 2px; }
.ops li:last-child { border-bottom: 0; padding-bottom: 0; }
.ops time { flex: none; font-size: 12px; color: var(--muted); padding-top: 1px; }
.ops small { display: block; margin-top: 1px; font-size: 11.5px; color: var(--muted); }


@media (max-width: 1180px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .row.two-one { grid-template-columns: minmax(0, 1fr); }
  .search { width: 200px; }
}
@media (max-width: 900px) {
  .side {
    position: fixed;
    left: 0;
    z-index: 50;
    transform: translateX(-100%);
    transition: transform .2s ease;
  }
  .menu-open .side { transform: none; }
  .scrim { position: fixed; inset: 0; z-index: 40; border: 0; background: rgba(20, 12, 32, .5); }
  .menu-open .scrim { display: block; }
  .menu-btn { display: grid; }
  .row.even { grid-template-columns: minmax(0, 1fr); }
  .top { padding: 10px 16px; flex-wrap: wrap; }
  .page { padding: 16px 16px 28px; }
  .top-avatar { display: none; }
  .search { order: 5; width: 100%; }
}
@media (max-width: 480px) {
  .kpis { grid-template-columns: minmax(0, 1fr); }
  .kpi strong { font-size: 23px; }
}

.hover[hidden] { display: none; }

/* shared screen parts */
.side-reset { margin: 0 18px 13px; min-height: 32px; border: 1px solid #453653; border-radius: 8px; background: none; color: var(--sidebar-text); font-size: 12px; font-weight: 600; }
.side-reset:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.back-link { display: inline-flex; align-items: center; gap: 6px; align-self: flex-start; min-height: 32px; font-size: 13px; font-weight: 600; text-decoration: none; }
.box-note { margin: -4px 0 12px; font-size: 12.5px; color: var(--muted); }
.body-copy { margin-bottom: 12px; font-size: 13.5px; color: var(--ink-2); }
.fine { margin-top: 11px; font-size: 12px; color: var(--muted); }
.actions { display: flex; flex-wrap: wrap; gap: 10px; }
.empty { padding: 24px 0; text-align: center; color: var(--muted); }
.row-bad td { background: var(--bad-bg); }
.row-bad td:first-child { padding-left: 8px; border-radius: 6px 0 0 6px; }
.row-bad td:last-child { border-radius: 0 6px 6px 0; }
.segments { display: flex; flex-wrap: wrap; gap: 3px; align-self: flex-start; max-width: 100%; padding: 3px; background: #ECE8F3; border-radius: 10px; }
.segments button { min-height: 36px; padding: 0 14px; border: 0; border-radius: 8px; background: none; font-size: 13px; font-weight: 600; color: var(--ink-2); }
.segments button.on { background: var(--surface); color: var(--purple); box-shadow: 0 1px 3px rgba(30, 21, 51, .12); }
.notice { display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px; border-radius: 10px; font-size: 13.5px; }
.notice > svg { flex: none; margin-top: 1px; font-size: 16px; }
.notice b { display: block; font-weight: 600; }
.notice small { display: block; margin-top: 1px; font-size: 12.5px; color: var(--ink-2); }
.notice.good { background: var(--good-bg); }
.notice.good > svg { color: var(--good); }
.notice.warn { background: var(--warn-bg); }
.notice.warn > svg { color: var(--warn); }
.notice.bad { background: var(--bad-bg); }
.notice.bad > svg { color: var(--bad); }
.facts { margin: 0 0 12px; }
.facts div { display: flex; justify-content: space-between; align-items: center; gap: 14px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.facts div:last-child { border-bottom: 0; }
.facts dt { flex: none; color: var(--muted); }
.facts dd { margin: 0; font-weight: 500; text-align: right; overflow-wrap: anywhere; }
.field-s { display: block; margin: 12px 0; }
.field-s > span { display: block; margin-bottom: 5px; font-size: 12px; font-weight: 600; color: var(--ink-2); }
.field-s input, .field-s select, .field-s textarea { display: block; width: 100%; min-height: 40px; padding: 8px 11px; background: var(--surface); border: 1px solid var(--line-2); border-radius: 9px; font-size: 13.5px; resize: vertical; }
.field-s input:focus, .field-s select:focus, .field-s textarea:focus { outline: 0; border-color: var(--purple); box-shadow: 0 0 0 3px rgba(84, 38, 168, .12); }
textarea { font: inherit; color: inherit; }
.form-msg { margin-bottom: 10px; font-size: 12.5px; font-weight: 500; color: var(--bad); }
.form-msg[hidden] { display: none; }
.inline-form { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; }
.inline-form .field-s { flex: 1 1 240px; margin: 0; }
.inline-form .btn { min-height: 40px; }
.inline-form .form-msg { flex-basis: 100%; margin: 0; }
td .btn + .btn { margin-left: 4px; }

/* wallet funding */
.pipe { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 0; margin: 4px 0 14px; padding: 0; list-style: none; counter-reset: none; }
.pipe li { position: relative; padding: 0 14px 0 0; }
.pipe li::before { content: ''; position: absolute; top: 15px; left: 30px; right: 0; height: 2px; background: var(--purple-line); }
.pipe li:last-child::before { display: none; }
.pipe i { position: relative; width: 30px; height: 30px; display: grid; place-items: center; margin-bottom: 8px; border-radius: 50%; background: var(--purple-soft); color: var(--purple); font-size: 12.5px; font-style: normal; font-weight: 700; }
.pipe li:last-child i { background: var(--good-bg); color: var(--good); }
.pipe b { display: block; font-size: 13px; font-weight: 600; }
.pipe small { display: block; margin-top: 2px; font-size: 12px; line-height: 1.35; color: var(--muted); }
.pipe-stop, .recheck { display: flex; gap: 8px; font-size: 12.5px; color: var(--ink-2); }
.pipe-stop { padding: 9px 11px; border-radius: 9px; background: var(--bad-bg); }
.pipe-stop svg { color: var(--bad); margin-top: 1px; }
.recheck { margin-top: 10px; }
.recheck svg { color: var(--purple); margin-top: 1px; }
.recheck b { font-weight: 600; }

/* smart cards */
.filters { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 12px; }
.filters select, .filter-search { height: 40px; background: var(--surface); border: 1px solid var(--line-2); border-radius: 9px; font-size: 13px; }
.filters select { padding: 0 10px; color: var(--ink); }
.filter-search { flex: 1 1 240px; display: flex; align-items: center; gap: 8px; padding: 0 11px; color: var(--muted); }
.filter-search:focus-within { border-color: var(--purple); box-shadow: 0 0 0 3px rgba(84, 38, 168, .12); }
.filter-search input { flex: 1; min-width: 0; height: 100%; border: 0; outline: 0; background: none; color: var(--ink); }

/* card personalisation */
.write-steps { margin: 0 0 12px; padding: 0; list-style: none; }
.write-steps li { display: flex; align-items: center; gap: 10px; min-height: 40px; font-size: 13.5px; color: var(--muted); }
.write-steps i { width: 26px; height: 26px; display: grid; place-items: center; flex: none; border-radius: 50%; background: var(--idle-bg); font-style: normal; }
.write-steps .run { color: var(--ink); font-weight: 600; }
.write-steps .run i { background: var(--purple-soft); color: var(--purple); }
.write-steps .done { color: var(--ink); }
.write-steps .done i { background: var(--good-bg); color: var(--good); }
.write-steps .bad { color: var(--bad); font-weight: 600; }
.write-steps .bad i { background: var(--bad-bg); color: var(--bad); }
.outcome-field { max-width: 300px; }
.gate { margin: 0; padding: 0; list-style: none; }
.gate li { display: flex; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 13.5px; }
.gate li:last-child { border-bottom: 0; }
.gate svg { margin-top: 2px; color: var(--purple); }
.gate b { display: block; font-weight: 600; }
.gate small { font-size: 12px; color: var(--muted); }

@media (max-width: 900px) {
  .pipe { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .pipe li { display: grid; grid-template-columns: 30px minmax(0, 1fr); column-gap: 10px; padding: 0; }
  .pipe li::before { top: 30px; bottom: -12px; left: 14px; right: auto; width: 2px; height: auto; }
  .pipe i { grid-row: span 2; margin: 0; }
}

/* patients */
.patient-id { display: flex; align-items: center; gap: 11px; min-width: 0; margin-bottom: 12px; }
.patient-id.big { margin: 0; flex-wrap: wrap; }
.patient-id b { display: block; font-size: 15px; font-weight: 700; }
.patient-id small { display: block; font-size: 12px; color: var(--muted); overflow-wrap: anywhere; }
.patient-avatar { width: 44px; height: 44px; flex: none; display: grid; place-items: center; border-radius: 50%; background: var(--purple); color: #fff; font-size: 14px; font-weight: 700; }
.patient-balance { margin-bottom: 12px; padding: 12px 14px; border-radius: 10px; background: var(--purple-soft); }
.patient-balance small { display: block; font-size: 12px; color: var(--ink-2); }
.patient-balance strong { display: block; margin-top: 2px; font-size: 22px; font-weight: 700; overflow-wrap: anywhere; }
.patient-panel .actions { margin-top: 12px; }
.link-btn { display: block; min-height: 34px; padding: 0; border: 0; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.link-btn:hover b { color: var(--purple); text-decoration: underline; }
.link-btn b { display: block; }
.link-btn small { display: block; font-size: 12px; color: var(--muted); }
.row-on td { background: var(--purple-soft); }
.wrap-any { overflow-wrap: anywhere; }
.cell-wide { min-width: 220px; }
td small { display: block; font-size: 12px; color: var(--muted); }
td small a { color: inherit; }
tr[hidden] { display: none; }
.note-line { margin-top: 3px; color: var(--ink-2); }
.note-line svg { vertical-align: -1px; }

/* shared layout pieces */
.stack-col { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.table-wrap.tall { max-height: 560px; overflow-y: auto; }
.action-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-bottom: 12px; }
.action-grid .btn { justify-content: center; }
#wallet-actions form h4 { margin-bottom: 4px; font-size: 14px; font-weight: 700; }
#wallet-actions form .field-s { margin-top: 10px; }
#wallet-actions form .btn { margin-top: 10px; }
.inline-form.tight { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 6px; min-width: 190px; }
.inline-form.tight .field-s { flex: 1 1 130px; margin: 0; }
.inline-form.tight .form-msg { flex-basis: 100%; }
.pick-row { display: flex; gap: 6px; }
.pick-row input { flex: 1 1 auto; min-width: 0; }
#wallet-actions form .pick .btn { flex: none; margin-top: 0; min-height: 40px; }
.pick-hint { margin: 6px 0 0; font-size: 12px; font-weight: 500; color: var(--purple); }
.pick-hint[hidden], .pick-list[hidden] { display: none; }
.pick-list { margin: 6px 0 0; padding: 4px; max-height: 280px; overflow-y: auto; list-style: none; background: var(--surface); border: 1px solid var(--line-2); border-radius: 9px; }
.pick-list button { display: block; width: 100%; padding: 7px 9px; text-align: left; background: none; border: 0; border-radius: 7px; font: inherit; color: inherit; cursor: pointer; }
.pick-list button:hover, .pick-list button.active { background: var(--purple-soft); }
.pick-list b { display: block; font-size: 13px; font-weight: 600; }
.pick-list small, .pick-chosen small { display: block; font-size: 12px; color: var(--muted); }
.pick-more { padding: 7px 9px; font-size: 12px; color: var(--muted); }
.pick-chosen { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 11px; background: var(--purple-soft); border: 1px solid var(--purple-line); border-radius: 9px; }
.pick-chosen > span { min-width: 0; }
.pick-chosen b { font-size: 13.5px; font-weight: 600; }
.hold-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.stack li:last-child.hold-row, .stack li:last-child.line-row { border-bottom: 0; }
.hold-txt { flex: 1 1 260px; min-width: 0; font-size: 13.5px; }
.hold-txt small { display: block; font-size: 12px; color: var(--muted); }
.line-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.line-row > span { min-width: 0; }
.line-row b { font-weight: 600; }
.line-row small { display: block; font-size: 12px; color: var(--muted); }
.big-amount { font-size: 24px; font-weight: 700; overflow-wrap: anywhere; }
.status-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.status-card small { display: block; margin-bottom: 7px; font-size: 12px; font-weight: 600; color: var(--muted); }
.row.reverse > :first-child { order: 2; }
.row.reverse.two-one { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }

/* integrations */
.int-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.int-card { display: flex; flex-direction: column; min-width: 0; }
.int-card h3 svg { vertical-align: -2px; color: var(--purple); }
.tick-list { flex: 1; margin: 10px 0 12px; padding: 0; list-style: none; }
.tick-list li { display: flex; gap: 8px; padding: 4px 0; font-size: 13px; }
.tick-list svg { flex: none; margin-top: 3px; color: var(--purple); }
.int-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.flow { display: flex; align-items: center; gap: 10px; }
.flow-node { flex: 1; min-width: 0; padding: 12px 14px; border: 1px solid var(--line-2); border-radius: 10px; background: var(--surface); }
.flow-node.main { flex: 1.5; background: var(--purple-soft); border-color: var(--purple-line); }
.flow-node b { display: block; font-size: 13.5px; font-weight: 700; }
.flow-node small { display: block; margin-top: 2px; font-size: 12px; color: var(--ink-2); }
.flow-side { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.flow-arrow { flex: none; color: var(--muted); font-size: 16px; }

/* reports */
.share-bars { margin: 4px 0 10px; padding: 0; list-style: none; }
.share-bars li { padding: 8px 0; }
.share-label { display: flex; justify-content: space-between; gap: 8px; margin-bottom: 5px; font-size: 13px; color: var(--ink); }
.share-label b { font-weight: 600; }
.share-track { display: block; height: 6px; border-radius: 4px; background: var(--line); }
.share-track i { display: block; height: 100%; border-radius: 4px; background: var(--series-1); }
.report-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 20px; margin: 0; padding: 0; list-style: none; }
.report-list a { display: flex; align-items: center; gap: 11px; min-height: 58px; padding: 9px 0; border-bottom: 1px solid var(--line); color: var(--ink); text-decoration: none; }
.report-list a:hover b { color: var(--purple); }
.report-list a > svg { flex: none; margin-left: auto; color: var(--muted); }
.report-list b { display: block; font-size: 13.5px; font-weight: 600; }
.report-list small { display: block; font-size: 12px; color: var(--muted); }
.report-ico { width: 34px; height: 34px; flex: none; display: grid; place-items: center; border-radius: 9px; background: var(--purple-soft); color: var(--purple); }

/* settings */
.settings { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 16px; align-items: start; }
.settings-nav { display: flex; flex-direction: column; gap: 2px; padding: 8px; }
.settings-nav a { display: flex; align-items: center; gap: 9px; min-height: 40px; padding: 0 10px; border-radius: 8px; font-size: 13px; color: var(--ink-2); text-decoration: none; }
.settings-nav a:hover { background: var(--canvas); }
.settings-nav a.on { background: var(--purple-soft); color: var(--purple); font-weight: 600; }
.settings-form { display: flex; flex-direction: column; gap: 12px; max-width: 620px; }
.settings-form .field-s { margin: 0; }
.settings-form .field-s small { display: block; margin-top: 3px; font-size: 12px; color: var(--muted); }
.settings-form textarea { width: 100%; padding: 9px 11px; border: 1px solid var(--line-2); border-radius: 9px; background: var(--surface); color: var(--ink); font: inherit; resize: vertical; }
.settings-save { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.toggle-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; min-height: 44px; font-size: 13.5px; cursor: pointer; }
.toggle-row b { display: block; font-weight: 600; }
.toggle-row small { display: block; font-size: 12px; color: var(--muted); }
.toggle-row input { width: 20px; height: 20px; flex: none; accent-color: var(--purple); }
.locked-list { margin: 0; padding: 0; list-style: none; }
.locked-list li { display: flex; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 13.5px; }
.locked-list li:last-child { border-bottom: 0; }
.locked-list svg { flex: none; margin-top: 2px; color: var(--muted); }
.locked-list b { display: block; font-weight: 600; }
.locked-list small { font-size: 12px; color: var(--muted); }

/* audit */
.row-flag td { background: var(--warn-bg); }
.flag-mark { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 700; color: var(--ink); }
.flag-mark svg { color: var(--warn); }
.matrix td, .matrix th { white-space: nowrap; }

@media (max-width: 1180px) {
  .int-cards, .status-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .settings, .int-cards, .report-list, .row.reverse.two-one { grid-template-columns: minmax(0, 1fr); }
  .row.reverse > :first-child { order: 0; }
  .settings-nav { flex-direction: row; overflow-x: auto; }
  .settings-nav a { flex: none; }
  .flow { flex-direction: column; align-items: stretch; }
  .flow-arrow { transform: rotate(90deg); align-self: center; }
}
@media (max-width: 480px) {
  .status-grid { gap: 10px; }
}

@media print {
  .side, .top, .scrim, .no-print, .back-link { display: none !important; }
  body, .box { background: #fff; box-shadow: none; }
  .table-wrap, .table-wrap.tall { max-height: none; overflow: visible; }
}

/* staff sign in */
.shell[hidden] { display: none; }
.staff-gate { min-height: 100dvh; display: grid; place-items: center; padding: 24px 16px; background: var(--sidebar); }
.gate-card { width: 100%; max-width: 400px; padding: 28px; background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow-lg); }
.gate-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 22px; }
.gate-brand .side-logo { background: var(--purple); }
.gate-brand strong { display: block; font-size: 15px; font-weight: 800; letter-spacing: .08em; color: var(--ink); }
.gate-brand small { font-size: 10px; letter-spacing: .08em; color: var(--muted); }
.gate-card h1 { font-size: 21px; font-weight: 700; color: var(--ink); }
.gate-lead { margin: 3px 0 16px; font-size: 13px; color: var(--muted); }
.gate-card .btn.block { width: 100%; margin-top: 6px; }
.gate-foot { margin-top: 14px; font-size: 12px; color: var(--muted); text-align: center; }
