:root {
  /* Same palette and type as spartarx.com (src/index.css there): brand blue and charcoal from the logo. */
  --paper: #f6f7f9;
  --card: #ffffff;
  --ink: #0e1726;
  --ink-2: #546072;
  --rule: #dde2e9;
  --rule-soft: #eef1f5;
  --brand: #1b62b7;
  --brand-hover: #154f95;
  --brand-soft: #e7f0fa;
  --green: #2a6e38;       /* progress and "ready": the site's mint, deepened for small text */
  --green-soft: #dcefdd;
  --amber: #8F5206;
  --amber-soft: #FCF0DA;
  --red: #A3261B;
  --red-soft: #FBE6E3;
  --done: #2C6E3F;
  --rail-off: #CBD5D3;
  --focus: #1b62b7;
  --radius-s: 4px;
  --radius-m: 8px;
  font-synthesis: none;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--paper);
  color: var(--ink);
  font: 15px/1.45 "Archivo", "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  font-variant-numeric: tabular-nums;
}
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
[hidden] { display: none !important; }
.muted { color: var(--ink-2); }
.error { color: var(--red); }

/* ---------- buttons ---------- */
.btn {
  border: 1px solid var(--rule); background: var(--card); border-radius: var(--radius-s);
  padding: 7px 14px; cursor: pointer; font-weight: 500; line-height: 1.2;
}
.btn:hover { border-color: var(--ink-2); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:hover { background: var(--brand-hover); border-color: var(--brand-hover); }
.btn.primary:hover { background: #0B5649; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--ink-2); }
.btn.ghost:hover { color: var(--ink); background: var(--rule-soft); }
.btn.small { padding: 5px 10px; font-size: 13px; }
.btn[disabled] { opacity: .5; cursor: default; }
.btn.choice[aria-pressed="true"] { background: var(--ink); color: #fff; border-color: var(--ink); }
.btn.choice.refuse[aria-pressed="true"] { background: var(--red); border-color: var(--red); }

/* ---------- sign-in ---------- */
.signin { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.signin-card { background: var(--card); border: 1px solid var(--rule); border-radius: var(--radius-m); padding: 40px; max-width: 420px; width: 100%; }
.signin-card h1 { font-size: 28px; margin: 4px 0 8px; font-weight: 700; letter-spacing: -0.01em; }
.signin-card .btn { margin-top: 20px; width: 100%; padding: 11px; }
.signin-card .btn.ghost { margin-top: 8px; padding: 6px; }
.signin-form label { display: block; margin-top: 14px; font-size: 14px; color: var(--ink-2); }
.signin-form input { display: block; width: 100%; margin-top: 6px; padding: 10px 12px; font: inherit; color: var(--ink);
  background: var(--card); border: 1px solid var(--rule); border-radius: var(--radius-s); }
.signin-form input:focus { outline: 2px solid var(--brand); outline-offset: 1px; }
.signin-form p.muted { margin: 4px 0 0; }
.brand-mark { color: var(--brand); font-weight: 700; font-size: 14px; margin: 0; }

/* ---------- top bar + tabs ---------- */
.topbar {
  display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap;
  padding: 14px 24px; background: var(--card); border-bottom: 1px solid var(--rule);
}
.who { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; }
.facility-name { font-size: 19px; font-weight: 700; letter-spacing: -0.01em; }
.status { display: flex; align-items: center; gap: 14px; font-size: 13px; flex-wrap: wrap; }
.sync::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--done); margin-right: 6px; vertical-align: 1px; }
.sync.stale { color: var(--amber); }
.sync.stale::before { background: var(--amber); }
#facility-switch { border: 1px solid var(--rule); border-radius: var(--radius-s); padding: 4px 8px; background: var(--card); }

.tabs { display: flex; gap: 4px; padding: 0 24px; background: var(--card); border-bottom: 1px solid var(--rule); overflow-x: auto; }
.tab { border: 0; background: none; padding: 12px 12px 10px; cursor: pointer; color: var(--ink-2); font-weight: 600; border-bottom: 3px solid transparent; white-space: nowrap; }
.tab:hover { color: var(--ink); }
.tab.active { color: var(--ink); border-bottom-color: var(--brand); }
.count { display: inline-block; min-width: 20px; padding: 0 6px; border-radius: 10px; background: var(--amber-soft); color: var(--amber); font-size: 12px; text-align: center; margin-left: 4px; }
.count:empty { display: none; }

main { padding: 20px 24px 64px; max-width: 1480px; margin: 0 auto; }

/* ---------- toolbar ---------- */
.toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.stage-filters { display: flex; flex-wrap: wrap; gap: 6px; }
.filter {
  border: 1px solid var(--rule); background: var(--card); border-radius: 16px; padding: 4px 12px;
  font-size: 13px; cursor: pointer; color: var(--ink-2);
}
.filter b { color: var(--ink); font-weight: 600; margin-left: 4px; }
.filter[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }
.filter[aria-pressed="true"] b { color: #fff; }
input[type="search"] { border: 1px solid var(--rule); border-radius: var(--radius-s); padding: 7px 12px; min-width: 340px; background: var(--card); }

.bulkbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 10px 12px; margin-bottom: 10px; background: var(--brand-soft); border: 1px solid #c4d8f0; border-radius: var(--radius-s); }
.bulkbar span { font-weight: 600; margin-right: 6px; }

/* ---------- board table ---------- */
.rx-table { width: 100%; border-collapse: collapse; background: var(--card); border: 1px solid var(--rule); border-radius: var(--radius-m); overflow: hidden; }
.rx-table th { text-align: left; font-size: 12px; font-weight: 600; color: var(--ink-2); padding: 10px 12px; border-bottom: 1px solid var(--rule); background: #FBFCFC; }
.rx-table td { padding: 12px; border-bottom: 1px solid var(--rule-soft); vertical-align: top; }
.rx-table tr:last-child td { border-bottom: 0; }
.rx-table tbody tr { cursor: pointer; }
.rx-table tbody tr:hover td { background: #FAFCFB; }
.rx-table .sel { width: 36px; }
.patient { font-weight: 600; }
.sub { font-size: 13px; color: var(--ink-2); }
.drug { font-weight: 500; }
.sig { font-size: 13px; color: var(--ink-2); max-width: 340px; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.price { white-space: nowrap; }
.paytype { display: inline-block; font-size: 11px; font-weight: 700; border-radius: 3px; padding: 1px 5px; margin-right: 6px; border: 1px solid var(--rule); color: var(--ink-2); }
.paytype.cash { border-color: var(--amber); color: var(--amber); }

/* ---------- the progress rail ---------- */
.rail { display: grid; grid-template-columns: repeat(5, 1fr); min-width: 260px; max-width: 320px; }
.rail .step { position: relative; text-align: center; font-size: 11px; color: var(--ink-2); padding-top: 18px; }
.rail .step::before {
  content: ""; position: absolute; top: 5px; left: 50%; width: 10px; height: 10px; margin-left: -5px;
  border-radius: 50%; background: var(--card); border: 2px solid var(--rail-off); z-index: 1;
}
.rail .step::after { content: ""; position: absolute; top: 10px; left: -50%; width: 100%; height: 2px; background: var(--rail-off); }
.rail .step:first-child::after { display: none; }
.rail .step.done::before { background: var(--green); border-color: var(--green); }
.rail .step.done::after, .rail .step.current::after { background: var(--green); }
.rail .step.current::before { background: var(--card); border-color: var(--green); box-shadow: 0 0 0 3px var(--green-soft); width: 12px; height: 12px; margin-left: -6px; top: 4px; }
.rail .step.current { color: var(--ink); font-weight: 600; }
.rail .step.problem::before { border-color: var(--red); background: var(--red); box-shadow: 0 0 0 3px var(--red-soft); }
.rail .step.problem { color: var(--red); font-weight: 600; }
.rail .step.out.done::before { background: var(--done); border-color: var(--done); }
.rail.muted .step::before { border-color: var(--rail-off); background: var(--rule-soft); box-shadow: none; }
.rail.muted .step::after { background: var(--rail-off); }
.stage-note { font-size: 12px; margin-top: 4px; color: var(--ink-2); }
.stage-note.problem { color: var(--red); }
.stage-note.hold { color: var(--amber); }

/* ---------- flags + answers ---------- */
.flags { display: flex; flex-wrap: wrap; gap: 4px; }
.flag { font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 10px; white-space: nowrap; }
.flag.red { background: var(--red-soft); color: var(--red); }
.flag.amber { background: var(--amber-soft); color: var(--amber); }
.flag.green { background: var(--green-soft); color: var(--green); }
.flag.grey { background: var(--rule-soft); color: var(--ink-2); }
.answer { font-size: 13px; font-weight: 600; }
.answer.want { color: var(--green); }
.answer.refuse { color: var(--red); }
.answer.hold { color: var(--amber); }
.answer.none { color: var(--ink-2); font-weight: 400; }

.empty { background: var(--card); border: 1px dashed var(--rule); border-radius: var(--radius-m); padding: 40px; text-align: center; color: var(--ink-2); }
.more { text-align: center; padding: 14px; }

/* ---------- needs response / due / activity ---------- */
.section-head { display: flex; align-items: baseline; justify-content: space-between; margin: 26px 0 10px; }
.section-head:first-child { margin-top: 0; }
.section-head h2 { font-size: 17px; margin: 0; }
.section-head p { margin: 0; font-size: 13px; color: var(--ink-2); }
.list { background: var(--card); border: 1px solid var(--rule); border-radius: var(--radius-m); }
.item { display: grid; grid-template-columns: 220px minmax(220px, 1.2fr) minmax(240px, 1.6fr) 120px; gap: 16px; padding: 14px 16px; border-bottom: 1px solid var(--rule-soft); cursor: pointer; align-items: start; }
.item:last-child { border-bottom: 0; }
.item:hover { background: #FAFCFB; }
.item .quote { font-size: 14px; }
.item .when { font-size: 12px; color: var(--ink-2); white-space: nowrap; text-align: right; }

.log { width: 100%; border-collapse: collapse; background: var(--card); border: 1px solid var(--rule); border-radius: var(--radius-m); overflow: hidden; font-size: 14px; }
.log th { text-align: left; font-size: 12px; color: var(--ink-2); padding: 10px 12px; border-bottom: 1px solid var(--rule); background: #FBFCFC; font-weight: 600; }
.log td { padding: 10px 12px; border-bottom: 1px solid var(--rule-soft); vertical-align: top; }
.side-tag { font-size: 11px; font-weight: 700; padding: 1px 6px; border-radius: 3px; }
.side-tag.sparta { background: var(--brand-soft); color: var(--brand); }
.side-tag.facility { background: #E7EEF8; color: #234A80; }

/* ---------- patients ---------- */
.pt { background: var(--card); border: 1px solid var(--rule); border-radius: var(--radius-m); margin-bottom: 12px; }
.pt-head { display: flex; justify-content: space-between; align-items: baseline; padding: 12px 16px; border-bottom: 1px solid var(--rule-soft); gap: 12px; flex-wrap: wrap; }
.pt-head h3 { margin: 0; font-size: 16px; }
.medrow { display: grid; grid-template-columns: minmax(200px, 2fr) 1fr 1fr 1fr minmax(140px, 1.2fr); gap: 12px; padding: 10px 16px; border-bottom: 1px solid var(--rule-soft); font-size: 14px; cursor: pointer; }
.medrow:last-child { border-bottom: 0; }
.medrow:hover { background: #FAFCFB; }
.medrow.head { font-size: 12px; color: var(--ink-2); font-weight: 600; cursor: default; background: #FBFCFC; }

/* ---------- drawer ---------- */
.scrim { position: fixed; inset: 0; background: rgba(21, 41, 43, .28); z-index: 20; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(560px, 100vw); background: var(--card); z-index: 21; box-shadow: -8px 0 24px rgba(21, 41, 43, .12); overflow-y: auto; }
.drawer-inner { padding: 22px 26px 60px; }
.drawer .close { float: right; }
.drawer h2 { font-size: 21px; margin: 0 0 2px; letter-spacing: -0.01em; }
.drawer h3 { font-size: 14px; margin: 26px 0 10px; color: var(--ink); }
.facts { display: grid; grid-template-columns: 130px 1fr; gap: 6px 14px; font-size: 14px; margin: 14px 0 0; }
.facts dt { color: var(--ink-2); }
.facts dd { margin: 0; }
.timeline { list-style: none; padding: 0; margin: 0; font-size: 14px; }
.timeline li { display: grid; grid-template-columns: 150px 1fr; gap: 12px; padding: 6px 0; border-bottom: 1px solid var(--rule-soft); }
.timeline li.pending { color: var(--ink-2); }
.choices { display: flex; gap: 8px; flex-wrap: wrap; }
.thread { border: 1px solid var(--rule); border-radius: var(--radius-m); margin-bottom: 12px; }
.thread-head { display: flex; justify-content: space-between; gap: 8px; padding: 10px 12px; background: #FBFCFC; border-bottom: 1px solid var(--rule-soft); font-size: 13px; border-radius: var(--radius-m) var(--radius-m) 0 0; }
.msg { padding: 10px 12px; border-bottom: 1px solid var(--rule-soft); font-size: 14px; }
.msg:last-child { border-bottom: 0; }
.msg .meta { font-size: 12px; color: var(--ink-2); margin-bottom: 2px; }
.thread-actions { padding: 10px 12px; display: grid; gap: 8px; }
textarea, .field select { width: 100%; border: 1px solid var(--rule); border-radius: var(--radius-s); padding: 8px 10px; background: var(--card); }
textarea { min-height: 70px; resize: vertical; }
.field { display: grid; gap: 4px; margin-bottom: 8px; font-size: 13px; color: var(--ink-2); }
.row-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.history { font-size: 13px; }
.history li { padding: 4px 0; }

.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 10px 16px; border-radius: var(--radius-s); z-index: 30; font-size: 14px; }
.toast.error { background: var(--red); }

/* ---------- today page ---------- */
.dayhead { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 8px; }
.dayhead h1 { font-size: 26px; margin: 0; letter-spacing: -0.01em; }
.dayhead p { margin: 4px 0 0; }
.daynav { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.daynav input[type="date"] { border: 1px solid var(--rule); border-radius: var(--radius-s); padding: 5px 8px; background: var(--card); }
#view-today .section-head, #view-holds .section-head { margin-top: 28px; }
#view-holds .section-head:first-child { margin-top: 0; }

/* ---------- links, view switch, preview ---------- */
.linkish { border: 0; background: none; padding: 0; font: inherit; color: inherit; cursor: pointer; text-align: left; }
.linkish:hover { color: var(--brand); text-decoration: underline; text-underline-offset: 3px; }
button.patient { font-weight: 600; }
.view-as { display: inline-flex; border: 1px solid var(--rule); border-radius: var(--radius-s); overflow: hidden; }
.view-as button { border: 0; background: var(--card); padding: 5px 10px; font-size: 13px; cursor: pointer; color: var(--ink-2); }
.view-as button + button { border-left: 1px solid var(--rule); }
.view-as button.on { background: var(--ink); color: #fff; }
.preview-banner { background: #E7EEF8; color: #234A80; padding: 8px 24px; font-size: 14px; border-bottom: 1px solid #C9D7EC; }

/* ---------- patient profile ---------- */
.medlist { display: grid; gap: 8px; }
.medcard { display: grid; gap: 2px; text-align: left; border: 1px solid var(--rule); border-radius: var(--radius-m); background: var(--card); padding: 10px 12px; cursor: pointer; font: inherit; color: inherit; }
.medcard:hover { border-color: var(--ink-2); }
.stage-pill { justify-self: start; margin-top: 4px; font-size: 12px; font-weight: 600; padding: 1px 8px; border-radius: 10px; background: var(--rule-soft); color: var(--ink-2); }
.stage-pill.ready { background: var(--green-soft); color: var(--green); }
.stage-pill.rejected, .stage-pill.entered { background: var(--red-soft); color: var(--red); }
.stage-pill.filed { background: var(--amber-soft); color: var(--amber); }
.timeline li.clickable { cursor: pointer; }
.timeline li.clickable:hover { background: #FAFCFB; }

/* ---------- shared-link name prompt ---------- */
.name-dlg { border: 1px solid var(--rule); border-radius: var(--radius-m); padding: 24px; width: min(420px, calc(100vw - 32px)); color: var(--ink); }
.name-dlg::backdrop { background: rgba(21, 41, 43, .35); }
.name-dlg h2 { margin: 0 0 6px; font-size: 18px; }
.name-dlg input { width: 100%; border: 1px solid var(--rule); border-radius: var(--radius-s); padding: 9px 12px; margin: 12px 0; }
#actor .change { color: var(--brand); font-size: 13px; margin-left: 4px; }

/* ---------- sortable tables ---------- */
.rx-table th.num, .rx-table td.num { text-align: right; }
.sorter { border: 0; background: none; padding: 0; font: inherit; color: inherit; cursor: pointer; display: inline-flex; gap: 4px; align-items: center; }
.sorter:hover { color: var(--ink); }
.sorter .arrow { font-size: 9px; min-width: 9px; }
.rx-table tr.dc td { color: var(--ink-2); }
.rx-table tr.dc .drug { text-decoration: line-through; text-decoration-color: var(--rail-off); }
.cii { display: inline-block; font-size: 10px; font-weight: 700; border: 1px solid var(--amber); color: var(--amber); border-radius: 3px; padding: 0 3px; vertical-align: 1px; }
.stage-pill.discontinued, .stage-pill.transferred { background: var(--rule-soft); color: var(--ink-2); }
.stage-pill.picked_up, .stage-pill.delivered { background: #EAF2EC; color: var(--done); }
.stage-pill.dpv, .stage-pill.billed { background: #E7EEF8; color: #234A80; }

/* ---------- home ---------- */
.jump { display: flex; flex-wrap: wrap; gap: 6px; }
.jump a { text-decoration: none; }
.home-sec { scroll-margin-top: 12px; }
.home-sec + .home-sec { margin-top: 8px; }

/* ---------- patients ---------- */
.pt-toolbar { justify-content: flex-start; }
.seg { display: inline-flex; border: 1px solid var(--rule); border-radius: var(--radius-s); overflow: hidden; }
.seg button { border: 0; background: var(--card); padding: 7px 12px; cursor: pointer; color: var(--ink-2); font-size: 14px; }
.seg button + button { border-left: 1px solid var(--rule); }
.seg button[aria-pressed="true"] { background: var(--ink); color: #fff; }
.range select { border: 1px solid var(--rule); border-radius: var(--radius-s); padding: 5px 6px; background: var(--card); margin: 0 4px; }
.az { display: flex; flex-wrap: wrap; gap: 2px; margin: 4px 0 10px; position: sticky; top: 0; background: var(--paper); padding: 6px 0; z-index: 2; }
.az a, .az span { display: inline-block; min-width: 26px; text-align: center; padding: 3px 0; border-radius: 3px; font-weight: 600; font-size: 13px; }
.az a { color: var(--brand); text-decoration: none; }
.az a:hover { background: var(--brand-soft); }
.az span { color: var(--rail-off); }
.pt { scroll-margin-top: 48px; }
.pt.focus { border-color: var(--brand); box-shadow: 0 0 0 2px var(--brand-soft); }
.pt .rx-table { border: 0; border-radius: 0; }
.pt-head h3 .muted { font-weight: 400; font-size: 14px; margin-left: 6px; }
.small-link { font-size: 13px; color: var(--ink-2); }
.pad { padding: 10px 16px; margin: 0; }

/* ---------- small screens ---------- */
@media (max-width: 860px) {
  .topbar, .tabs { padding-left: 16px; padding-right: 16px; }
  main { padding: 16px 16px 64px; }
  input[type="search"] { min-width: 0; width: 100%; }
  .rx-table thead { display: none; }
  .rx-table, .rx-table tbody, .rx-table tr, .rx-table td { display: block; width: 100%; }
  .rx-table tr { border-bottom: 1px solid var(--rule); padding: 8px 0; }
  .rx-table td { border: 0; padding: 4px 12px; }
  .rx-table .sel { width: auto; }
  .rail { max-width: none; }
  .item { grid-template-columns: 1fr; gap: 6px; }
  .medrow { grid-template-columns: 1fr 1fr; }
  .medrow.head { display: none; }
  .facts { grid-template-columns: 110px 1fr; }
  .timeline li { grid-template-columns: 120px 1fr; }
}

@media (prefers-reduced-motion: no-preference) {
  .drawer:not([hidden]) { animation: slide-in .18s ease-out; }
  @keyframes slide-in { from { transform: translateX(24px); opacity: .6; } to { transform: none; opacity: 1; } }
}

/* ---------- small tracker inside table rows ---------- */
.rail.compact { min-width: 190px; max-width: 220px; }
.rail.compact .step { font-size: 10px; padding-top: 15px; }
.rail.compact .step::before { width: 10px; height: 10px; margin-left: -5px; top: 2px; }
.rail.compact .step::after { top: 6px; }
.rail.compact .step.current::before, .rail.compact .step.problem::before, .rail.compact .step.hold::before { width: 10px; height: 10px; margin-left: -5px; top: 2px; }
.rail.compact + .stage-note { margin-top: 2px; font-size: 11px; }
.rail .step.hold::before { border-color: var(--amber); background: var(--amber); box-shadow: 0 0 0 3px var(--amber-soft); }
.rail .step.hold { color: var(--amber); font-weight: 600; }

/* controlled substances: orange, like PrimeRx */
.drug.ctrl { display: inline-block; background: #F7941D; color: #3A1D00; padding: 1px 6px; border-radius: 3px; }
.rx-table tr.dc .drug.ctrl { background: #FBD3A4; }

/* collapsed patient list */
.pt-head { align-items: center; padding: 6px 12px; }
.pt:not(.open) .pt-head { border-bottom: 0; }
.pt { margin-bottom: 6px; }
.pt-toggle { flex: 1; display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; text-align: left; background: none; border: 0; padding: 6px 0; cursor: pointer; }
.pt-toggle:hover b { text-decoration: underline; }
.pt-toggle .caret { width: 12px; color: var(--ink-2); }
.pt-sum { font-size: 13px; }

.closed-note { margin-top: 16px; padding: 10px 12px; background: var(--rule-soft); border-radius: var(--radius-s); }
.rail .step.hold::after { background: var(--green); }

/* ---------- type and logo, matching spartarx.com ---------- */
h1, h2, h3, .facility-name { font-stretch: 112%; letter-spacing: -0.02em; }
.rx-table td.num, .mono { font-family: "IBM Plex Mono", ui-monospace, Menlo, monospace; font-variant-numeric: tabular-nums; }
.rx-table td.num { font-size: 14px; }
.logo { display: block; height: 26px; width: auto; }
.signin-card .logo { height: 34px; margin-bottom: 18px; }
.who .logo { margin-right: 4px; }

/* ---------- manufacturer rep board ---------- */
.rep-note { color: var(--ink-2); margin: 0 0 12px; }
.rep-filters { flex-wrap: wrap; gap: 10px; align-items: flex-end; }
.rep-filters label { display: flex; flex-direction: column; font-size: 12px; color: var(--ink-2); gap: 2px; }
.rep-filters input, .rep-filters select { padding: 6px 8px; border: 1px solid var(--rule); border-radius: var(--radius-s); background: var(--card); }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; margin: 14px 0; }
.tile { background: var(--card); border: 1px solid var(--rule); border-radius: var(--radius-m); padding: 12px 14px; display: flex; flex-direction: column; gap: 2px; }
.tile b { font-size: 22px; font-family: "IBM Plex Mono", ui-monospace, Menlo, monospace; font-weight: 500; }
.tile span { font-size: 12px; color: var(--ink-2); }
.rep-tabs { margin: 4px 0 12px; }
.rep-table td { vertical-align: top; }
.drug.mfr { color: var(--brand); font-weight: 600; }
.stage-pill.st-B { background: var(--green-soft); color: var(--green); }
.stage-pill.st-F { background: var(--amber-soft); color: var(--amber); }
.stage-pill.st-U { background: var(--rule-soft); color: var(--ink-2); }
.stage-pill.st-T { background: var(--red-soft); color: var(--red); }

/* Controlled Rx changes / daily audit: inline note box */
.inline-note { display: flex; gap: 6px; margin-top: 4px; }
.inline-note input { flex: 1; min-width: 120px; padding: 4px 8px; border: 1px solid var(--line, #d8dde6); border-radius: 6px; font: inherit; font-size: 13px; }

/* refresh from PrimeRx */
.refresh-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 0 0 10px; }
.recheck-note { margin: -4px 0 10px; }
.gone { color: #1f7a4d; font-weight: 600; }

/* shown inside the ops portal: one board, no header chrome */
body.embedded .topbar .logo, body.embedded #signout-btn, body.embedded #user-name, body.embedded #facility-switch,
body.embedded .tabs { display: none !important; }
body.embedded .topbar { padding-top: 6px; padding-bottom: 6px; }
