/* ASPN unified admin shell: the ONE design-token set and top bar for both admin surfaces
   (Business = Club CEO workspace, Clinical = PHI admin). Canonical copy: shared/admin-shell/tokens.css.
   Each surface takes this file at build time from its own origin (Club: served from shared/ by
   server/unified-admin.cjs; PHI admin: COPY --from=club_shared in platform/admin/Dockerfile.phi).
   Never loaded cross-origin at runtime.
   Theme: Pearl by day, Smoke by night. The Club sets :root[data-theme] from the member's local time
   (night = Smoke); a page with no data-theme (the PHI admin) follows the device setting.
   Everything is scoped to .ua-* so it cannot change either surface's own styles. */
.ua-bar, .ua-ribbon, .ua-host {
  --ua-ink: #252525; --ua-muted: #746b62; --ua-line: #e8e1d9; --ua-bronze: #8a6a45; --ua-on-bronze: #fff;
  --ua-glass: linear-gradient(145deg, #fffffff0, #f8f4eee0); --ua-shadow: inset 0 1px #fff, 0 9px 26px #79624b12;
  --ua-seg-bg: #efe7dc; --ua-red: #9b3b2f;
  --ua-f-mark: 'Russo One', 'Bebas Neue', 'Arial Narrow', sans-serif;
  --ua-f-ui: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}
:root[data-theme=night] .ua-bar, :root[data-theme=night] .ua-ribbon, :root[data-theme=night] .ua-host {
  --ua-ink: #f5efe7; --ua-muted: #b7aca0; --ua-line: #443e37; --ua-bronze: #b08a5e; --ua-on-bronze: #211f1d;
  --ua-glass: linear-gradient(135deg, #2c2b29f2, #242424f2); --ua-shadow: 0 10px 25px #0002, inset 0 1px #ffffff05;
  --ua-seg-bg: #1d1c1a; --ua-red: #d2786a;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) .ua-bar, :root:not([data-theme]) .ua-ribbon, :root:not([data-theme]) .ua-host {
    --ua-ink: #f5efe7; --ua-muted: #b7aca0; --ua-line: #443e37; --ua-bronze: #b08a5e; --ua-on-bronze: #211f1d;
    --ua-glass: linear-gradient(135deg, #2c2b29f2, #242424f2); --ua-shadow: 0 10px 25px #0002, inset 0 1px #ffffff05;
    --ua-seg-bg: #1d1c1a; --ua-red: #d2786a;
  }
}
/* The bar: fixed height on first paint (56 px), so nothing below it moves when the role arrives. */
.ua-bar { box-sizing: border-box; display: flex; flex-wrap: nowrap; align-items: center; gap: 10px; height: 56px; padding: 0 16px;
  background: var(--ua-glass); border-bottom: 1px solid var(--ua-line); box-shadow: var(--ua-shadow);
  color: var(--ua-ink); font: 14px/20px var(--ua-f-ui); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); }
.ua-bar * { box-sizing: border-box; }
.ua-mark { font: 20px/24px var(--ua-f-mark); letter-spacing: .08em; color: var(--ua-ink); text-decoration: none; flex: 0 0 auto; }
.ua-switch { display: inline-flex; flex: 0 0 auto; padding: 3px; gap: 2px; border-radius: 12px; background: var(--ua-seg-bg); border: 1px solid var(--ua-line); margin: 0 auto 0 8px; }
.ua-seg { display: inline-flex; align-items: center; justify-content: center; min-width: 88px; height: 38px; padding: 0 12px; border-radius: 9px;
  color: var(--ua-muted); font: 600 14px/20px var(--ua-f-ui); text-decoration: none; white-space: nowrap; touch-action: manipulation; }
.ua-seg[aria-current=page] { background: var(--ua-bronze); color: var(--ua-on-bronze); }
.ua-seg:focus-visible, .ua-out:focus-visible { outline: 2px solid var(--ua-ink); outline-offset: 2px; }
.ua-seg[aria-disabled=true] { cursor: default; opacity: .7; }
.ua-seg .ua-sub { font-weight: 400; font-size: 12px; margin-left: 6px; }
/* "No access": a small shield (the shape of ASPN_UTILS.ICONS.shield, web/public/utils.js) before the words; on a
   phone the words are visually hidden and the shield stays, the aria-label says "no access". On the Club the
   script draws the icon from ASPN_UTILS.ICONS itself (.ua-lock.ua-svg); elsewhere this mask draws it. */
.ua-lock { display: inline-block; width: 14px; height: 14px; margin-left: 6px; flex: 0 0 auto; background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linejoin='round'%3E%3Cpath d='M12 3.5 5 6v5.5c0 4.4 3 7.6 7 9 4-1.4 7-4.6 7-9V6z'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linejoin='round'%3E%3Cpath d='M12 3.5 5 6v5.5c0 4.4 3 7.6 7 9 4-1.4 7-4.6 7-9V6z'/%3E%3C/svg%3E") center / contain no-repeat; }
.ua-lock.ua-svg { background: none; -webkit-mask: none; mask: none; }
.ua-lock.ua-svg svg { width: 14px; height: 14px; display: block; fill: none; stroke: currentColor; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.ua-role { display: inline-flex; align-items: center; height: 24px; padding: 0 10px; border-radius: 999px; border: 1px solid var(--ua-line);
  color: var(--ua-ink); font-size: 12px; white-space: nowrap; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.ua-role:empty { visibility: hidden; min-width: 56px; }
.ua-role .ua-short { display: none; }
.ua-out { appearance: none; min-height: 44px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--ua-line); background: transparent;
  color: var(--ua-ink); font: 600 14px var(--ua-f-ui); cursor: pointer; touch-action: manipulation; flex: 0 0 auto; }
/* The Clinical ribbon: one quiet line under the bar, reserved height. */
.ua-ribbon { box-sizing: border-box; margin: 0; height: 28px; display: flex; align-items: center; justify-content: center; gap: 6px;
  color: var(--ua-muted); font: 600 12px/16px var(--ua-f-ui); letter-spacing: .04em; border-bottom: 1px solid var(--ua-line); }
.ua-ribbon::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--ua-bronze); }
@media (max-width: 600px) {
  .ua-bar { gap: 8px; padding: 0 12px; }
  .ua-mark { font-size: 17px; }
  .ua-switch { margin-left: 2px; }
  .ua-seg { min-width: 0; padding: 0 10px; font-size: 13px; }
  .ua-seg .ua-sub { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .ua-lock { margin-left: 4px; }
  .ua-role { height: 22px; padding: 0 7px; font-size: 11px; max-width: 76px; }
  .ua-role .ua-long { display: none; }
  .ua-role .ua-short { display: inline; }
  .ua-out { padding: 0 10px; font-size: 13px; }
}
/* Club placement (server/unified-admin-web/unified-admin-bar.js sets data-surface="club"): fixed at the top of
   #admin routes; html.ua-on is set before first paint, so the body's 56 px is reserved and nothing jumps. */
.ua-bar[data-surface=club] { position: fixed; top: 0; left: 0; right: 0; z-index: 1000; padding-top: env(safe-area-inset-top); height: calc(56px + env(safe-area-inset-top)); }
html.ua-on body { padding-top: calc(56px + env(safe-area-inset-top)); }
html:not(.ua-on) .ua-bar[data-surface=club] { display: none; }
/* pw1: on staff routes without the CEO header (coach/provider inbox, files, etc.) the Club member top bar sits
   below the fixed 56 px bar instead of underneath it, so back/home/bell stay clickable. */
html.ua-on:not(.ua-merged) #app > header#top { top: calc(56px + env(safe-area-inset-top)) !important; }

/* One bar (html.ua-merged): the switch, role chip and Sign out live in the CEO workspace header (.topbar in the
   host's shadow root, which adopts this file; the colour tokens above inherit from the light-DOM .ua-host). The
   standalone row and its 56 px reservation go away in the same mutation microtask that draws the header. */
html.ua-on.ua-merged body { padding-top: 0; }
html.ua-merged .ua-bar[data-surface=club] { display: none; }
.ua-merge { box-sizing: border-box; display: flex; align-items: center; gap: 8px; color: var(--ua-ink); font: 14px/20px var(--ua-f-ui); }
.ua-merge * { box-sizing: border-box; }
.ua-merge .ua-switch { margin: 0; }
.ua-merge .ua-seg { position: relative; }
/* Role chip and Sign out match the workspace's eye and day/night buttons (its own glass tokens). */
.ua-merge .ua-role, .ua-merge .ua-out { height: 44px; min-height: 44px; border-radius: 22px; border: 1px solid var(--line, var(--ua-line));
  background: var(--fill, transparent); color: var(--ink, var(--ua-ink)); box-shadow: var(--gshadow, none);
  -webkit-backdrop-filter: blur(24px) saturate(1.2); backdrop-filter: blur(24px) saturate(1.2); }
.ua-merge .ua-role { padding: 0 14px; font-size: 12px; }
.ua-merge .ua-out { padding: 0 16px; }
/* Desktop: out of flow, vertically centred, right-aligned. Role chip and Sign out sit at the right edge with fixed
   widths; the workspace's fixed eye and day/night buttons move left by that width into the gap after the switch,
   so the order is switch, eye, day/night, role, Sign out, and nothing in the header's own flow moves. */
@media (min-width: 960px) {
  .topbar > .ua-merge { position: absolute; top: 50%; right: 16px; transform: translateY(-50%); }
  .ua-merge .ua-switch { margin-right: 114px; }
  .ua-merge .ua-role { width: 92px; justify-content: center; }
  .ua-merge .ua-out { width: 96px; }
  :host(.ua-host) .ceo-theme-toggle { right: 228px; }
  :host(.ua-host) .ceo-member-view-toggle { right: 282px; }
}
/* Tablet: in the single header row after the group pills, inside the padding that keeps the fixed buttons clear. */
@media (max-width: 959px) {
  .topbar > .ua-merge { flex: 0 0 auto; order: 4; }
  .ua-merge .ua-seg { min-width: 0; height: 34px; padding: 0 10px; font-size: 13px; }
  .ua-merge .ua-role, .ua-merge .ua-out { height: 40px; min-height: 40px; border-radius: 20px; }
  .ua-merge .ua-role { padding: 0 10px; }
  .ua-merge .ua-out { padding: 0 12px; font-size: 13px; }
}
/* Phone: its own full-width row (switch, role, Sign out) between the logomark row and the group pills; it is in
   place before the header's first paint, so the rows never reflow under a finger. */
@media (max-width: 600px) {
  .topbar > .ua-merge { flex: 1 1 100%; display: flex; margin: 4px -100px 6px 0; gap: 6px; }
  .ua-merge .ua-switch { flex: 1 1 auto; min-width: 0; display: flex; }
  .ua-merge .ua-seg { flex: 1 1 0; }
  .ua-merge .ua-role { flex: 0 1 auto; }
}
/* Full width for the CEO workspace (owner, Nov 30: "fix the empty left hand side"). app.css caps
   body:not(.atlas-route) #app.app>main#view at min(1180px, 100% - 76px) !important on >=1024 px, which outranks
   ceo56-shell.css's body.aspn-ceo55 #view{max-width:none!important}; with margin 0 there the workspace ends at
   1180 px and leaves a bare strip on the right. This selector out-ranks the cap for the workspace only. */
html body.aspn-ceo55:not(.atlas-route) #app.app > main#view { max-width: none !important; width: 100% !important; }
