/* VIKI additions on top of the C-O-G-S design system (app.css) */
/* Accent follows the Vital360Rx mark (navy #305066 / teal #5e929e): a deep blue-teal in
   light (6.5:1 under white text, 6.1:1 on the plane), the mark's teal lifted in dark
   (8.5:1 on the plane) with dark ink on buttons (7.4:1). Charts keep --viz-1. */
:root { --accent-l: #2f6577; --accent-soft-l: #e6eff1;
  --accent-d: #7fb4c1; --accent-ink-d: #0b1f26; --accent-soft-d: #132a31; }
.f-l { font-size: 12px; font-weight: 650; color: var(--ink-2); letter-spacing: .01em; }
button.tab-l { background: none; border: 0; border-bottom: 2px solid transparent; cursor: pointer; }
.hat-pick { width: 100%; margin-top: 8px; max-width: none; }
.env-flag { font-size: 10.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  color: #7a5600; background: color-mix(in srgb, var(--warning) 22%, var(--surface)); padding: 3px 8px; border-radius: 20px; }
/* Brand: the Vital360Rx mark (logo.svg, vector so it stays crisp at any DPR) + the
   VIKI wordmark. The "by Vital360Rx" line only shows on the sign-in card. In dark the
   mark sits on a white disc: its navy would disappear on the dark plane. */
.brand-v { display: flex; align-items: center; gap: 10px; font-weight: 750; letter-spacing: -.02em; font-size: 18px; min-width: 0; }
.brand-v .mk { width: 30px; height: 30px; flex: none; display: block; border-radius: 50%; }
.brand-v .wm { display: flex; flex-direction: column; line-height: 1.1; }
.brand-v .wm small { display: none; font-size: 12px; font-weight: 550; letter-spacing: 0; color: var(--ink-2); margin-top: 2px; }
.auth-card .brand-v { font-size: 22px; gap: 12px; }
.auth-card .brand-v .mk { width: 44px; height: 44px; }
.auth-card .brand-v .wm small { display: block; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .brand-v .mk { background: #fff; padding: 2px; } }
:root[data-theme="dark"] .brand-v .mk { background: #fff; padding: 2px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
@media (max-width: 900px) { .grid-2, .grid-3 { grid-template-columns: minmax(0, 1fr); } }
.auth-wrap { min-height: 100svh; display: grid; place-items: center; padding: 20px; }
.auth-card { width: min(420px, 100%); padding: 26px; }
.bar { height: 8px; border-radius: 6px; background: var(--surface-3); overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--accent); border-radius: 6px; }
.phi-note { font-size: 12px; color: var(--ink-3); display: flex; gap: 6px; align-items: center; }
.demo-logins { display: grid; gap: 6px; margin-top: 10px; }
.demo-logins button { text-align: left; }
.list-row { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.list-row:last-child { border-bottom: 0; }

/* sign-in: emailed code */
.auth-msg { font-size: 13px; margin: 0; color: var(--ink-2); min-height: 1em; }
.auth-msg:empty { display: none; }
.auth-msg.bad { color: var(--critical); }
.code-in { font-size: 24px; letter-spacing: .3em; text-align: center; font-variant-numeric: tabular-nums; }

/* patient outreach */
.or-tabs { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
.or-tab { flex: none; border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); border-radius: 999px;
  padding: 7px 12px; font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; display: inline-flex; gap: 6px; align-items: center; }
.or-tab.on { background: var(--ink); color: var(--surface); border-color: var(--ink); }
.or-n { font-variant-numeric: tabular-nums; opacity: .7; font-weight: 500; }
.or-sub { font-size: 12px; margin-top: 2px; }
.or-call { white-space: nowrap; font-variant-numeric: tabular-nums; }
.or-late { color: var(--critical); font-weight: 600; }
.or-actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; }
.or-actions .btn { justify-content: center; }
.or-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 16px; align-items: start; }
@media (max-width: 860px) { .or-grid { grid-template-columns: 1fr; } }
.or-status { display: flex; flex-wrap: wrap; gap: 6px; }
.or-st { border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); border-radius: 8px; padding: 8px 11px;
  font: inherit; font-size: 13px; cursor: pointer; }
.or-st.on { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, transparent); color: var(--ink); font-weight: 600; }
.or-kv { display: grid; grid-template-columns: 110px 1fr; gap: 8px; font-size: 14px; }
.or-notes { white-space: pre-wrap; font-size: 13px; color: var(--ink-2); background: var(--surface-2); border-radius: 8px; padding: 8px 10px; }
.or-log { display: flex; flex-direction: column; }
.or-li { padding: 10px 0; border-top: 1px solid var(--line); }
.or-li:first-child { border-top: 0; padding-top: 0; }
.or-body { white-space: pre-wrap; margin-top: 4px; font-size: 14px; }
.or-script { font-size: 12.5px; line-height: 1.45; }
.or-stat { display: inline-flex; align-items: center; gap: 8px; align-self: flex-start; font-size: 13px; color: var(--ink-2);
  padding: 6px 12px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); text-decoration: none; }
