/* Shared shell. Facility colors belong in themes/*.css or facility.css. */
:root {
  color-scheme: light;
  --bf-primary: #146b70;
  --bf-primary-hover: #10575b;
  --bf-primary-soft: #e8f4f2;
  --bf-primary-ink: #10575b;
  --bf-sidebar: #162d38;
  --bf-sidebar-muted: #a7c1ca;
  --bf-accent: #a65c2b;
  --bf-focus: #146b70;
  --bf-paper: #f5f7f8;
  --bf-surface: #fff;
  --bf-ink: #20343f;
  --bf-muted: #586c77;
  --bf-border: #dce4e8;
  --bf-radius: 12px;
  --bf-sidebar-width: 248px;
  --bf-header-height: 80px;
  --bf-font: ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body.bf-app { margin: 0; background: var(--bf-paper); color: var(--bf-ink); font: 15px/1.5 var(--bf-font); min-height: 100dvh; }
button, input, select, textarea { font: inherit; }
button, a, input, select, textarea { -webkit-tap-highlight-color: transparent; }
a { color: var(--bf-primary-ink); }
button { min-height: 44px; background: var(--bf-primary); color: #fff; padding: 10px 16px; border: 1px solid transparent; border-radius: 8px; font-weight: 600; }
button:hover { background: var(--bf-primary-hover); }
button.secondary, nav button { background: var(--bf-surface); color: var(--bf-ink); border: 1px solid var(--bf-border); }
button.secondary:hover, nav button:hover { background: var(--bf-primary-soft); color: var(--bf-primary-ink); }
button:disabled { opacity: .6; cursor: not-allowed; }
:where(button, a, input, select, textarea, [tabindex]):focus-visible { outline: 3px solid var(--bf-focus); outline-offset: 3px; }
h1, h2, h3 { color: var(--bf-ink); line-height: 1.25; letter-spacing: -.025em; }
p { color: var(--bf-muted); }
.bf-skip { position: fixed; top: -80px; left: 16px; z-index: 400; padding: 12px 20px; background: #fff; border: 2px solid var(--bf-focus); border-radius: 8px; }
.bf-skip:focus { top: 10px; }
.site-header { position: sticky; top: 0; z-index: 100; display: flex; align-items: center; gap: 20px; height: var(--bf-header-height); padding: 12px 28px; background: var(--bf-surface); color: var(--bf-ink); border-bottom: 1px solid var(--bf-border); }
.bf-brand { display: flex; align-items: center; gap: 12px; text-decoration: none; min-width: 0; color: var(--bf-ink); }
.bf-brand strong { display: block; font-size: 1.12rem; letter-spacing: -.025em; overflow-wrap: anywhere; }
.bf-brand small { display: block; font-size: .72rem; color: var(--bf-muted); }
.bf-brand-mark { flex-shrink: 0; display: grid; grid-template-columns: 1fr 1fr; align-items: center; width: 40px; height: 40px; border-radius: 11px; background: var(--bf-sidebar); color: #fff; padding: 0 8px; font-size: 16px; font-weight: 700; letter-spacing: -2px; }
.bf-brand-mark span { color: #b6dbd6; }
.bf-logo { object-fit: contain; flex-shrink: 0; }
.bf-header-note { margin-left: auto; font-size: .76rem; color: var(--bf-muted); }
.version-number { font-size: .72rem; color: var(--bf-muted); font-weight: 500; padding: 4px 9px; border: 1px solid var(--bf-border); border-radius: 6px; }
main { width: 100%; max-width: none; margin: 0; padding: 0; flex: 1; }
#auth { max-width: 520px; margin: clamp(28px,7vh,80px) auto; padding: 34px; }
#auth h1 { font-size: 2.1rem; margin: 8px 0 12px; }
#auth nav { display: grid; grid-template-columns: repeat(4,1fr); gap: 4px; margin: 26px 0; padding-bottom: 12px; border-bottom: 1px solid var(--bf-border); }
#auth nav button { padding: 8px 4px; font-size: .79rem; border-color: transparent; font-weight: 500; }
#auth nav button[aria-current] { background: var(--bf-primary-soft); color: var(--bf-primary-ink); font-weight: 700; }
#authForm form > button { width: 100%; margin-top: 14px; }
.bf-access-note { font-size: .78rem; border-top: 1px solid var(--bf-border); margin-top: 26px; padding-top: 18px; }
.bf-eyebrow { font-size: .67rem; letter-spacing: .13em; font-weight: 750; color: var(--bf-primary-ink); margin: 0 0 9px; }
#dashboard { display: grid; grid-template-columns: var(--bf-sidebar-width) minmax(0,1fr); gap: 0; }
#dashboard > .heading { grid-column: 2; grid-row: 1; padding: 32px 36px 24px; display: flex; gap: 20px; align-items: center; border-bottom: 0; }
#dashboard > .heading h1 { font-size: clamp(1.6rem,2.5vw,2.25rem); margin: 0; font-weight: 650; }
#bf-page-description { margin: 10px 0 0; max-width: 70ch; font-size: .88rem; }
.bf-heading-copy { min-width: 0; }
#logout { white-space: nowrap; align-self: flex-start; }
#tabs { grid-column: 1; grid-row: 1 / span 2; position: fixed; left: 0; top: var(--bf-header-height); bottom: 0; width: var(--bf-sidebar-width); max-height: none; overflow-y: auto; overscroll-behavior: contain; margin: 0; padding: 26px 14px; background: var(--bf-sidebar); display: flex; flex-direction: column; flex-wrap: nowrap; gap: 4px; border-radius: 0; scrollbar-width: thin; scrollbar-color: var(--bf-sidebar-muted) var(--bf-sidebar); }
#tabs > * { flex-shrink: 0; }
#tabs .bf-nav-group { color: var(--bf-sidebar-muted); font-size: .64rem; font-weight: 650; letter-spacing: .12em; margin: 22px 12px 5px; }
#tabs button { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 12px; min-height: 42px; border: 0; background: transparent; color: #dce7eb; border-radius: 7px; text-align: left; font-size: .82rem; font-weight: 450; }
#tabs button:hover { background: #ffffff12; color: #fff; }
#tabs button[aria-current] { background: #ffffff19; color: #fff; box-shadow: inset 3px 0 0 #a8d8d2; font-weight: 650; }
#tabs button:focus-visible { outline-color: #fff; outline-offset: -3px; }
.bf-nav-icon { width: 20px; flex-shrink: 0; font-size: 1rem; text-align: center; opacity: .85; }
.bf-nav-footnote { border-top: 1px solid #ffffff24; color: var(--bf-sidebar-muted); font-size: .71rem; padding: 20px 12px 0; margin-top: 28px; }
#content { grid-column: 2; grid-row: 2; min-width: 0; padding: 0 36px 36px; }
.panel, #content .panel { background: var(--bf-surface); border: 1px solid var(--bf-border); border-radius: var(--bf-radius); box-shadow: 0 2px 4px #172e3b03; padding: 24px; margin-bottom: 20px; }
#content h2 { font-size: 1.15rem; margin: 0 0 18px; }
#content h3 { font-size: 1rem; }
label { font-weight: 550; font-size: .85rem; }
input, select, textarea { width: 100%; min-height: 44px; padding: 11px 12px; color: var(--bf-ink); background: var(--bf-surface); border: 1px solid #b6c5ce; border-radius: 7px; margin-top: 7px; }
input[type=checkbox], input[type=radio] { width: auto; min-height: auto; accent-color: var(--bf-primary); }
#content input[readonly] { background: var(--bf-paper); }
textarea { resize: vertical; }
.tablewrap { overflow-x: auto; border: 1px solid var(--bf-border); border-radius: 8px; }
table { width: 100%; border-collapse: collapse; font-size: .85rem; background: var(--bf-surface); }
th { background: var(--bf-paper); color: var(--bf-muted); font-size: .73rem; font-weight: 650; }
th, td { padding: 13px 14px; border-bottom: 1px solid var(--bf-border); vertical-align: top; }
tr:last-child td { border-bottom: 0; }
tr:hover td { background: var(--bf-paper); }
#msg { margin: 0 24px; }
#msg:empty { display: none; }
#msg:not(:empty) { padding: 14px 18px; margin: 16px 24px; background: #fff4df; color: #704318; border: 1px solid #dfc28b; border-radius: 8px; }
.bf-signed-in #msg:not(:empty) { margin-left: calc(var(--bf-sidebar-width) + 36px); }
.site-footer { display: flex; justify-content: space-between; gap: 14px; flex-wrap: wrap; padding: 20px 28px; background: var(--bf-paper); font-size: .7rem; color: var(--bf-muted); border-top: 1px solid var(--bf-border); }
.bf-signed-in .site-footer { margin-left: var(--bf-sidebar-width); padding-left: 36px; }
.bf-summary-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 16px; margin-bottom: 28px; }
.bf-summary { border: 1px solid var(--bf-border); background: var(--bf-surface); color: var(--bf-ink); text-align: left; padding: 21px; border-radius: var(--bf-radius); display: flex; flex-direction: column; align-items: flex-start; gap: 14px; min-width: 0; }
.bf-summary:hover { background: var(--bf-surface); border-color: var(--bf-primary); }
.bf-summary-label { font-size: .76rem; font-weight: 500; color: var(--bf-muted); }
.bf-summary strong { font-size: 2rem; font-weight: 650; line-height: 1; }
.bf-summary small { color: var(--bf-primary-ink); font-size: .7rem; font-weight: 500; }
.bf-overview-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 0 16px; }
.bf-overview-heading h2 { margin: 0 !important; font-size: 1.1rem; }
.bf-overview-heading p { margin: 4px 0 0; font-size: .8rem; }
.bf-action-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 18px; }
.bf-action-section { background: var(--bf-surface); border: 1px solid var(--bf-border); border-radius: var(--bf-radius); padding: 22px; min-width: 0; }
.bf-action-section h3 { margin: 0 0 5px; }
.bf-action-section > p { font-size: .78rem; margin: 0 0 18px; }
.bf-action-card { display: flex; align-items: center; gap: 12px; background: transparent; color: var(--bf-ink); border: 0; border-top: 1px solid var(--bf-border); border-radius: 0; width: 100%; text-align: left; padding: 14px 0; font-weight: 500; }
.bf-action-card:hover { background: var(--bf-primary-soft); color: var(--bf-primary-ink); }
.bf-action-card > span:first-child { background: var(--bf-primary-soft); color: var(--bf-primary-ink); width: 34px; height: 34px; display: grid; place-items: center; flex-shrink: 0; border-radius: 8px; font-size: 1.1rem; }
.bf-action-card strong { font-size: .84rem; font-weight: 600; display: block; }
.bf-action-card small { color: var(--bf-muted); display: block; margin-top: 3px; font-size: .73rem; font-weight: 400; }
.bf-arrow { margin-left: auto; color: var(--bf-muted); }
.bf-overview-note { display: flex; gap: 12px; align-items: baseline; margin-top: 24px; padding: 16px 20px; border-left: 3px solid var(--bf-primary); border-radius: 0 8px 8px 0; background: var(--bf-primary-soft); }
.bf-overview-note p { margin: 0; color: var(--bf-primary-ink); font-size: .79rem; }
.bf-account { position: relative; }
.bf-account-toggle { display: flex; align-items: center; gap: 10px; padding: 5px 8px; background: transparent; color: var(--bf-ink); border: 0; }
.bf-account-toggle:hover { background: var(--bf-paper); }
.bf-avatar { display: grid; place-items: center; width: 34px; height: 34px; background: var(--bf-primary-soft); color: var(--bf-primary-ink); border-radius: 50%; font-size: .76rem; }
.bf-account-identity { text-align: left; max-width: 170px; }
.bf-account-identity strong { display: block; font-size: .76rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bf-account-identity small { display: block; font-size: .67rem; color: var(--bf-muted); }
.bf-account-panel { position: absolute; right: 0; top: calc(100% + 10px); width: 230px; padding: 8px; border: 1px solid var(--bf-border); border-radius: 10px; background: var(--bf-surface); box-shadow: 0 12px 30px #13293620; }
.bf-account-panel button { display: block; width: 100%; background: transparent; color: var(--bf-ink); border: 0; text-align: left; font-size: .82rem; font-weight: 450; }
.bf-account-panel button:hover { background: var(--bf-primary-soft); }
.bf-menu-toggle { display: none; }
.bf-mobile header { background: var(--bf-sidebar); }
.bf-mobile button, .bf-mobile a.btn { background: var(--bf-primary); }
.bf-mobile button.secondary { background: var(--bf-primary-soft); color: var(--bf-primary-ink); }
.bf-mobile input, .bf-mobile select, .bf-mobile textarea { color: var(--bf-ink); }
@media (min-width: 761px) { .bf-signed-in #tabs { display: flex; } }
@media (max-width: 1200px) { .bf-summary-grid { grid-template-columns: repeat(2,minmax(0,1fr)); } }
@media (max-width: 960px) { :root { --bf-sidebar-width: 218px; } #content { padding: 0 24px 28px; } #dashboard > .heading { padding: 26px 24px 22px; } .bf-action-grid { grid-template-columns: 1fr; } .bf-header-note { display: none; } .version-number { margin-left: auto; } }
@media (max-width: 760px) {
  :root { --bf-header-height: 74px; }
  .site-header { padding: 10px 14px; gap: 8px; }
  .bf-brand { gap: 8px; }
  .bf-brand strong { font-size: .95rem; }
  .bf-brand small { font-size: .62rem; max-width: 28ch; }
  .bf-brand-mark { width: 34px; height: 34px; padding: 0 6px; }
  .bf-account-identity { display: none; }
  .bf-account-toggle { gap: 4px; padding: 4px; }
  .bf-signed-in .version-number { display: none; }
  .bf-account { margin-left: auto; }
  .bf-menu-toggle { display: inline-flex; align-items: center; background: var(--bf-primary-soft); color: var(--bf-primary-ink); padding: 8px 10px; font-size: .78rem; }
  #dashboard { display: block; }
  #tabs { display: none; z-index: 90; width: min(310px,85vw); box-shadow: 12px 0 30px #13293620; }
  #tabs.bf-open { display: flex; }
  #dashboard > .heading { padding: 24px 18px 20px; }
  #content { padding: 0 18px 26px; }
  .bf-summary-grid { gap: 10px; margin-bottom: 22px; }
  .bf-summary { padding: 16px; gap: 10px; }
  .bf-summary strong { font-size: 1.75rem; }
  .bf-summary-label { font-size: .7rem; }
  .bf-action-section { padding: 18px; }
  .bf-overview-heading { align-items: flex-start; }
  .bf-overview-note { display: block; }
  .panel, #content .panel { padding: 18px; }
  #auth { margin: 28px 14px; padding: 24px; }
  .bf-signed-in .site-footer { margin-left: 0; padding-left: 18px; }
  .site-footer { padding: 18px; font-size: .66rem; }
  .bf-signed-in #msg:not(:empty) { margin: 16px 18px; }
}
@media (prefers-reduced-motion: no-preference) { button, a { transition: background-color .15s, border-color .15s; } }
/* Preserve the workflow stylesheet's QR-only print visibility rules. */
@media print {
  .site-header, #tabs, .site-footer, .bf-menu-toggle, .bf-skip { display: none !important; }
  #dashboard { display: block; }
  #content { padding: 0; }
}
/* Keep the dedicated field-entry page narrow when sharing facility theme tokens. */
.bf-mobile main { max-width: 620px; margin: 0 auto; padding: 18px; }

/* Breadcrumbs use workflow labels only; no confidential record data or URL parameters. */
.bf-breadcrumb { display: block; margin: 0 0 14px; }
.bf-breadcrumb ol { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; list-style: none; margin: 0; padding: 0; }
.bf-breadcrumb li { display: flex; align-items: center; gap: 10px; min-width: 0; color: var(--bf-muted); font-size: .76rem; overflow-wrap: anywhere; }
.bf-breadcrumb button { background: transparent; border: 0; color: var(--bf-primary-ink); border-radius: 4px; min-height: 44px; padding: 6px 2px; margin: -6px 0; font-size: inherit; font-weight: 550; text-decoration: underline; text-underline-offset: 3px; }
.bf-breadcrumb button:hover { background: var(--bf-primary-soft); color: var(--bf-primary-ink); }
.bf-breadcrumb [aria-current=page] { color: var(--bf-ink); font-weight: 600; }
.bf-breadcrumb-separator { color: var(--bf-muted); font-weight: 400; }
@media print { .bf-breadcrumb { display: none !important; } }

/* Backup is a navigation link with the same presentation as its sibling buttons. */
#tabs .bf-backup-link {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 42px;
  padding: 10px 12px;
  margin: 0;
  border: 0;
  background: transparent;
  color: #dce7eb;
  border-radius: 7px;
  font-size: .82rem;
  font-weight: 450;
  line-height: inherit;
  text-align: left;
  text-decoration: none;
}
#tabs .bf-backup-link:hover { background: #ffffff12; color: #fff; }
#tabs .bf-backup-link:focus-visible { outline-color: #fff; outline-offset: -3px; }
/* Match the facility overlay's Administration item dimensions. */
.bf-app #tabs .bf-backup-link { min-height: 43px; padding: 10px 13px; border-radius: 6px; font-size: .86rem; }

/* One consistent outline set, inheriting facility colors. */
.bf-outline-icon { display: block; width: 20px; height: 20px; flex: 0 0 auto; pointer-events: none; }
.bf-nav-icon { display: grid; place-items: center; }
.bf-action-card > span:first-child .bf-outline-icon { width: 21px; height: 21px; }
.bf-arrow .bf-outline-icon { width: 16px; height: 16px; }
.bf-summary-label, .bf-summary small { display: flex; align-items: center; gap: 8px; }
.bf-summary-label .bf-outline-icon { width: 18px; height: 18px; }
.bf-summary small .bf-outline-icon { width: 14px; height: 14px; }
.bf-account-toggle > .bf-outline-icon { width: 16px; height: 16px; }
.bf-account-panel button { display: flex; align-items: center; gap: 10px; }
.bf-menu-toggle { gap: 7px; }
.bf-menu-toggle .bf-outline-icon { width: 18px; height: 18px; }

/* Account dropdown: identity header, icon rows, switch-user highlight and sign-out divider. */
#bf-account-panel {
  width: 284px;
  min-width: 0;
  max-width: calc(100vw - 24px);
  padding: 9px;
  border: 1px solid #d3ddea;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 10px 28px #20324a26;
}
#bf-account-panel .bf-account-summary { display: flex; align-items: center; gap: 11px; padding: 6px 8px 13px; margin-bottom: 5px; border-bottom: 1px solid #e0e6ef; }
#bf-account-panel .bf-account-summary > span:last-child { min-width: 0; }
#bf-account-panel .bf-avatar { flex: none; width: 38px; height: 38px; background: #202d41; color: #fff; }
#bf-account-panel .bf-avatar .bf-outline-icon, .bf-avatar > .bf-outline-icon { width: 23px; height: 23px; }
#bf-account-panel .bf-account-summary-name { display: block; color: #203049; font-size: .87rem; font-weight: 700; overflow-wrap: anywhere; }
#bf-account-panel .bf-account-summary-role { display: block; margin-top: 2px; color: #6b798f; font-size: .73rem; }
#bf-account-panel button { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 43px; margin: 0; padding: 10px 11px; border: 0; border-radius: 6px; background: transparent; color: #25354c; text-align: left; font-size: .83rem; font-weight: 450; }
#bf-account-panel button > .bf-outline-icon { width: 21px; height: 21px; flex: none; }
#bf-account-panel .bf-account-action-copy { display: flex; flex-direction: column; gap: 2px; min-width: 0; line-height: 1.35; }
#bf-account-panel .bf-account-action-copy small { color: #667890; font-size: .7rem; }
#bf-account-panel .bf-account-switch { background: #e8f1ff; }
#bf-account-panel button:hover, #bf-account-panel button:focus-visible { background: #e8f1ff; }
#bf-account-panel .bf-account-switch:hover { background: #dbe9fc; }
#bf-account-panel .bf-account-separator { margin: 7px 6px; border: 0; border-top: 1px solid #e0e6ef; }
#bf-account-panel .bf-account-signout { margin: 0; border: 0; color: #d52525; }
#bf-account-panel .bf-account-signout:hover { background: #fff0ef; }

/* Sign-out is available from the account dropdown. Retain the legacy handler target. */
.bf-app #dashboard > .heading > #logout { display: none; }

.confirmation-policy-controls{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:20px}.confirmation-policy-controls fieldset{min-width:0;border:1px solid var(--bf-border);border-radius:9px;padding:18px}.confirmation-policy-controls legend{font-weight:650;padding:0 6px;color:var(--bf-ink)}.confirmation-policy-controls>button{grid-column:1/-1;justify-self:start}@media(max-width:760px){.confirmation-policy-controls{grid-template-columns:minmax(0,1fr)}}

.site-transfer-settings p{overflow-wrap:anywhere}
