/* IDVERIFYCOM compliance console */
:root {
  --brand: #0F6B4E; --brand-ink: #0A4D38; --brand-wash: #E7F1EC;
  --paper: #F6F7F5; --surface: #FFFFFF; --ink: #17211D; --muted: #5A6862; --line: #D9E0DC; --line-soft: #E9EEEB;
  --block: #B42318; --block-wash: #FDECEA; --warn: #9A4A03; --warn-wash: #FEF3E2; --info: #175CD3; --info-wash: #EAF1FD;
  --ok: #0F6B4E; --ok-wash: #E7F1EC;
  --radius: 6px; --font: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--paper); color: var(--ink); font: 14px/1.5 var(--font); }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--brand-ink); }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* top bar */
.bar { display: flex; align-items: center; gap: 16px; padding: 10px 24px; background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
.mark { display: flex; align-items: center; gap: 8px; font-weight: 700; letter-spacing: .02em; color: var(--brand-ink); text-decoration: none; }
.mark svg { width: 22px; height: 22px; }
.org { color: var(--muted); }
.bar .spacer { flex: 1; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 1px 8px; border-radius: 999px; background: var(--line-soft); color: var(--ink); font-size: 12px; white-space: nowrap; }
.chip.sandbox { background: var(--warn-wash); color: var(--warn); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 7px 14px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface); cursor: pointer; font-weight: 600; }
.btn:hover { border-color: var(--muted); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:hover { background: var(--brand-ink); }
.btn.danger { color: var(--block); border-color: #E8B4AE; }
.btn.ghost { border-color: transparent; background: transparent; color: var(--muted); }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.btn.small { padding: 3px 10px; font-size: 13px; }

main { max-width: 1320px; margin: 0 auto; padding: 24px; }
h1 { font-size: 22px; line-height: 1.25; margin: 0 0 4px; font-weight: 650; }
h2 { font-size: 15px; margin: 0; font-weight: 650; }

/* sign in */
.signin { max-width: 420px; margin: 12vh auto 0; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 28px; }
.signin h1 { margin-bottom: 6px; }
.signin p { margin: 0 0 18px; color: var(--muted); }
label.field { display: block; font-weight: 600; margin-bottom: 14px; }
label.field input, label.field select, label.field textarea { display: block; width: 100%; margin-top: 6px; padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; font-weight: 400; }
.hint { font-size: 12px; color: var(--muted); font-weight: 400; margin-top: 4px; }
.error { background: var(--block-wash); color: var(--block); border-radius: var(--radius); padding: 10px 12px; margin: 0 0 14px; }
.notice { background: var(--info-wash); color: var(--info); border-radius: var(--radius); padding: 10px 12px; margin: 0 0 14px; }
.notice.warn { background: var(--warn-wash); color: var(--warn); font-weight: 600; }
.success { background: var(--ok-wash); color: var(--brand-ink); border-radius: var(--radius); padding: 10px 12px; margin: 0 0 14px; }

/* queue */
.queue-head { display: flex; align-items: flex-end; gap: 16px; margin-bottom: 16px; flex-wrap: wrap; }
.queue-head .spacer { flex: 1; }
.search { min-width: 260px; padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 0; overflow-x: auto; }
.tab { display: flex; flex-direction: column; align-items: flex-start; padding: 10px 18px 9px; border: 0; border-bottom: 3px solid transparent; background: none; cursor: pointer; color: var(--muted); min-width: 120px; }
.tab .count { font-size: 24px; font-weight: 650; color: var(--ink); line-height: 1.1; }
.tab.alert .count { color: var(--block); }
.tab[aria-selected="true"] { border-bottom-color: var(--brand); color: var(--ink); }
.tab[aria-selected="true"] .label { font-weight: 600; }
table.cases { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--line); border-top: 0; }
.cases th { text-align: left; font-weight: 600; color: var(--muted); font-size: 12.5px; padding: 9px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.cases td { padding: 11px 12px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
.cases tbody tr { cursor: pointer; }
.cases tbody tr:hover { background: #FAFBFA; }
.cases .who { font-weight: 600; }
.cases .ref { color: var(--muted); font-size: 12.5px; }
.empty { padding: 48px 24px; text-align: center; color: var(--muted); background: var(--surface); border: 1px solid var(--line); border-top: 0; }
.more { text-align: center; padding: 14px; }

/* badges */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 1px 8px; border-radius: 4px; font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.b-ok { background: var(--ok-wash); color: var(--ok); }
.b-block { background: var(--block-wash); color: var(--block); }
.b-warn { background: var(--warn-wash); color: var(--warn); }
.b-info { background: var(--info-wash); color: var(--info); }
.b-neutral { background: var(--line-soft); color: var(--muted); }
.checks { display: flex; gap: 4px; }
.dot { width: 22px; height: 22px; border-radius: 4px; display: inline-grid; place-items: center; font-size: 11px; font-weight: 700; }

/* case */
.crumb { margin-bottom: 14px; }
.case-head { display: flex; gap: 16px; align-items: flex-start; margin-bottom: 18px; flex-wrap: wrap; }
.case-head .meta { color: var(--muted); display: flex; gap: 14px; flex-wrap: wrap; }
.case { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 20px; align-items: start; }
section.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; margin-bottom: 16px; }
.panel > header { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--line-soft); }
.panel > header .spacer { flex: 1; }
.panel .body { padding: 14px 16px; }
dl.facts { display: grid; grid-template-columns: 180px 1fr; gap: 6px 16px; margin: 0; }
dl.facts dt { color: var(--muted); }
dl.facts dd { margin: 0; }
table.plain { width: 100%; border-collapse: collapse; }
.plain th { text-align: left; color: var(--muted); font-weight: 600; font-size: 12.5px; padding: 6px 8px; border-bottom: 1px solid var(--line-soft); }
.plain td { padding: 8px; border-bottom: 1px solid var(--line-soft); vertical-align: top; }
.plain tr:last-child td { border-bottom: 0; }
.reasons { margin: 6px 0 0; padding: 0; list-style: none; }
.reasons li { padding: 2px 0 2px 14px; position: relative; color: var(--muted); }
.reasons li::before { content: ""; position: absolute; left: 2px; top: 10px; width: 5px; height: 5px; border-radius: 50%; background: var(--muted); }
.reasons li.FAIL::before { background: var(--block); }
.reasons li.REVIEW::before { background: var(--warn); }
.reasons li.INFO::before { background: var(--ok); }
.hit { border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; margin-top: 10px; }
.hit.above { border-color: #E8B4AE; background: #FFFBFA; }
.hit .score { font-size: 18px; font-weight: 650; }
.factor { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; border-bottom: 1px solid var(--line-soft); }
.factor:last-child { border-bottom: 0; }
.timeline { margin: 0; padding: 0; list-style: none; }
.timeline li { padding: 6px 0 6px 18px; border-left: 2px solid var(--line); margin-left: 6px; position: relative; }
.timeline li::before { content: ""; position: absolute; left: -6px; top: 12px; width: 10px; height: 10px; border-radius: 50%; background: var(--surface); border: 2px solid var(--brand); }

/* decision rail: the one bold element */
.rail { position: sticky; top: 76px; background: var(--surface); border: 1px solid var(--line); border-top: 4px solid var(--brand); border-radius: 8px; padding: 16px; }
.rail.blocked { border-top-color: var(--block); }
.rail.done { border-top-color: var(--muted); }
.rail h2 { margin-bottom: 4px; }
.verdict { font-size: 18px; font-weight: 650; margin: 2px 0 12px; }
.req { list-style: none; margin: 0 0 14px; padding: 0; }
.req li { display: grid; grid-template-columns: 22px 1fr; gap: 8px; padding: 7px 0; border-bottom: 1px dashed var(--line); }
.req li:last-child { border-bottom: 0; }
.req .mark-ok, .req .mark-block, .req .mark-warn { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 800; color: #fff; }
.mark-ok { background: var(--ok); } .mark-block { background: var(--block); } .mark-warn { background: var(--warn); }
.req .art { display: block; color: var(--muted); font-size: 12px; }
.rail .actions { display: grid; gap: 8px; }
.risk-meter { height: 8px; border-radius: 4px; background: var(--line-soft); overflow: hidden; margin: 6px 0 2px; }
.risk-meter span { display: block; height: 100%; }

/* dialog */
dialog { border: 1px solid var(--line); border-radius: 10px; padding: 0; max-width: 480px; width: calc(100% - 32px); }
dialog::backdrop { background: rgba(23, 33, 29, .35); }
dialog form { padding: 20px; }
dialog h2 { margin-bottom: 12px; font-size: 17px; }
dialog .row { display: flex; gap: 8px; justify-content: flex-end; margin-top: 8px; }
.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 8px; z-index: 50; }

.table-wrap { overflow-x: auto; }
@media (max-width: 960px) {
  .hide-sm { display: none !important; }
  .tab { min-width: 96px; padding: 8px 12px; }
  .search { min-width: 0; width: 100%; }
  .case-head .meta { gap: 8px; }
  .case { grid-template-columns: minmax(0, 1fr); }
  .panel .body { overflow-x: auto; }
  .case-head .meta span { overflow-wrap: anywhere; }
  .rail { position: static; }
  dl.facts { grid-template-columns: 1fr; }
  .cases .hide-sm { display: none; }
  main { padding: 16px; }
  .bar { padding: 10px 16px; gap: 8px; flex-wrap: wrap; }
  .bar .spacer { flex-basis: 0; }
  .tabs { max-width: 100%; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* utilities (no inline styles: the console runs under a strict Content-Security-Policy) */
.u-row-base { display: flex; align-items: baseline; gap: 10px; }
.u-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.u-between { display: flex; justify-content: space-between; gap: 10px; }
.u-grow { flex: 1; }
.u-small { font-size: 12.5px; } .u-xsmall { font-size: 12px; }
.u-mb10 { margin-bottom: 10px; } .u-mb12 { margin-bottom: 12px; } .u-mb18 { margin-bottom: 18px; }
.u-mt4 { margin-top: 4px; } .u-mt10 { margin-top: 10px; } .u-mt16 { margin: 16px 0 0; }
.u-pull { margin: -6px 0 12px; } .u-right { text-align: right; } .u-w34 { width: 34%; }

/* customer photos + verification link */
.photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 14px; }
.photo { margin: 0; }
.photo-btn { display: block; width: 100%; padding: 0; border: 1px solid var(--line); border-radius: var(--radius); background: #111; cursor: zoom-in; overflow: hidden; }
.photo-btn img { display: block; width: 100%; height: 130px; object-fit: contain; }
.photo figcaption { padding-top: 6px; font-size: 13px; display: grid; gap: 3px; }
dialog.zoom { max-width: min(92vw, 1100px); padding: 10px; cursor: zoom-out; }
dialog.zoom img.zoomed { display: block; max-width: 100%; max-height: 80vh; margin: 0 auto 6px; }
.linkbox { width: 100%; padding: 10px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); font-size: 13px; margin: 6px 0 10px; }
.field-set { border: 1px solid var(--line); border-radius: var(--radius); padding: 8px 12px; margin: 0 0 14px; }
.field-set legend { font-weight: 600; padding: 0 4px; }
.check-row { display: flex; align-items: center; gap: 6px; padding: 3px 0; }

/* 5A — users, sign-in second factor, four-eyes */
.who { display: inline-flex; align-items: center; gap: 8px; border: 0; background: none; padding: 4px 6px; border-radius: var(--radius); cursor: pointer; color: inherit; }
.who:hover { background: var(--line-soft); }
.qr-box { text-align: center; margin: 0 0 16px; }
.qr-box .qr { display: block; margin: 0 auto 8px; width: 200px; height: 200px; image-rendering: pixelated; border: 1px solid var(--line); border-radius: 8px; }
.qr-box .hint { margin: 6px 0 4px; }
code.secret { display: inline-block; font: 600 14px/1.4 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; letter-spacing: .06em;
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 6px 10px; user-select: all; word-break: break-all; }
code.secret.big { font-size: 20px; padding: 10px 14px; margin: 6px 0 14px; display: block; text-align: center; }
.code-input { font: 600 22px/1.2 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; letter-spacing: .3em; text-align: center; }
dialog .form { padding: 20px; }
.four-eyes { margin: 10px 0 0; padding: 8px 10px; border-radius: var(--radius); background: var(--info-wash); color: var(--info); font-size: 13px; }
.four-eyes.wait { background: var(--warn-wash); color: var(--warn); }
.row-actions { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
table.users td { vertical-align: top; }
table.users tr.muted td { color: var(--muted); }
.who-cell { font-weight: 600; }
.u-ml6 { margin-left: 6px; }
.btn.small.danger { color: var(--block); }
table.cases.users { border-top: 1px solid var(--line); }

/* 5B — integrations */
.hook-meta { margin-bottom: 6px; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.hook-meta code, table.plain code { font: 12.5px ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; overflow-wrap: anywhere; }
h3.sub { font-size: 13px; margin: 12px 0 6px; color: var(--muted); font-weight: 600; }
pre.code { margin: 0; padding: 12px; background: #17211D; color: #E7F1EC; border-radius: var(--radius); overflow-x: auto;
  font: 12.5px/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; white-space: pre; }
fieldset.field { border: 0; padding: 0; margin: 0 0 12px; }
fieldset.field legend { font-weight: 600; margin-bottom: 6px; }
fieldset.field .check { display: flex; align-items: center; gap: 6px; padding: 3px 0; font-weight: 400; }
.verb { display: inline-block; min-width: 54px; text-align: center; font: 700 11px/1.8 ui-monospace, Menlo, monospace; border-radius: 4px; padding: 0 6px; }
.v-get { background: var(--info-wash); color: var(--info); } .v-post { background: var(--ok-wash); color: var(--ok); }
.v-put, .v-patch { background: var(--warn-wash); color: var(--warn); } .v-delete { background: var(--block-wash); color: var(--block); }
table.api td { padding: 6px 8px; vertical-align: top; }
table.api td:first-child { width: 72px; } table.api td:nth-child(2) { width: 42%; }

/* 5C — monitoring */
.mon-line { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: -6px 0 12px; color: var(--muted); font-size: 13px; }
.mon-alert { border-left: 4px solid var(--warn); padding: 8px 12px; margin-bottom: 12px; background: var(--warn-wash); border-radius: 0 var(--radius) var(--radius) 0; }
.mon-alert.bad { border-color: var(--block); background: var(--block-wash); }
.mon-alert.ok { border-color: var(--ok); background: var(--ok-wash); }
.mon-head { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 6px; }
.row-actions.start { justify-content: flex-start; margin-top: 8px; }
.read-data { margin-top: 12px; border-top: 1px solid var(--line); padding-top: 10px; }

.read-chip { margin-left: 6px; font-size: .72rem; padding: 1px 7px; border-radius: 999px; font-weight: 600; }
.read-chip.confirmed, .read-chip.machine_read { background: #dcefe3; color: #17532f; }
.read-chip.consistent { background: #e6eef8; color: #1d3f6e; }
.read-chip.uncertain { background: #fdf0d3; color: #7a4d00; }
.read-chip.rejected { background: #f9dcdc; color: #8a1c1c; }
.read-chip.legacy { background: #eee; color: #555; }
.read-fix { margin-top: 3px; font-size: .82rem; color: #8a1c1c; }