.or-stat:hover { border-color: var(--accent); }
.or-stat svg { color: var(--accent); width: 15px; height: 15px; flex: none; }

/* outreach groups: consent → status tree (AppSheet PT Charts) + patients by surgeon */
.og-wrap { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 16px; align-items: start; }
.og-side { position: sticky; top: 72px; }
.og-ftoggle { display: none; }
.og-tree { display: flex; flex-direction: column; gap: 1px; background: var(--surface); border-radius: 16px; box-shadow: var(--sh-1); padding: 8px; }
.og-node { display: flex; align-items: center; gap: 2px; }
.og-node.d1 { padding-left: 22px; }
.og-chev, .og-chev-sp { flex: none; width: 26px; height: 30px; }
.og-chev { display: grid; place-items: center; border: 0; background: none; color: var(--ink-3); border-radius: 8px; cursor: pointer; padding: 0; }
.og-chev svg { width: 14px; height: 14px; transition: transform .18s var(--spring, ease); }
.og-chev.on svg { transform: rotate(90deg); }
.og-chev:hover { color: var(--ink); background: var(--surface-2); }
.og-pick { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; border: 0; background: none; color: var(--ink);
  font: inherit; font-size: 14px; text-align: left; padding: 6px 10px; border-radius: 999px; cursor: pointer; min-height: 32px;
  -webkit-tap-highlight-color: transparent; }
