/* Workspace navigation: the single-column staff menu (window.VestedNav,
   static/shared/workspaceNav.js) and View as client (static/shared/viewAsClient.js).
   docs/systems/WORKSPACE_NAV_SCOPE.md §6 and §8.

   Every class is ws- prefixed. The CRM and Platform stylesheets already share
   .sidebar, .nav-item, .card, .main and more; the prefix keeps this nav out of
   both (test/workspaceNav.test.js checks it). The host places the menu host in
   its sidebar under its own logo; only the host's insides are styled here.

   Section colours are tokens layered on the --brand-* variables, so a firm's
   theme (HCC) still applies. The menu is always dark, so they are the
   light-on-dark variants from the approved mockup. */
:root {
  --ws-nav-w: 236px; /* the sidebar's width; hosts offset full-page overlays by it */
  --ws-bg: var(--brand-ink, #0B2339);
  --ws-ink: #dbe4e8;
  --ws-dim: #8fa4b0;
  --ws-home: #c9d6dc;
  --ws-portal: var(--brand-accent, #2fb8c0);
  --ws-crm: #e2a141;
  --ws-content: #d08fcb;
  --ws-corporate: #7ea8e0;
  --ws-research: #8cc97a; /* green: distinct from the other sections, reads on the navy nav (D13) */
  --ws-admin: #a9b1b8;
  --ws-view: #5fd0d6;
  --ws-badge: #d94f4f;
}

/* ── The column ───────────────────────────────────────────────────────────── */
.ws-menu {
  display: flex; flex-direction: column; flex: 1; min-height: 0; color: var(--ws-ink);
  font-family: var(--brand-font-body, 'DM Sans', -apple-system, sans-serif);
}
.ws-scroll { flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden; padding: 10px 10px 14px; }
.ws-scroll::-webkit-scrollbar { width: 3px; }
.ws-scroll::-webkit-scrollbar-thumb { background: rgba(255,255,255,.1); border-radius: 2px; }

/* A section row: icon in the section colour, label, badge when closed, chevron. */
.ws-row {
  display: flex; align-items: center; gap: 10px; width: 100%; margin-top: 2px;
  padding: 8px 10px; border: 0; border-radius: 8px; background: transparent; cursor: pointer;
  font: 600 14px/1.3 var(--brand-font-body, 'DM Sans', sans-serif); text-align: left;
  color: var(--ws-ink); text-decoration: none; transition: background .12s, color .12s;
}
.ws-row:hover { background: rgba(255,255,255,.07); color: #fff; }
.ws-row.ws-on { background: rgba(255,255,255,.12); color: #fff; }
.ws-row:focus-visible { outline: 2px solid var(--ws-c); outline-offset: 1px; }
.ws-ico { width: 18px; height: 18px; flex: none; color: var(--ws-c); }
.ws-row-lbl { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ws-chev { width: 10px; height: 10px; flex: none; color: var(--ws-dim); transition: transform .15s ease; }
.ws-row.ws-on .ws-chev { transform: rotate(90deg); color: #fff; }
.ws-row .ws-badge + .ws-chev { margin-left: 2px; }

/* The open section's pages, indented under its row with a rule in its colour. */
.ws-pages { margin: 2px 0 8px 18px; padding-left: 8px; border-left: 2px solid var(--ws-c); }
.ws-grp-label {
  padding: 9px 10px 3px; font-size: 10px; font-weight: 700; letter-spacing: .09em;
  text-transform: uppercase; color: var(--ws-dim);
}
.ws-item {
  display: flex; align-items: center; gap: 9px; padding: 6px 10px; margin-bottom: 1px;
  border-radius: 7px; text-decoration: none; font-size: 13.5px; color: rgba(255,255,255,.66);
  transition: background .12s, color .12s;
}
.ws-item:hover { background: rgba(255,255,255,.06); color: rgba(255,255,255,.9); }
.ws-item.ws-on { background: rgba(255,255,255,.12); color: #fff; font-weight: 500; }
.ws-item:focus-visible { outline: 2px solid var(--ws-c); outline-offset: 1px; }
.ws-dot { width: 6px; height: 6px; border-radius: 50%; background: rgba(255,255,255,.28); flex: none; }
.ws-item.ws-on .ws-dot { background: var(--ws-c); }
.ws-plus { width: 6px; text-align: center; font-weight: 700; line-height: 1; color: rgba(255,255,255,.45); flex: none; }
.ws-lbl { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ws-badge {
  margin-left: auto; background: var(--ws-badge); color: #fff; border-radius: 20px;
  font-size: 10px; font-weight: 700; line-height: 16px; padding: 0 6px; font-variant-numeric: tabular-nums;
}
.ws-sep { height: 1px; background: rgba(255,255,255,.08); margin: 10px 6px 4px; }
/* While previewing, the client nav (the host's own markup) sits under View as client. */
.ws-client-pages { --ws-c: var(--ws-view); }

/* ── The adviser, at the foot ─────────────────────────────────────────────── */
.ws-user {
  display: flex; align-items: center; gap: 9px; margin: 0 12px 12px; padding: 9px 10px;
  border-radius: 7px; background: rgba(255,255,255,.05); flex-shrink: 0;
}
.ws-avatar {
  width: 30px; height: 30px; border-radius: 50%; flex: none; display: flex; align-items: center; justify-content: center;
  background: var(--brand-accent, #008D95); color: #fff; font-size: 11px; font-weight: 600;
}
.ws-user-txt { flex: 1; min-width: 0; }
.ws-user-name { font-size: 12.5px; font-weight: 500; color: rgba(255,255,255,.85); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ws-user-role { font-size: 11px; color: rgba(255,255,255,.4); margin-top: 1px; }
.ws-signout {
  flex: none; display: flex; align-items: center; padding: 6px 8px; cursor: pointer; border-radius: 5px;
  border: 1px solid rgba(255,255,255,.18); background: transparent; color: rgba(255,255,255,.7);
}
.ws-signout:hover { background: rgba(255,255,255,.08); color: #fff; }
.ws-signout svg { width: 11px; height: 11px; }

/* ── View as client: the picker and the preview banner (viewAsClient.js) ─── */
.ws-pick {
  position: fixed; left: calc(var(--ws-nav-w) + 12px); bottom: 16px; z-index: 100060;
  width: 360px; max-width: calc(100vw - 32px); max-height: calc(100vh - 32px); overflow-y: auto;
  background: #fff; color: #0B2339; border: 1px solid #E4E5E3; border-radius: 12px;
  box-shadow: 0 18px 40px -14px rgba(0,0,0,.45); padding: 12px; display: flex; flex-direction: column; gap: 8px;
  font-family: var(--brand-font-body, 'DM Sans', -apple-system, sans-serif);
}
.ws-pick-h { display: flex; justify-content: space-between; align-items: center; font-size: 14px; }
.ws-pick-x { border: 0; background: none; font-size: 20px; line-height: 1; color: #56636E; cursor: pointer; padding: 0 4px; }
.ws-pick-q {
  width: 100%; font: inherit; font-size: 14px; padding: 8px 11px; border: 1.5px solid #E4E5E3; border-radius: 9px; color: #0B2339;
}
.ws-pick-q:focus { outline: none; border-color: var(--brand-accent, #008D95); }
.ws-pick-row {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; font: inherit;
  border: 0; background: none; border-radius: 8px; padding: 7px 8px; color: #0B2339; cursor: pointer;
}
.ws-pick-row:hover, .ws-pick-row:focus-visible { background: #F1F2F2; outline: none; }
.ws-pick-av {
  width: 30px; height: 30px; border-radius: 50%; flex: none; display: grid; place-items: center;
  background: #F1F2F2; font-size: 11.5px; font-weight: 700;
}
.ws-pick-txt { display: flex; flex-direction: column; min-width: 0; flex: 1; font-size: 13.5px; }
.ws-pick-txt span { font-size: 12px; color: #56636E; }
.ws-pick-note { font-size: 12.5px; color: #56636E; padding: 4px 8px; }
.ws-pick-or { font-size: 11.5px; color: #56636E; text-align: center; margin-top: 4px; }
.ws-pick-tiers { display: flex; gap: 6px; }
.ws-pick-tiers button {
  flex: 1; font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; padding: 6px 0;
  border: 1px solid #E4E5E3; border-radius: 8px; background: #F4F5F5; color: #0B2339;
}
.ws-pick-tiers button:hover { background: #E4E5E3; }
.ws-preview-bar {
  position: sticky; top: 0; z-index: 900; display: flex; justify-content: space-between; align-items: center; gap: 12px;
  flex-wrap: wrap; padding: 8px 16px; background: var(--brand-accent, #008D95); color: #fff;
  font: 600 13px/1.4 var(--brand-font-body, 'DM Sans', sans-serif);
}
.ws-preview-acts { display: flex; gap: 6px; }
.ws-preview-acts button {
  font: inherit; font-size: 12px; cursor: pointer; padding: 3px 10px; border-radius: 6px;
  border: 1px solid rgba(255,255,255,.6); background: transparent; color: #fff;
}
.ws-preview-acts button:hover { background: rgba(255,255,255,.14); }
@media (max-width: 768px) {
  .ws-pick { left: 16px; right: 16px; width: auto; top: 64px; bottom: auto; }
  .ws-preview-bar { padding-left: 60px; }
}
