/* Conversion Tracker. Bootstrap 5.3 variables carry light and dark mode; only status colours are ours. */
:root {
    --ct-intake: #6c757d; --ct-waitingonus: #6f42c1; --ct-waiting: #b3261e; --ct-mapping: #b45f06;
    --ct-ready: #1565c0; --ct-testsent: #00796b; --ct-final: #2e7d32; --ct-live: #1b5e20;
    --ct-hold: #795548; --ct-complete: #455a64;
}
[data-bs-theme="dark"] {
    --ct-intake: #868e96; --ct-waitingonus: #8e6bd8; --ct-waiting: #d9443a; --ct-mapping: #d0790f;
    --ct-ready: #3d86e0; --ct-testsent: #18a396; --ct-final: #43a047; --ct-live: #2e8b3a;
    --ct-hold: #9c7a6c; --ct-complete: #6b7f8a;
}
body { font-size: 14px; background: var(--bs-tertiary-bg); }
[data-bs-theme="dark"] body { background: var(--bs-body-bg); }
.brand-dot { display: inline-block; width: 10px; height: 10px; border-radius: 3px; background: var(--ct-ready); margin-right: 8px; }
.card { border-radius: 10px; }
.page-head { margin-bottom: 1rem; }
.page-head h1 { font-size: 1.5rem; margin: 0; font-weight: 600; }
.page-head .crumbs { font-size: 13px; margin-bottom: 2px; }
.page-head .crumbs a { text-decoration: none; }

/* status */
.badge.status { font-size: 11px; letter-spacing: .3px; padding: .35em .65em; color: #fff; font-weight: 600; }
.st-Intake { background: var(--ct-intake); } .st-WaitingOnUs { background: var(--ct-waitingonus); }
.st-WaitingOnClinic { background: var(--ct-waiting); } .st-MappingSent { background: var(--ct-mapping); }
.st-ReadyToRun { background: var(--ct-ready); } .st-TestSent { background: var(--ct-testsent); }
.st-Final { background: var(--ct-final); } .st-LiveDelta { background: var(--ct-live); }
.st-OnHold { background: var(--ct-hold); } .st-Complete { background: var(--ct-complete); }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 5px; vertical-align: middle; }
.status-filter { border: 1px solid var(--bs-border-color); background: var(--bs-body-bg); border-radius: 999px; padding: 3px 10px; font-size: 12px; color: var(--bs-body-color); }
.status-filter.on { border-color: var(--ct-ready); box-shadow: 0 0 0 2px color-mix(in srgb, var(--ct-ready) 30%, transparent); }
.status-filter .n { font-weight: 700; margin-left: 4px; }

.fam-chip { display: inline-flex; align-items: center; border-radius: 6px; padding: 2px 7px; margin: 1px 3px 1px 0; font-size: 12px;
    background: var(--bs-body-bg); border: 1px solid var(--bs-border-color); white-space: nowrap; text-decoration: none; color: var(--bs-body-color); }
.fam-chip:hover { border-color: var(--ct-ready); }
.next { color: var(--bs-secondary-color); font-size: 12.5px; }
.golive.soon { color: var(--ct-mapping); font-weight: 600; }
.golive.past { color: var(--ct-waiting); font-weight: 600; }
.golive small { display: block; font-weight: 400; color: var(--bs-secondary-color); }

/* tables */
.table td, .table th { vertical-align: middle; }
.table thead th { font-size: 11.5px; text-transform: uppercase; letter-spacing: .3px; color: var(--bs-secondary-color); white-space: nowrap; }
.table thead th.sortable { cursor: pointer; user-select: none; }
.table thead th.sortable:hover { color: var(--bs-emphasis-color); }
.table thead th .arrow { opacity: .4; font-size: 10px; }
.table thead th.sorted .arrow { opacity: 1; }
.sticky-head thead th { position: sticky; top: 0; z-index: 1; background: var(--bs-body-bg); }
.clinic-card { border-left: 4px solid var(--bs-border-color); }