.og-node.d1 .og-pick { font-size: 13px; color: var(--ink-2); font-weight: 550; letter-spacing: .02em; }
.og-pick:hover { background: var(--surface-2); }
.og-pick.on, .og-node.d1 .og-pick.on { background: var(--accent); color: var(--accent-ink); font-weight: 650; }
.og-pick:active { transform: scale(.98); }
.og-l { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.og-c { flex: none; font-variant-numeric: tabular-nums; font-size: 12.5px; color: var(--ink-3); font-weight: 550; }
.og-pick.on .og-c { color: inherit; opacity: .85; }

.og-main { padding: 0; overflow: clip; }
.og-lhead { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 12px 16px;
  border-bottom: 1px solid color-mix(in srgb, var(--line) 70%, transparent); }
.og-lt { flex: 1 1 200px; min-width: 0; font-size: 14px; }
.og-sort .seg-b { font-size: 12.5px; }
.og-grp + .og-grp { border-top: 1px solid color-mix(in srgb, var(--line) 70%, transparent); }
.og-gh { position: sticky; top: 0; z-index: 1; width: 100%; display: flex; align-items: center; gap: 8px; border: 0; cursor: pointer;
  background: var(--surface-2);
  color: var(--ink); font: inherit; padding: 9px 16px; text-align: left; }
.og-gchev { width: 14px; height: 14px; color: var(--ink-3); transform: rotate(90deg); transition: transform .18s var(--spring, ease); }
.og-grp.shut .og-gchev { transform: none; }
.og-gn { flex: 1; font-weight: 750; letter-spacing: .03em; font-size: 13.5px; }
.og-gc { font-variant-numeric: tabular-nums; font-weight: 700; font-size: 13px; color: var(--ink-2); }
.og-row { display: flex; align-items: center; gap: 10px; padding: 0 10px 0 16px; border-top: 1px solid color-mix(in srgb, var(--line) 55%, transparent); }
.og-row:first-child { border-top: 0; }
.og-row:hover { background: color-mix(in srgb, var(--surface-2) 60%, transparent); }
.og-who { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; padding: 10px 0; color: inherit; text-decoration: none; }
.og-name { font-weight: 600; font-size: 14.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.og-sub { display: flex; flex-wrap: wrap; gap: 4px 10px; font-size: 12px; color: var(--ink-3); }
.og-sub > span { white-space: nowrap; }
.og-prac { overflow: hidden; text-overflow: ellipsis; max-width: 220px; }
.og-st { font-weight: 700; letter-spacing: .04em; font-size: 10.5px; padding: 1px 6px; border-radius: 5px; align-self: center;
  color: var(--ink-2); background: var(--surface-3); }
.og-st-contacted, .og-st-referred { color: var(--s1); background: color-mix(in srgb, var(--s1) 13%, var(--surface)); }
.og-st-sold, .og-st-enrolled, .og-st-completed { color: var(--good-ink); background: color-mix(in srgb, var(--good) 15%, var(--surface)); }
.og-acts { flex: none; display: flex; gap: 4px; }
.og-ib { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 50%; color: var(--accent);
  background: color-mix(in srgb, var(--accent) 10%, transparent); -webkit-tap-highlight-color: transparent;
  transition: transform .1s var(--spring, ease), background .12s; }
.og-ib:hover { background: color-mix(in srgb, var(--accent) 18%, transparent); }
.og-ib:active { transform: scale(.92); }
.og-ib svg { width: 18px; height: 18px; }
.or-kv-sel { align-items: center; }
.or-kv-sel .fld { max-width: 100%; }

@media (max-width: 860px) {
  .og-wrap { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .og-side { position: static; }
  .og-ftoggle { display: flex; width: 100%; align-items: center; gap: 10px; border: 0; background: var(--surface); box-shadow: var(--sh-1);
    border-radius: 14px; padding: 11px 14px; font: inherit; font-size: 14px; color: var(--ink); cursor: pointer; text-align: left; min-height: 44px; }
  .og-ftoggle > svg:first-child { color: var(--accent); flex: none; }
  .og-ft-l { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .og-ft-chev { width: 14px; height: 14px; color: var(--ink-3); transform: rotate(90deg); transition: transform .18s var(--spring, ease); }
  .og-side.open .og-ft-chev { transform: rotate(-90deg); }
  .og-tree { display: none; margin-top: 8px; }
  .og-side.open .og-tree { display: flex; }
  .og-pick { min-height: 40px; font-size: 15px; }
  .og-gh { top: 0; }
  .og-row { padding-left: 14px; padding-right: 8px; }
  .og-prac { display: none; }
  .og-ib { width: 40px; height: 40px; }
}
@media (prefers-reduced-motion: reduce) { .og-chev svg, .og-gchev, .og-ft-chev, .og-ib { transition: none; } }

/* phone menu: sectioned bottom sheet */
.msheet-scrim { position: fixed; inset: 0; z-index: 80; background: rgba(10, 14, 14, 0); transition: background .2s ease;
  display: flex; align-items: flex-end; }
.msheet-scrim.in { background: rgba(10, 14, 14, .42); }
.msheet { width: 100%; max-height: 88svh; display: flex; flex-direction: column; background: var(--plane, var(--surface));
  border-radius: 20px 20px 0 0; box-shadow: 0 -8px 30px rgba(0,0,0,.18); transform: translateY(100%);
  transition: transform .24s cubic-bezier(.2,.8,.2,1); padding-bottom: env(safe-area-inset-bottom); }
.msheet.in { transform: none; }
@media (prefers-reduced-motion: reduce) { .msheet, .msheet-scrim { transition: none; } }
.msheet-grab { width: 38px; height: 5px; border-radius: 3px; background: var(--line-2, var(--line)); margin: 8px auto 2px; }
.msheet-who { display: flex; align-items: center; gap: 12px; padding: 10px 16px 12px; border-bottom: 1px solid var(--line); }
.msheet-who .hat-pick { margin-top: 4px; width: 100%; }
.msheet-name { font-weight: 700; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.msheet-body { overflow-y: auto; padding: 6px 16px 18px; -webkit-overflow-scrolling: touch; }
.msec { margin-top: 14px; }
.msec-t { font-size: 11.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); margin: 0 2px 8px; }
.mgrid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.mtile { display: flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: 7px; padding: 12px 6px 10px;
  border-radius: 14px; background: var(--surface); border: 1px solid var(--line); color: var(--ink); text-decoration: none;
  text-align: center; min-height: 80px; }
.mtile:active { transform: scale(.97); }
.mtile-i { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center;
  background: var(--accent-soft, color-mix(in srgb, var(--accent) 14%, transparent)); color: var(--accent); }
.mtile-i svg { width: 20px; height: 20px; }
.mtile-l { font-size: 12.5px; font-weight: 600; line-height: 1.2; }
.mtile.on { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.mlist { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.mlist a, .mlist button { display: flex; align-items: center; gap: 12px; padding: 13px 14px; font: inherit; font-size: 14.5px;
  color: var(--ink); background: none; border: 0; border-top: 1px solid var(--line); text-align: left; text-decoration: none; cursor: pointer; }
.mlist > :first-child { border-top: 0; }
.mlist span { flex: 1; }
.mlist svg { width: 19px; height: 19px; color: var(--ink-3); }
.mlist-out, .mlist-out svg { color: var(--critical) !important; }
@media (min-width: 900px) { .msheet { max-width: 520px; margin: 0 auto; border-radius: 20px 20px 0 0; } }


/* searchable picker */
.ss { position: relative; }
.ss-in { width: 100%; padding-right: 34px; }
.ss-x { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); border: 0; background: none; color: var(--ink-3);
  width: 26px; height: 26px; border-radius: 6px; display: grid; place-items: center; cursor: pointer; }
.ss-x svg { width: 15px; height: 15px; }
.ss-list { display: none; position: absolute; z-index: 40; left: 0; right: 0; top: calc(100% + 4px); max-height: 300px; overflow-y: auto;
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--sh-2, 0 8px 24px rgba(0,0,0,.12)); padding: 4px;
  overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
.ss.open .ss-list { display: block; }
.ss-opt { padding: 8px 10px; border-radius: 8px; cursor: pointer; }
.ss-opt:hover, .ss-opt.on { background: var(--surface-2); }
.ss-opt.sel .ss-l { font-weight: 650; color: var(--accent); }
.ss-opt.dis { opacity: .45; cursor: default; }
.ss-l { font-size: 14px; }
.ss-s { font-size: 12px; color: var(--ink-3); margin-top: 1px; }
.ss-none { padding: 10px; color: var(--ink-3); font-size: 13px; }

/* desktop / tablet sidebar: foldable sections */
.nav-tog { display: flex; align-items: center; justify-content: space-between; width: 100%; background: none; border-left: 0;
  border-right: 0; border-bottom: 0; font: inherit; font-size: 10.5px; letter-spacing: .085em; text-transform: uppercase;
  font-weight: 650; color: var(--ink-3); cursor: pointer; text-align: left; border-radius: 0; }
.nav-sec:first-child .nav-tog { border-top: 0; margin-top: 0; padding-top: 6px; }
.nav-tog:hover { color: var(--ink); }
.nav-tog:focus-visible { outline: 2px solid var(--ring, var(--accent)); outline-offset: -2px; border-radius: 6px; }
.nav-chev { width: 14px; height: 14px; transform: rotate(90deg); transition: transform .2s cubic-bezier(.2,.8,.2,1); opacity: .7; }
.nav-sec.folded .nav-chev { transform: rotate(0deg); }
.nav-sec-b { display: grid; grid-template-rows: 1fr; transition: grid-template-rows .22s cubic-bezier(.2,.8,.2,1); }
.nav-sec.folded:not(.peek) .nav-sec-b { grid-template-rows: 0fr; }
.nav-sec-i { overflow: hidden; display: flex; flex-direction: column; gap: 2px; min-height: 0; }
.nav-sec.folded.peek .nav-sec-i > a:not(.on) { display: none; }
@media (prefers-reduced-motion: reduce) { .nav-chev, .nav-sec-b { transition: none; } }

/* outreach follow-up dates (9999): tone + icon + words, near the row's call / text icons */
.og-sec { font-size: 10.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3);
  padding: 10px 10px 4px; }
.og-sec:first-child { padding-top: 4px; }
.og-t-crit .og-c { color: var(--critical); font-weight: 750; }
.og-t-today .og-c { color: var(--accent); font-weight: 750; }
.og-fu { flex: none; display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 650; white-space: nowrap;
  padding: 4px 9px; border-radius: 999px; font-variant-numeric: tabular-nums; }
.og-fu svg { width: 13px; height: 13px; flex: none; }
.og-fu-muted { color: var(--ink-3); font-weight: 550; padding-inline: 4px; }
.og-fu-warn { color: #7a5600; background: color-mix(in srgb, var(--warning) 24%, var(--surface)); }
.og-fu-today { color: var(--accent-ink); background: var(--accent); }
.og-fu-crit { color: var(--critical); background: color-mix(in srgb, var(--critical) 12%, var(--surface)); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .og-fu-warn { color: var(--warning); } }
:root[data-theme="dark"] .og-fu-warn { color: var(--warning); }
@media (max-width: 520px) { .og-row { flex-wrap: wrap; row-gap: 0; } .og-fu { order: 3; margin: -6px 0 8px; }
  .og-who { flex-basis: calc(100% - 140px); } }

/* notifications bell (bell.js): sidebar head + phone top bar; popover on desktop, sheet on phone */
.side-head { display: flex; align-items: center; gap: 8px; }
.side-head .brand-v { flex: 1; }
.bellbtn .bell-n { top: -2px; right: -3px; }
.nf-scrim { position: fixed; inset: 0; z-index: 85; }
.nf-pop { position: fixed; width: min(400px, calc(100vw - 24px)); max-height: min(620px, calc(100svh - 32px)); display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--sh-2, 0 12px 40px rgba(0,0,0,.18));
  overflow: hidden; transform-origin: top left; animation: nf-in .16s cubic-bezier(.2,.8,.2,1); }
@keyframes nf-in { from { opacity: 0; transform: scale(.97) translateY(-4px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .nf-pop { animation: none; } }
.nf-h { display: flex; align-items: center; gap: 8px; padding: 12px 12px 10px 16px; border-bottom: 1px solid var(--line); }
.nf-h h2 { flex: 1; margin: 0; font-size: 15.5px; }
.nf-body { overflow-y: auto; padding: 6px 8px 10px; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
.nf-grp { font-size: 11px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--ink-3); padding: 10px 8px 4px; }
.nf-row { display: flex; align-items: flex-start; gap: 2px; border-radius: var(--r, 12px); }
.nf-row .notif { flex: 1; min-width: 0; }
.nf-i { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; }
.nf-i svg { width: 16px; height: 16px; }
.nf-info { color: var(--s1); background: color-mix(in srgb, var(--s1) 13%, var(--surface)); }
.nf-good { color: var(--good-ink); background: color-mix(in srgb, var(--good) 15%, var(--surface)); }
.nf-warning { color: #7a5600; background: color-mix(in srgb, var(--warning) 26%, var(--surface)); }
.nf-critical { color: var(--critical); background: color-mix(in srgb, var(--critical) 13%, var(--surface)); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .nf-warning { color: var(--warning); } }
:root[data-theme="dark"] .nf-warning { color: var(--warning); }
.notif .notif-i { margin-top: 0; }
.nf-mark { flex: none; margin: 10px 4px 0 0; width: 30px; height: 30px; border-radius: 50%; border: 0; background: none; color: var(--ink-3);
  display: grid; place-items: center; cursor: pointer; }
.nf-mark:hover { background: var(--surface-2); color: var(--ink); }
.nf-mark svg { width: 15px; height: 15px; }
.nf-empty { padding: 30px 16px; }
.msheet .nf-h { border-bottom: 1px solid var(--line); padding-top: 4px; }
.msheet .nf-body { padding-bottom: 18px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* Back to the last view (desktop: a slim row above the page; phone: left of the logo in the top bar) */
.deskback { max-width: 1180px; margin: 0 auto; padding: 12px 20px 0; }
.deskback .backbtn { margin-left: -8px; color: var(--accent); }
.deskback .backbtn[hidden] { display: none; }
.deskback:has(.backbtn[hidden]) { display: none; }
.topbar .backbtn { color: var(--accent); margin-right: 2px; }
.topbar .backbtn span { display: none; }
.backbtn[hidden] { display: none !important; }
@media (max-width: 700px), (max-width: 960px) and (max-height: 520px) { .deskback { display: none; } }
@media print { .deskback, .backbtn { display: none !important; } }
.or-danger { display: flex; justify-content: flex-end; padding: 4px 0 24px; }
.or-del { color: var(--critical); }
