/* OptraHEALTH store — the only place this project overrides the OH template.
   Loaded after app.css. Keep it small: anything bigger belongs in a page or a component. */

/* The sidebar shows the brand, then a card naming the current workspace. The store has exactly
   one workspace, so that card only repeats the brand directly above it. */
.sidebar .usercard { display: none; }

/* ---- colourful module / product cards ----------------------------------------------------
   Each card gets an accent: a coloured left bar, a coloured initial badge, and a bold coloured
   title, so modules are easy to tell apart. Accents are dark enough to read on a light card and
   lightened for dark mode. */
.oh-acc-0 { --acc: var(--brand-acc, #0f8f80); }   /* the first accent is the brand: follows data-brand */
.oh-acc-1 { --acc: #4f56e0; }
/* under the indigo brand accent 0 IS indigo, so accent 1 takes the teal it gave up and neighbours stay distinct */
:root[data-brand="indigo"] .oh-acc-1 { --acc: #0f8f80; }
.oh-acc-2 { --acc: #b4530a; }
.oh-acc-3 { --acc: #be123c; }
.oh-acc-4 { --acc: #7c3aed; }
.oh-acc-5 { --acc: #0e7490; }

.oh-mcard { position: relative; overflow: hidden; }
.oh-mcard::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--acc);
}
.oh-mbadge {
  flex: none; width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center;
  background: var(--acc); color: #fff; font-weight: 700; font-size: 17px; line-height: 1;
}
.oh-mtitle, .oh-mtitle a { color: var(--acc); font-weight: 700; text-decoration: none; }
.oh-mtitle a:hover { text-decoration: underline; }
a.oh-mcard { text-decoration: none; color: inherit; }
a.oh-mcard:hover .oh-mtitle { text-decoration: underline; }
.oh-mcard p { color: var(--muted, inherit); }

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .oh-mtitle,
  :root:not([data-theme="light"]) .oh-mtitle a {
    color: color-mix(in srgb, var(--acc), white 34%);
  }
}
:root[data-theme="dark"] .oh-mtitle,
:root[data-theme="dark"] .oh-mtitle a {
  color: color-mix(in srgb, var(--acc), white 34%);
}

/* ---- component dashboards: colourful KPI tiles -------------------------------------------- */
.oh-kpis > .kpi:nth-child(1)::before,
.oh-kpis > [data-stat]:nth-child(1) .kpi::before { background: var(--brand-acc, #0f8f80); }
.oh-kpis > .kpi:nth-child(2)::before,
.oh-kpis > [data-stat]:nth-child(2) .kpi::before { background: #4f56e0; }
:root[data-brand="indigo"] .oh-kpis > .kpi:nth-child(2)::before,
:root[data-brand="indigo"] .oh-kpis > [data-stat]:nth-child(2) .kpi::before { background: #0f8f80; }
.oh-kpis > .kpi:nth-child(3)::before,
.oh-kpis > [data-stat]:nth-child(3) .kpi::before { background: #b4530a; }
.oh-kpis > .kpi:nth-child(4)::before,
.oh-kpis > [data-stat]:nth-child(4) .kpi::before { background: #0e9f6e; }
.oh-kpis > .kpi:nth-child(5)::before,
.oh-kpis > [data-stat]:nth-child(5) .kpi::before { background: #7c3aed; }
.oh-kpis > .kpi:nth-child(6)::before,
.oh-kpis > [data-stat]:nth-child(6) .kpi::before { background: #0e7490; }
.oh-kpis > .kpi:nth-child(7)::before,
.oh-kpis > [data-stat]:nth-child(7) .kpi::before { background: #be123c; }
/* keep a real problem red/amber whatever its position */
.oh-kpis .kpi.tone-critical::before { background: var(--danger) !important; }
.oh-kpis .kpi.tone-warn::before { background: var(--warn) !important; }

/* ---- data tables: compact toolbar, right-aligned pager, one cell font --------------------- */
.dt-toolbar { padding: 8px 12px; gap: 8px; }
.dt-toolbar .dt-search .input { min-height: 32px; }
.dt-size { margin-left: auto; }                 /* Rows control to the right, not the middle */
.dt-foot { padding-block: 8px; }
.table td { font-size: 12.5px; }
.table td .mono { font-size: 12.5px; }          /* stop the date column reading smaller than the rest */
.table td .muted.block, .table td .block.text-\[11px\] { font-size: 11px; }

/* compact filter row above a table (Status / From / To, etc.) */
.oh-filters { padding-bottom: 12px; }
.oh-filters .field { gap: 3px; }
.oh-filters .input, .oh-filters .oh-sel-btn { min-height: 34px; padding-top: .3rem; padding-bottom: .3rem; }
.oh-filters label { font-size: 11px; margin-bottom: 2px; }

/* the "Download the template" link — make it stand out */
.oh-dl { color: var(--brand-600); font-weight: 600; text-decoration: underline; }
.oh-dl:hover { color: var(--brand-700); }
:root[data-theme="dark"] .oh-dl { color: color-mix(in srgb, var(--brand-500), white 25%); }

/* ---- SweetAlert2 dialogs: repair the skin in app.css --------------------------------------
   Two faults, both visible on every success/error/confirm dialog in the store:

   1. app.css sets `border-radius: var(--r-lg)`, but --r-lg is not a token this theme defines
      (the radius tokens are --r / --r-sm / --r-xs / --r-pill). An undefined var() makes the
      whole declaration invalid, so the popup fell back to border-radius:0 — square corners,
      and the timer bar's own 5px corners then poked out past them.

   2. SweetAlert2 measures the ENTIRE icon in em off the icon's own font-size: the circle is
      5em, the border .25em, and the tick, cross and ring are placed at em offsets. app.css
      resized the box in pixels (52px) but left those em offsets alone, so the tick kept its
      full-size geometry and hung outside the shrunken circle — the broken checkmark.
      Sizing by font-size instead scales every piece together: 10.4px x 5em = the same 52px.

   Fixed here rather than in app.css so the template file stays untouched. */
.swal2-popup { border-radius: var(--r) !important; }

.swal2-icon {
  font-size: 10.4px !important;                 /* 5em = 52px, and every piece follows */
  width: 5em !important; height: 5em !important;
  border-width: .25em !important;
  line-height: 5em !important;
  margin: 0 auto 14px !important;
}
.swal2-icon .swal2-icon-content { font-size: 3.75em !important; }   /* the ! i ? glyph, back in proportion */

/* the auto-dismiss bar must follow the popup's corners, not its own hard-coded 5px */
.swal2-timer-progress-bar-container {
  height: 4px !important; overflow: hidden !important;
  border-bottom-left-radius: var(--r) !important;
  border-bottom-right-radius: var(--r) !important;
}
.swal2-timer-progress-bar { height: 4px !important; }

/* ---- Modules page: one heading per category ------------------------------------------------
   The cards are grouped by the `category` in components.yaml, and Products keeps the same
   heading, so the page reads as a set of named shelves rather than one long wall. */
.oh-cat-h { margin: 26px 0 12px; }
#cards > .oh-cat-h:first-child { margin-top: 16px; }

/* A component switched off in components.yaml: same card, dashed edge and a grey badge, so it
   reads as parked rather than broken. It carries a "Turned off" tag instead of Open. */
.oh-mcard-off { border-style: dashed; }
.oh-mcard-off::before { opacity: .4; }
.oh-mcard-off .oh-mbadge { background: var(--sunk); color: var(--ink-muted); }

/* ============================================================================
   Stepper — the beat-by-beat progress an eligibility check or an estimate shows
   in place of a spinner (OH.ui.runSteps). Tokens only; light + dark via the
   theme variables. */
.oh-stepper-scrim {
  position: fixed; inset: 0; z-index: 1200;
  display: grid; place-items: center;
  background: color-mix(in srgb, var(--ink) 34%, transparent);
  -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px);
  opacity: 0; transition: opacity .2s ease;
}
.oh-stepper-scrim.is-in { opacity: 1; }
.oh-stepper-scrim.is-out { opacity: 0; }
.oh-stepper {
  width: min(380px, calc(100vw - 40px));
  background: var(--card); color: var(--ink);
  border: 1px solid var(--line); border-radius: var(--r-lg);
  box-shadow: 0 18px 50px rgba(0,0,0,.22);
  padding: 22px 24px;
  transform: translateY(6px) scale(.99); transition: transform .22s ease;
}
.oh-stepper-scrim.is-in .oh-stepper { transform: none; }
.oh-stepper-title { font-size: 15px; font-weight: 700; letter-spacing: -.01em; margin-bottom: 14px; }
.oh-stepper-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.oh-stepper-list li {
  display: flex; align-items: center; gap: 12px;
  padding: 8px 2px; font-size: 14px; color: var(--ink-soft);
  transition: color .2s ease;
}
.oh-step-dot {
  flex: none; width: 20px; height: 20px; border-radius: 50%;
  border: 2px solid var(--line); background: var(--card);
  position: relative; transition: border-color .2s ease, background .2s ease;
}
/* pending → current → done */
.oh-stepper-list li.is-current { color: var(--ink); font-weight: 600; }
.oh-stepper-list li.is-current .oh-step-dot {
  border-color: var(--brand-500);
  animation: oh-step-pulse 1s ease-in-out infinite;
}
.oh-stepper-list li.is-current .oh-step-dot::after {
  content: ""; position: absolute; inset: 3px; border-radius: 50%;
  border: 2px solid var(--brand-500); border-right-color: transparent;
  animation: oh-step-spin .7s linear infinite;
}
.oh-stepper-list li.is-done { color: var(--ink); }
.oh-stepper-list li.is-done .oh-step-dot {
  border-color: var(--brand-500); background: var(--brand-500);
}
.oh-stepper-list li.is-done .oh-step-dot::after {
  content: ""; position: absolute; left: 5px; top: 2px; width: 5px; height: 9px;
  border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(42deg); animation: none;
}
.oh-stepper-list li.is-result .oh-step-dot { border-color: var(--ok); background: var(--ok); }
.oh-stepper-list li.is-result { color: var(--ink); font-weight: 700; }
.oh-stepper-list li.is-error { color: var(--danger); font-weight: 600; }
.oh-stepper-list li.is-error .oh-step-dot { border-color: var(--danger); background: var(--danger); }
.oh-stepper-list li.is-error .oh-step-dot::after {
  content: "!"; position: absolute; inset: 0; display: grid; place-items: center;
  color: #fff; font-size: 12px; font-weight: 800; border: 0; animation: none;
}
.oh-stepper-err { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.oh-stepper-err p { margin: 0 0 10px; font-size: 13px; color: var(--danger); }
@keyframes oh-step-spin { to { transform: rotate(360deg); } }
@keyframes oh-step-pulse { 0%,100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--brand-500) 40%, transparent); }
  50% { box-shadow: 0 0 0 5px transparent; } }
@media (prefers-reduced-motion: reduce) {
  .oh-stepper-list li.is-current .oh-step-dot,
  .oh-stepper-list li.is-current .oh-step-dot::after { animation: none; }
}

/* ---- searchable dropdown: the filter box shown at the top of a long select menu.
   Enhances the existing .oh-sel machinery; only new selectors, no overrides. */
.oh-sel-menu.has-search { padding-top: 0; }
.oh-sel-search {
  position: sticky; top: 0; z-index: 1;
  margin: 0 -5px 4px; padding: 6px; background: var(--card);
  border-bottom: 1px solid var(--rule);
}
.oh-sel-search input {
  width: 100%; box-sizing: border-box; min-height: 32px;
  padding: 6px 10px; font-size: 13px; color: var(--ink);
  background: var(--surface-2); border: 1px solid var(--rule); border-radius: var(--r-xs);
  outline: none;
}
.oh-sel-search input:focus { border-color: var(--brand-400); background: var(--card); }
.oh-sel-search input::placeholder { color: var(--ink-soft); }
.oh-sel-opt.is-hidden { display: none !important; }
.oh-sel-noopt { padding: 10px 11px; font-size: 12.5px; color: var(--ink-soft); text-align: center; }

/* ---- Export to EHR receipt (OH.ui.exportEHR) ---- */
.ehr-receipt { text-align: center; padding: 4px 2px; }
.ehr-ok { width: 52px; height: 52px; margin: 4px auto 12px; border-radius: 50%;
  display: grid; place-items: center; color: var(--ok);
  background: color-mix(in srgb, var(--ok) 15%, transparent); }
.ehr-lead { font-size: 15px; margin: 0 0 14px; color: var(--ink); }
.ehr-meta { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; text-align: left;
  max-width: 300px; margin: 0 auto 14px; font-size: 13px; }
.ehr-meta span { color: var(--ink-muted); }
.ehr-meta b { text-align: right; font-variant-numeric: tabular-nums; }
.ehr-wrote { text-align: left; border: 1px solid var(--line); border-radius: var(--r-sm);
  padding: 4px 12px; margin: 0 0 14px; }
.ehr-wrote-h { font-size: 11px; text-transform: uppercase; letter-spacing: .05em;
  color: var(--ink-muted); padding: 9px 0 6px; border-bottom: 1px solid var(--line); }
.ehr-row { display: flex; justify-content: space-between; gap: 16px; padding: 8px 0;
  border-bottom: 1px solid var(--line); font-size: 13.5px; }
.ehr-row:last-child { border-bottom: 0; }
.ehr-row span { color: var(--ink-muted); }
.ehr-foot { font-size: 12.5px; color: var(--ink-muted); margin: 0; }

/* The progress view: a rail the beats sit on, what each one is doing, how long it took, and how
   far through the whole thing we are. A column of circles says none of that. */
.oh-stepper { width: min(460px, calc(100vw - 40px)); }
.oh-stepper-head { margin-bottom: 14px; }
.oh-stepper-sub { margin-top: 2px; font-size: 12.5px; color: var(--ink-soft); }
.oh-stepper-list { position: relative; }
.oh-stepper-list li { align-items: flex-start; padding: 7px 2px; position: relative; }
/* the rail, drawn behind the dots */
.oh-stepper-list li:not(:last-child)::before {
  content: ""; position: absolute; left: 9px; top: 26px; bottom: -6px; width: 2px;
  background: var(--line); transition: background .25s ease;
}
.oh-stepper-list li.is-done:not(:last-child)::before { background: var(--brand-500); }
.oh-step-body { display: flex; flex-direction: column; gap: 1px; min-width: 0; flex: 1; }
.oh-step-sub { font-size: 12px; font-weight: 400; color: var(--ink-soft); line-height: 1.35; }
.oh-stepper-list li.is-current .oh-step-sub { color: var(--ink-muted); }
.oh-stepper-list li:not(.is-current):not(.is-done) .oh-step-sub { opacity: .55; }
.oh-step-ms { flex: none; font-size: 11.5px; color: var(--ink-soft); font-variant-numeric: tabular-nums;
  padding-top: 2px; }
.oh-stepper-bar { margin-top: 16px; display: flex; align-items: center; gap: 10px; }
.oh-stepper-bar i { display: block; flex: 1; height: 4px; border-radius: 999px;
  background: var(--line); position: relative; overflow: hidden; }
.oh-stepper-bar i s { position: absolute; inset: 0 auto 0 0; width: 0;
  background: var(--brand-500); border-radius: 999px; transition: width .25s ease; }
.oh-stepper-bar b { font-size: 11.5px; font-weight: 600; color: var(--ink-soft); white-space: nowrap; }

/* ---- the revenue cycle dashboard ----------------------------------------------------------
   One bar per set of counts, with its own key underneath. A bar says the shape of a hundred
   accounts in a glance, which a column of six numbers does not; the key carries the numbers
   themselves, because a proportion nobody can read exactly is only half an answer. */
.oh-bar { display: flex; height: 12px; border-radius: 999px; overflow: hidden;
  background: var(--sunk); }
.oh-bar > i { display: block; background: var(--brand-400); }
.oh-bar > i + i { box-shadow: inset 1px 0 0 var(--card); }
.oh-bar > i.tone-ok { background: var(--ok); }
.oh-bar > i.tone-warn { background: var(--warn); }
.oh-bar > i.tone-info { background: var(--brand-400); }
.oh-bar > i.tone-plain { background: var(--brand-200); }

/* The key wraps across the full width rather than stacking into a narrow column: there is room
   for it, and a legend that reads as a list is slower than one that reads as a line. */
.oh-barkey { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 12px;
  font-size: 12.5px; color: var(--ink-muted); }
.oh-barkey-item { display: inline-flex; align-items: center; gap: 7px; }
.oh-barkey-item.is-empty { opacity: .45; }
.oh-barkey-item > i { width: 9px; height: 9px; border-radius: 3px; flex: none;
  background: var(--brand-400); }
.oh-barkey-item > i.tone-ok { background: var(--ok); }
.oh-barkey-item > i.tone-warn { background: var(--warn); }
.oh-barkey-item > i.tone-info { background: var(--brand-400); }
.oh-barkey-item > i.tone-plain { background: var(--brand-200); }
.oh-barkey-item > b { font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; }

/* What each state means, beside its name, on one line while the width allows it. */
.oh-deflist { display: flex; flex-direction: column; gap: 7px; font-size: 12.5px; }
.oh-deflist li { display: flex; flex-wrap: wrap; gap: 4px 10px; line-height: 1.4; }
.oh-deflist li > b { font-weight: 600; flex: none; }
.oh-deflist li > .muted { flex: 1 1 260px; }

.oh-flaglist { display: flex; flex-direction: column; gap: 2px; font-size: 13px; }
.oh-flaglist li { display: flex; align-items: center; gap: 10px; padding: 7px 0;
  border-bottom: 1px solid var(--rule); }
.oh-flaglist li:last-child { border-bottom: 0; }
.oh-flaglist li > b { font-weight: 600; font-variant-numeric: tabular-nums; min-width: 24px;
  text-align: right; }

/* A tile that links somewhere is still a tile: no underline, but it lifts like a card does. */
.kpi.no-underline { text-decoration: none; color: inherit; transition: box-shadow .18s ease,
  transform .18s ease; }
.kpi.no-underline:hover { box-shadow: var(--sh-2); transform: translateY(-1px); }

/* ---- the Clinic View look, on every module page ---------------------------------------------
   The clinical team's day and the revenue-cycle dashboard open on a blue band with the numbers
   in frosted tiles, soft pill-shaped tags and rounded cards. Every other module page draws its
   headline figures with OH.ui.stats and its sections as .oh-sec, so restyling those here gives
   the whole product one look instead of two. */
.oh-stats { position: relative; overflow: hidden; padding: 16px; border-radius: 20px; gap: 12px;
  background:
    radial-gradient(900px 260px at 100% 0%, rgb(255 255 255 / .14), transparent 60%),
    linear-gradient(120deg, var(--brand-700, #0b4f9c) 0%, var(--brand-500, #1c6fd1) 58%, var(--brand-400, #3f8ae6) 100%);
  box-shadow: 0 14px 34px -18px color-mix(in srgb, var(--brand-700, #0b4f9c) 70%, transparent); }
.oh-stats::after { content: ""; position: absolute; right: -60px; bottom: -110px; width: 260px; height: 260px;
  border-radius: 50%; background: rgb(255 255 255 / .07); pointer-events: none; }
.oh-stats .oh-stat { z-index: 1; border-radius: 14px; box-shadow: none; color: #fff;
  background: rgb(255 255 255 / .12); border: 1px solid rgb(255 255 255 / .18);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.oh-stats .oh-stat::before { display: none; }
.oh-stats .oh-stat-l { color: rgb(255 255 255 / .84); font-weight: 600; }
.oh-stats .oh-stat-v { color: #fff; }
.oh-stats .oh-stat-body > :not(.oh-stat-l):not(.oh-stat-v):not(.oh-stat-d) { color: rgb(255 255 255 / .75); }
.oh-stats .oh-stat-ico,
.oh-stats .oh-stat[class*="t-"] .oh-stat-ico { background: rgb(255 255 255 / .18); color: #fff; }
.oh-stats .oh-stat-d, .oh-stats .oh-stat-d.is-down, .oh-stats .oh-stat-d.is-flat {
  background: rgb(255 255 255 / .2); color: #fff; }
.oh-stats .oh-stat.is-clickable:hover { background: rgb(255 255 255 / .2); border-color: rgb(255 255 255 / .35); box-shadow: none; }
.oh-stats .oh-stat.is-on { background: #fff; border-color: #fff; color: var(--ink); }
.oh-stats .oh-stat.is-on .oh-stat-l { color: var(--ink-muted); }
.oh-stats .oh-stat.is-on .oh-stat-v { color: var(--brand-700, #0b4f9c); }
.oh-stats .oh-stat.is-on .oh-stat-ico { background: var(--brand-50); color: var(--brand-600); }

/* sections: the rounder, softer card of the clinic's pages */
.oh-sec { border-radius: 18px; box-shadow: 0 1px 2px rgb(15 23 42 / .04), 0 8px 24px -16px rgb(15 23 42 / .18); }

/* tags: the clinic's pills — fully rounded, no outline, the pastel fill carrying the meaning */
.tag { border-radius: 999px; font-weight: 700; font-size: 11.5px; padding: 4px 10px; }
.tag-outline { border-color: transparent; background: var(--sunk, #eef1f5); color: var(--ink-muted); }
.tag-ok { background: #e7f7ee; color: #0e6b40; }
.tag-warn { background: #fff1d6; color: #9a5b00; }
.tag-critical { background: #fdecec; color: #b42318; }
.tag-info, .tag-brand { background: color-mix(in srgb, var(--brand-500, #1c6fd1) 12%, transparent); color: var(--brand-700, #0b4f9c); }
html[data-theme="dark"] .tag-ok { background: var(--ok-bg); color: var(--ok); }
html[data-theme="dark"] .tag-warn { background: var(--warn-bg); color: var(--warn); }
html[data-theme="dark"] .tag-critical { background: var(--danger-bg); color: var(--danger); }

/* A tab bar with more tabs than width wraps onto a second line. It used to scroll sideways with
   its scrollbar hidden, so the tabs past the edge (RCM Masters' last three) could not be reached. */
.oh-tabnav { flex-wrap: wrap; overflow: visible; row-gap: 0; }

/* The template's tab bar scrolls sideways with its scrollbar hidden, so on Configuration (one tab per
   component) everything after RPA was out of sight with no sign it was there. Tabs wrap instead. */
.tabs { flex-wrap: wrap; overflow: visible; row-gap: 0; }

/* Row actions in every table are coloured, so each is seen at a glance: delete red, edit blue,
   open teal, anything else in the brand colour. A disabled one stays grey. */
.row-acts .btn-icon:not(:disabled) { color: var(--brand-600); }
.row-acts .btn-icon:not(:disabled):hover { background: color-mix(in srgb, currentColor 12%, transparent); }
.row-acts .btn-icon[data-del]:not(:disabled) { color: #d92d20; }
.row-acts .btn-icon:not(:disabled):is([aria-label^="Edit"], [title^="Edit"], [aria-label^="Change"], [title^="Change"]) { color: #2563eb; }
.row-acts .btn-icon:not(:disabled):is([aria-label^="Open"], [title^="Open"], [aria-label^="View"], [title^="View"]) { color: #0e9384; }
.row-acts .btn-icon:disabled { color: var(--ink-soft); opacity: .55; }
:root[data-theme="dark"] .row-acts .btn-icon[data-del]:not(:disabled) { color: #f97066; }
:root[data-theme="dark"] .row-acts .btn-icon:not(:disabled):is([aria-label^="Edit"], [title^="Edit"]) { color: #84adff; }
:root[data-theme="dark"] .row-acts .btn-icon:not(:disabled):is([aria-label^="Open"], [title^="Open"]) { color: #2ed3b7; }

/* a date of birth: typed, or picked with a month list, a year list and the days */
.oh-dob { position: relative; display: block; }
.oh-dob .input { padding-right: 40px; }
.oh-dob-btn { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); width: 30px; height: 30px; border: 0; border-radius: 8px;
  background: transparent; color: var(--brand-600); display: grid; place-items: center; cursor: pointer; }
.oh-dob-btn:hover { background: var(--brand-50); }
.oh-dob-pop { position: fixed; z-index: 2000; width: 292px; padding: 12px; border-radius: 14px;
  background: var(--surface, #fff); border: 1px solid var(--rule); box-shadow: 0 16px 40px -12px rgb(0 0 0 / .3); }
.oh-dob-head { display: grid; grid-template-columns: 1.5fr 1fr; gap: 8px; margin-bottom: 10px; }
.oh-dob-head .input { height: 36px; padding: 0 8px; font-size: 13.5px; }
.oh-dob-week, .oh-dob-days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; text-align: center; }
.oh-dob-week span { font-size: 11px; font-weight: 600; color: var(--ink-soft); padding: 4px 0; }
.oh-dob-days button { height: 34px; border: 0; border-radius: 8px; background: transparent; font: inherit; font-size: 13px; color: var(--ink); cursor: pointer; }
.oh-dob-days button:hover:not(:disabled) { background: var(--brand-50); color: var(--brand-700); }
.oh-dob-days button.is-on { background: var(--brand-500); color: #fff; font-weight: 600; }
.oh-dob-days button:disabled { color: var(--ink-soft); opacity: .4; cursor: default; }

/* a PDF in a dialog: pages drawn as they come into view */
.oh-pdf-bar { display: flex; align-items: center; gap: 4px; margin-bottom: 8px; }
.oh-pdf-pct { min-width: 48px; text-align: center; font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; }
.oh-pdf-at { margin-left: auto; font-size: 12.5px; color: var(--ink-muted); }
.oh-pdf.is-wide { align-items: flex-start; overflow-x: auto; }
.oh-pdf { max-height: 68vh; overflow-y: auto; padding: 14px; background: var(--sunk, #e9eef4); border-radius: 10px;
  display: flex; flex-direction: column; align-items: center; gap: 12px; }
.oh-pdf-page { flex-shrink: 0; background: #fff; box-shadow: 0 1px 6px rgb(0 0 0 / .15); border-radius: 3px; display: grid; place-items: center; max-width: 100%; }
.oh-pdf-page > span { font-size: 12px; color: var(--ink-soft); }
.oh-pdf-page canvas { display: block; max-width: 100%; }
.oh-pdf-msg { padding: 40px; color: var(--ink-muted); text-align: center; }

/* the prior authorisation master (pa-master.js) */
.pam-sources { display: grid; grid-template-columns: repeat(auto-fit, minmax(380px, 1fr)); gap: 12px; }
.pam-src { display: flex; gap: 12px; padding: 14px 16px; border-radius: 12px; border: 1px solid var(--rule); background: var(--brand-50); }
.pam-src-ico { flex: none; width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; background: var(--surface, #fff); color: var(--brand-600); }
.pam-src-t { font-size: 13px; margin: 2px 0 4px; }
.pam-star { color: var(--warn, #b54708); font-weight: 700; margin-left: 2px; }
.pam-svc td { vertical-align: top; min-width: 140px; }

/* the Payer rule library: a dialog of fixed height in which only the table scrolls — the lists, the
   tabs, the search and the pages stay where they are */
.oh-modal.pam-modal { height: min(92vh, 1000px); display: flex; flex-direction: column; }
.oh-modal.pam-modal .oh-modal-body { display: flex; flex-direction: column; overflow: hidden; min-height: 0; }
.pam-modal .pa-lib-body, .pam-modal .pam-body { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.pam-modal .pa-lib-body > *, .pam-modal .pam-body > * { flex: none; }
.pam-modal .pam-body > section.card { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.pam-modal #pamCodes, .pam-modal #pamCodes > .dt { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.pam-modal #pamCodes .dt > * { flex: none; }
.pam-modal #pamCodes .dt-scroll { flex: 1; min-height: 0; max-height: none; }
.pam-modal .pam-body > section.card > .overflow-x-auto { flex: 1; min-height: 0; overflow: auto; }
.pam-modal .pa-lib-body > .pam-body { flex: 1; min-height: 0; }     /* the list area takes the space left */
.oh-pdf.is-wide .oh-pdf-page, .oh-pdf.is-wide .oh-pdf-page canvas { max-width: none; }   /* zoomed in: wider than the window, scrolled sideways */
/* in the dialog the document cards are compact, so the table keeps the room */
.pam-modal .pam-src { padding: 8px 12px; gap: 10px; align-items: center; }
.pam-modal .pam-src-ico { width: 32px; height: 32px; }
.pam-modal .pam-src > .flex-1 { display: grid; grid-template-columns: 1fr auto; column-gap: 12px; align-items: center; }
.pam-modal .pam-src > .flex-1 > b, .pam-modal .pam-src > .flex-1 > .pam-src-t, .pam-modal .pam-src > .flex-1 > .muted { grid-column: 1; margin: 0; }
.pam-modal .pam-src > .flex-1 > .flex { grid-column: 2; grid-row: 1 / span 3; margin: 0 !important; flex-direction: column; align-items: stretch; gap: 4px !important; }
.pam-modal .pam-body > .flex.mt-4 { margin-top: 10px !important; }
.oh-modal.pam-modal { max-height: 94vh; height: 94vh; }

/* the lists in the dialog: one line each */
.pam-mini { display: grid; grid-template-columns: repeat(auto-fit, minmax(480px, 1fr)); gap: 4px 16px; padding: 8px 12px; border-radius: 12px;
  background: var(--brand-50); border: 1px solid color-mix(in srgb, var(--brand-500) 18%, transparent); }
.pam-mini-row { display: flex; align-items: center; gap: 10px; min-width: 0; font-size: 13px; }
.pam-mini-row > b { white-space: nowrap; }
.pam-mini-row > .muted { flex: 1; min-width: 0; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pam-mini-acts { display: flex; gap: 2px; }
.pam-payer { width: auto; min-width: 280px; height: 36px; }
/* the table always keeps room for rows */
.pam-modal #pamCodes .dt-scroll { min-height: 260px; }
/* on a short screen the dialog itself scrolls a little rather than hide the table's page controls */
.oh-modal.pam-modal .oh-modal-body { overflow-y: auto; }
.pam-modal #pamCodes .dt-scroll { min-height: 220px; }