/* progress */
.progress { height: 8px; min-width: 70px; }
.progress.thin { height: 5px; }
.bar-low { background: var(--ct-mapping); } .bar-mid { background: var(--ct-ready); } .bar-full { background: var(--ct-final); }

/* checklists */
.check-item { display: flex; gap: .55rem; align-items: flex-start; padding: 5px 4px; border-radius: 6px; }
.check-item:hover { background: var(--bs-tertiary-bg); }
.check-item .form-check-input { margin-top: .2rem; flex-shrink: 0; }
.check-item label { cursor: pointer; }
.check-item .meta { font-size: 11.5px; color: var(--bs-secondary-color); margin-left: auto; white-space: nowrap; padding-left: .5rem; }
.check-item.done label { color: var(--bs-secondary-color); text-decoration: line-through; }
.check-item .key { font-size: 10px; color: var(--bs-secondary-color); border: 1px solid var(--bs-border-color); border-radius: 4px; padding: 0 4px; margin-left: 4px; }

details.round { border: 1px solid var(--bs-border-color); border-radius: 10px; background: var(--bs-body-bg); margin-bottom: .75rem; }
details.round > summary { list-style: none; cursor: pointer; padding: .7rem 1rem; display: flex; align-items: center; gap: .75rem; }
details.round > summary::-webkit-details-marker { display: none; }
details.round > summary::before { content: "▸"; color: var(--bs-secondary-color); transition: transform .15s; }
details.round[open] > summary::before { transform: rotate(90deg); }
details.round.current { border-color: var(--ct-ready); box-shadow: 0 0 0 1px var(--ct-ready); }
details.round .body { padding: 0 1rem .75rem 1.9rem; }
.stepper { display: flex; flex-wrap: wrap; gap: 6px; }
.stepper .step { font-size: 12px; border-radius: 999px; padding: 3px 10px; border: 1px solid var(--bs-border-color); color: var(--bs-secondary-color); }
.stepper .step.done { background: var(--ct-final); border-color: var(--ct-final); color: #fff; }
.stepper .step.current { border-color: var(--ct-ready); color: var(--bs-emphasis-color); font-weight: 600; }

/* board: columns scroll sideways inside the board, never the page */
.board { display: flex; gap: .75rem; overflow-x: auto; padding-bottom: .75rem; align-items: flex-start; scroll-snap-type: x proximity; }
.board-col { flex: 0 0 280px; max-width: 85vw; background: var(--bs-secondary-bg); border-radius: 10px; padding: .5rem; scroll-snap-align: start; }
.board-head { display: flex; align-items: center; gap: .5rem; padding: .25rem .25rem .5rem; }
.board-cards { display: flex; flex-direction: column; gap: .5rem; max-height: calc(100vh - 260px); overflow-y: auto; }
.board-card { border-radius: 8px; }
.board-card:hover { border-color: var(--ct-ready); }
.board-card .golive small { display: inline; margin-left: 4px; }

/* empty states, skeleton, misc */
.empty { text-align: center; padding: 2.5rem 1rem; color: var(--bs-secondary-color); }
.empty .icon { font-size: 28px; opacity: .6; }
.empty h2 { font-size: 1.05rem; color: var(--bs-emphasis-color); margin: .5rem 0 .25rem; }
.skeleton { background: linear-gradient(90deg, var(--bs-secondary-bg) 25%, var(--bs-tertiary-bg) 50%, var(--bs-secondary-bg) 75%);
    background-size: 200% 100%; animation: sk 1.2s infinite; border-radius: 6px; height: 14px; margin: 10px 0; }
@keyframes sk { to { background-position: -200% 0; } }
.auth-card { max-width: 420px; margin: 6vh auto; }
.qr svg { width: 240px; height: 240px; max-width: 100%; background: #fff; border-radius: 8px; }
.codes { font-family: Consolas, monospace; font-size: 15px; columns: 2; }
.key { font-family: Consolas, monospace; letter-spacing: 1px; }
.activity { max-height: 340px; overflow: auto; font-size: 12.5px; }
.activity .when { color: var(--bs-secondary-color); }
dl.facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: .75rem 1.25rem; margin: 0; }
dl.facts dt { font-size: 11.5px; font-weight: 500; color: var(--bs-secondary-color); text-transform: uppercase; letter-spacing: .3px; }
dl.facts dd { margin: 0; }
.notes { white-space: pre-wrap; }
.form-label .req { color: var(--ct-waiting); }
.syslist { max-height: 180px; overflow: auto; }
.toast { min-width: 260px; }

@media (max-width: 767.98px) {
    body { font-size: 15px; }
    .page-head h1 { font-size: 1.3rem; }
    .container-xl { padding-left: 16px; padding-right: 16px; }
    .codes { columns: 1; }
}

/* multi-select (js/multiselect.js): chips + typeahead listbox */
.ms { position: relative; }
.ms-control { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; min-height: 38px; padding: 4px 30px 4px 6px; cursor: text; position: relative; }
.ms-control.open, .ms-control:focus-within { border-color: var(--ct-ready); box-shadow: 0 0 0 .2rem color-mix(in srgb, var(--ct-ready) 25%, transparent); }
.ms-chips { display: contents; list-style: none; margin: 0; padding: 0; }
.ms-chip { display: inline-flex; align-items: center; gap: 2px; background: var(--bs-secondary-bg); border: 1px solid var(--bs-border-color);
    border-radius: 999px; padding: 1px 4px 1px 10px; font-size: 13px; max-width: 100%; }
.ms-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ms-chip-x { border: 0; background: none; color: var(--bs-secondary-color); width: 20px; height: 20px; line-height: 1; border-radius: 50%; padding: 0; font-size: 15px; }
.ms-chip-x:hover, .ms-chip-x:focus-visible { background: var(--ct-waiting); color: #fff; outline: none; }
.ms-input { flex: 1 1 120px; min-width: 120px; border: 0; outline: 0; background: transparent; color: var(--bs-body-color); padding: 3px 2px; }
.ms-clear { position: absolute; right: 22px; top: 50%; transform: translateY(-50%); font-size: 18px; line-height: 1; color: var(--bs-secondary-color); text-decoration: none; }
.ms-caret { position: absolute; right: 9px; top: 50%; transform: translateY(-50%); color: var(--bs-secondary-color); font-size: 11px; pointer-events: none; }
.ms-menu { position: absolute; z-index: 1060; left: 0; right: 0; top: calc(100% + 4px); max-height: 260px; overflow-y: auto; list-style: none; margin: 0;
    padding: 4px; background: var(--bs-body-bg); border: 1px solid var(--bs-border-color); border-radius: 8px; box-shadow: 0 8px 24px rgba(0,0,0,.15); }
.ms-option { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 6px; cursor: pointer; }
.ms-option.active { background: var(--bs-secondary-bg); }
.ms-option[aria-selected="true"] { font-weight: 600; }
.ms-check { width: 16px; text-align: center; color: var(--ct-ready); flex-shrink: 0; }
.ms-create { color: var(--ct-ready); border-top: 1px solid var(--bs-border-color); margin-top: 2px; }
.ms-empty { padding: 6px 8px; color: var(--bs-secondary-color); }
.ms-option mark { padding: 0; background: color-mix(in srgb, var(--ct-mapping) 30%, transparent); color: inherit; }
.ms-hint:empty { display: none; }
.ms-hint { margin-top: 4px; }

/* toggle pills for short fixed lists (families) */
.pill-group { display: flex; flex-wrap: wrap; gap: 6px; }
.pill-group .btn { border-radius: 999px; }
.pill-group .btn-check:disabled + .btn { opacity: .85; }

/* source system + family links with query completion */
.link-chip { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; border-radius: 6px; padding: 1px 7px; border: 1px solid; white-space: nowrap; }
.link-chip.q-done { border-color: var(--ct-final); color: var(--ct-final); background: color-mix(in srgb, var(--ct-final) 10%, transparent); }
.link-chip.q-mid  { border-color: var(--ct-ready); color: var(--ct-ready); background: color-mix(in srgb, var(--ct-ready) 10%, transparent); }
.link-chip.q-low  { border-color: var(--ct-mapping); color: var(--ct-mapping); background: color-mix(in srgb, var(--ct-mapping) 10%, transparent); }
.link-chip.q-none { border-color: var(--bs-border-color); color: var(--bs-secondary-color); border-style: dashed; }
.fam-chip .q { margin-left: 5px; font-size: 10.5px; font-weight: 700; }
.q.q-done { color: var(--ct-final); } .q.q-mid { color: var(--ct-ready); } .q.q-low { color: var(--ct-mapping); }
.facts-label { font-size: 11.5px; font-weight: 500; color: var(--bs-secondary-color); text-transform: uppercase; letter-spacing: .3px; }

/* source systems: 10-step progress checklist */
.steps { display: grid; grid-template-columns: repeat(10, 1fr); gap: 3px; }
.step-seg { height: 18px; border: 1px solid var(--bs-border-color); border-radius: 4px; background: var(--bs-body-bg); padding: 0; cursor: pointer; }
.step-seg:hover { border-color: var(--ct-ready); }
.step-seg:focus-visible { outline: 2px solid var(--ct-ready); outline-offset: 1px; }
.sf-row[data-p] .step-seg.on { background: var(--ct-mapping); border-color: var(--ct-mapping); }
.sf-row[data-p="40"] .step-seg.on, .sf-row[data-p="50"] .step-seg.on, .sf-row[data-p="60"] .step-seg.on, .sf-row[data-p="70"] .step-seg.on { background: var(--ct-ready); border-color: var(--ct-ready); }
.sf-row[data-p="80"] .step-seg.on, .sf-row[data-p="90"] .step-seg.on, .sf-row[data-p="100"] .step-seg.on { background: var(--ct-final); border-color: var(--ct-final); }
.sf-pct.q-done { color: var(--ct-final); } .sf-pct.q-mid { color: var(--ct-ready); } .sf-pct.q-low { color: var(--ct-mapping); }
.sys-state { font-weight: 600; }
.sys-none { color: var(--ct-mapping); } .sys-progress { color: var(--ct-ready); } .sys-done { color: var(--ct-final); }
.dot.sys-none { background: var(--ct-mapping); } .dot.sys-progress { background: var(--ct-ready); } .dot.sys-done { background: var(--ct-final); }
details.sf-clinics > summary { cursor: pointer; }
.sys-card .golive small { display: inline; margin-left: 4px; }

/* checklist rules: notes, N/A, prerequisites */
.check-item .item-body { flex: 1 1 auto; min-width: 0; }
.check-item .item-note { font-size: 12px; color: var(--bs-secondary-color); overflow-wrap: anywhere; }
.check-item .item-note::before { content: "Note: "; font-weight: 500; }
.check-item.na .item-note::before { content: "N/A: "; }
.check-item .item-req { font-size: 11.5px; color: var(--bs-secondary-color); }
.check-item .item-req::before { content: "🔒 "; }
.check-item.na label { text-decoration: none; font-style: italic; }
.check-item .na-badge { font-size: 10px; font-weight: 600; margin-left: 6px; padding: 0 5px; border-radius: 4px; background: var(--bs-secondary-bg); color: var(--bs-secondary-color); }
.check-item .na-btn { padding: 0 4px; font-size: 11.5px; margin-left: auto; text-decoration: none; opacity: 0; }
.check-item:hover .na-btn, .check-item .na-btn:focus-visible { opacity: 1; }
@media (hover: none) { .check-item .na-btn { opacity: .8; } }
.check-item .item-edit input { flex: 1 1 12rem; }

/* assignees: avatar circles + names */
.people { display: inline-flex; align-items: center; gap: 0; vertical-align: middle; }
.people .avatar { width: 20px; height: 20px; border-radius: 50%; display: inline-grid; place-items: center; font-size: 9.5px; font-weight: 700;
  background: var(--bs-primary-bg-subtle); color: var(--bs-primary-text-emphasis); border: 2px solid var(--bs-body-bg); margin-left: -5px; }
.people .avatar:first-child { margin-left: 0; }
.people .people-names { margin-left: 6px; }

/* a tick being saved */
.check-item.saving { opacity: .6; }

/* ---------- confirm / question dialogs (user 2026-11-29) ---------- */
dialog.ct-ask { border: 0; padding: 0; border-radius: 16px; width: min(460px, calc(100vw - 32px)); max-height: calc(100vh - 48px);
  background: var(--t-panel); color: var(--t-ink); box-shadow: 0 24px 64px -16px rgba(15, 23, 42, .45), 0 0 0 1px var(--t-line); overflow: auto; }
dialog.ct-ask::backdrop { background: rgba(15, 23, 42, .42); backdrop-filter: blur(2px); }
dialog.ct-ask[open] { animation: ct-ask-in .16s ease-out; }
@keyframes ct-ask-in { from { opacity: 0; transform: translateY(10px) scale(.98); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { dialog.ct-ask[open] { animation: none; } }
.ct-ask-body { display: flex; gap: 16px; padding: 24px 24px 6px; }
.ct-ask-ic { flex: none; width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center;
  background: var(--t-pri-soft); color: var(--t-pri); }
.ct-ask-ic .ic { width: 21px; height: 21px; margin: 0; }
.ct-ask.danger .ct-ask-ic { background: var(--ct-danger-soft, #fbecea); color: var(--ct-danger, #c63f3c); }
.ct-ask.warn .ct-ask-ic { background: var(--ct-warn-soft, #fcf2e2); color: var(--ct-warn, #c07a12); }
.ct-ask-main { min-width: 0; flex: 1; padding-top: 2px; }
.ct-ask h2 { font-size: 1.05rem; font-weight: 600; line-height: 1.35; margin: 0 0 6px; overflow-wrap: anywhere; }
.ct-ask p { color: var(--t-muted); font-size: .92rem; margin: 0 0 6px; overflow-wrap: anywhere; }
.ct-ask .form-control { margin-top: 10px; }
.ct-ask-err { color: var(--ct-danger, #c63f3c); font-size: .85rem; margin-top: 6px; }
.ct-ask-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 16px 24px 22px; }
.ct-ask-foot .btn { min-width: 96px; border-radius: 10px; font-weight: 500; }
.ct-ask-foot .btn-light { background: var(--t-wait); border-color: var(--t-line); color: var(--t-ink); }
.ct-ask-foot .btn-light:hover { background: var(--t-line); }
.ct-ask-notices { list-style: none; padding: 0; margin: 10px 0 0; display: grid; gap: 8px; }
.ct-ask-notices li { border: 1px solid var(--t-line); border-radius: 10px; padding: 9px 12px; background: var(--t-bg); font-size: .9rem;
  display: grid; gap: 3px; overflow-wrap: anywhere; }
.ct-ask-to { color: var(--t-pri); font-size: .78rem; font-weight: 600; display: inline-flex; align-items: center; gap: 5px; }
.ct-ask-to .ic { width: 14px; height: 14px; margin: 0; }
@media (max-width: 420px) { .ct-ask-body { padding: 20px 18px 4px; gap: 12px; } .ct-ask-foot { padding: 14px 18px 18px; } .ct-ask-foot .btn { flex: 1; min-width: 0; } }
