/* Dashboard shell: sidebar navigation (8 Nov 2026).
   Applied by dashboard/shell.js on pages whose <body> has class
   "dash-shell". Stage 2 redesign (11 Nov 2026): migrated to
   INTERACTALK_DESIGN_SYSTEM.md §3 tokens.
   Professional pass (13 Nov 2026): the app layer is rebuilt to an
   enterprise-app standard (Linear / Vapi / Stripe class):
   - .dash-content owns a real app container (.wrap restyled in-app:
     app padding rhythm instead of the marketing 64px layout pad).
   - App type scale: page H1 28px, section/card heads 16px/600 —
     the marketing 44px H1 and 20px lead no longer leak into the app.
   - Surfaces are flat: solid --bg-secondary + 1px border, one radius
     (--radius-md) for every app surface. The --grad-surface gradient
     and hover lift/glow treatments are gone inside the app.
   - One treatment each for tables, code blocks, form controls,
     buttons (primary / ghost / danger), tags, empty states and
     loading skeletons, all scoped to body.dash-shell.
   - Cyan is voice/live only inside the app: focus rings, sidebar
     states and chrome accents use the violet accent; hover states no
     longer slide or lift (no transform on app chrome).
   No :root here — shell.css consumes the styles.css tokens.
   Two documented literals: the 28px app H1 (between --font-size-h3
   22px and --font-size-h2 32px — the app scale the token set lacks)
   and the accent-alpha tints, which follow the file's existing
   rgba(116,87,255,…) convention for --accent-primary at low alpha. */
body.dash-shell {
  display: flex;
  align-items: flex-start;
}

body.dash-shell ::selection {
  background: rgba(116,87,255,.35);
}

/* Thin, quiet scrollbars for the app's own scroll regions. */
.dash-sidebar,
body.dash-shell pre,
.dash-transcript {
  scrollbar-width: thin;
  scrollbar-color: var(--border-strong) transparent;
}

.dash-sidebar::-webkit-scrollbar,
body.dash-shell pre::-webkit-scrollbar,
.dash-transcript::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

.dash-sidebar::-webkit-scrollbar-thumb,
body.dash-shell pre::-webkit-scrollbar-thumb,
.dash-transcript::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: var(--radius-full);
}

.dash-sidebar::-webkit-scrollbar-track,
body.dash-shell pre::-webkit-scrollbar-track,
.dash-transcript::-webkit-scrollbar-track {
  background: transparent;
}

.dash-sidebar {
  width: 248px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  background: var(--bg-secondary);
  border-right: var(--border-width) solid var(--border-default);
  padding: var(--space-4) var(--space-3) var(--space-6);
}

/* Group labels: small, quiet, one treatment on every page. */
.dash-sidebar h2 {
  font-size: var(--font-size-caption);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin: var(--space-5) var(--space-2) var(--space-1);
}

.dash-sidebar h2:first-child {
  margin-top: 0;
}

/* styles.css styles every bare <nav> as the marketing header (display:flex,
   max-width, margin:auto, padding) — that leaked into the sidebar and laid
   the links out in a horizontal row (seen live 12 Nov: labels squeezed,
   wrapped and sliding under the content). Reset it: the sidebar nav is a
   plain vertical block. The ≤900px media query below re-enables flex for
   the mobile chip row. */
.dash-sidebar nav {
  display: block;
  max-width: none;
  margin: 0;
  padding: 0;
}

/* Public-chrome leak (12 Nov 2026): every dashboard subpage still carries the
   marketing site's <header> — logo, #site-nav (Home/Product/Solutions/
   Developers/Pricing), "Signed in" chip, hamburger — inside .dash-content,
   and styles.css styles every bare <header> as the sticky public header.
   That is the homepage's chrome, not the app's: the dashboard's own header
   is .dash-topbar (overview). Hide the marketing header on dash pages; the
   :has() rule removes the sticky bar entirely, the second rule hides the
   nav itself where :has() is unavailable. */
body.dash-shell .dash-content > header:has(> nav:not(.dash-topbar)) {
  display: none;
}

body.dash-shell .dash-content > header > nav:not(.dash-topbar) {
  display: none;
}

/* Where the marketing header still renders (no :has()), align its nav
   padding with the app container so the logo/chip line up with content. */
body.dash-shell .dash-content > header > nav {
  padding-left: var(--space-8);
  padding-right: var(--space-8);
}

/* The "Signed in" chip is the marketing .tag (cyan pill) — inside the app
   it becomes a quiet neutral badge. */
body.dash-shell .dash-content .tag {
  background: var(--bg-surface);
  border: var(--border-width) solid var(--border-default);
  color: var(--text-secondary);
}

/* Sidebar items: compact app rows (8px vertical padding, 14px text at
   1.4 ≈ 36px tall), colour-only states — no slide, no lift. */
.dash-sidebar a {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  text-decoration: none;
  font-size: var(--font-size-body-sm);
  line-height: 1.4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: background 0.15s ease, color 0.15s ease;
}

.dash-sidebar a:focus-visible {
  outline: 2px solid var(--accent-primary);
  outline-offset: -2px;
}

/* Nav icons (12 Nov 2026): one stroke set, 24x24 viewBox rendered at 18px,
   colour inherited from the link state (design system §5). */
.dash-ico {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  color: var(--text-muted);
  transition: color 0.15s ease;
}

.dash-sidebar a:hover {
  background: rgba(116,87,255,.12);
}
/* Sidebar hover tint is --accent-primary at 12%. */

.dash-sidebar a:hover .dash-ico {
  color: var(--color-violet-300);
}

.dash-sidebar a.dash-active {
  background: rgba(116,87,255,.20);
  font-weight: 600;
  box-shadow: inset 3px 0 0 var(--accent-primary);
}
/* Sidebar active tint is --accent-primary at 20%. */

.dash-sidebar a.dash-active .dash-ico {
  color: var(--color-violet-300);
}

.dash-sidebar a.dash-sub {
  padding-left: var(--space-6);
  font-size: var(--font-size-body-sm);
}

.dash-sidebar .dash-tag {
  font-size: var(--font-size-caption);
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--color-violet-300);
  border: var(--border-width) solid var(--accent-primary);
  border-radius: var(--radius-full);
  padding: var(--space-1) var(--space-2);
  margin-left: 6px;
  vertical-align: 1px;
}
/* Tag size is 12px (--font-size-caption): the design system never goes below 12px for readable text. */

/* Sidebar utility block (12 Nov 2026): the useful links from the removed
   public footer (status, support, terms, privacy) live at the foot of the
   sidebar instead — the footer itself belongs to public pages only. */
.dash-side-foot {
  margin-top: auto;
  padding-top: var(--space-4);
  border-top: var(--border-width) solid var(--border-subtle);
}

.dash-side-legal {
  font-size: var(--font-size-caption);
  color: var(--text-muted);
  margin: var(--space-2) var(--space-3) 0;
}

.dash-side-legal a {
  display: inline;
  padding: 0;
}

/* The app container: content sits in the marketing <section class="wrap">
   on every page; inside the app the wrap becomes a proper app measure —
   centred, capped at the layout width, app padding rhythm (32px sides,
   32px top, 64px bottom) instead of the marketing 64px/20px layout pad. */
.dash-content {
  flex: 1;
  min-width: 0;
}

body.dash-shell .dash-content .wrap {
  max-width: var(--layout-max-width);
  margin: 0 auto;
  padding: var(--space-8) var(--space-8) var(--space-16);
}

/* Dashboard Overview (10 Nov 2026): app topbar, stats, steps, lists. */
.dash-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding: var(--space-3) var(--space-8);
  border-bottom: var(--border-width) solid var(--border-default);
}

.dash-topbar .dash-crumb {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  min-width: 0;
  font-size: var(--font-size-body-sm);
}

.dash-topbar .dash-crumb a {
  color: var(--text-muted);
  white-space: nowrap;
}

.dash-topbar .dash-org {
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dash-topbar .dash-ws {
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* The topbar's action sits at app density, not marketing button size. */
body.dash-shell .dash-topbar .btn {
  padding-top: var(--space-2);
  padding-bottom: var(--space-2);
}

.dash-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-4);
  margin: 0 0 var(--space-6);
}

.dash-stat {
  background: var(--bg-secondary);
  border: var(--border-width) solid var(--border-default);
  border-radius: var(--radius-md);
  padding: var(--space-5);
}

.dash-stat .num {
  font-size: 28px;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums;
}
/* Stat number is 28px: the same documented app literal as the page H1. */

.dash-stat .lbl {
  color: var(--text-muted);
  font-size: var(--font-size-body-sm);
  margin-top: var(--space-1);
}

.dash-section {
  margin: var(--space-8) 0;
}

.dash-section:last-child {
  margin-bottom: 0;
}

.dash-section h2 {
  font-size: var(--font-size-body);
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 0 0 var(--space-2);
}

.dash-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  margin-bottom: var(--space-2);
}

.dash-section-head h2 {
  margin: 0;
}

.dash-steps {
  list-style: none;
  margin: 0;
  padding: 0;
}

.dash-steps li {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) 0;
  border-bottom: var(--border-width) solid var(--border-subtle);
  font-size: var(--font-size-body-sm);
}

.dash-steps li:last-child {
  border-bottom: none;
}

.dash-steps .mark {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-full);
  font-size: var(--font-size-eyebrow);
  font-weight: 700;
}

.dash-steps .mark.done {
  background: var(--status-success);
  color: var(--text-on-accent);
}

.dash-steps .mark.todo {
  border: var(--border-width) solid var(--border-default);
  color: var(--text-muted);
}

.dash-steps .mark.next {
  color: var(--color-violet-300);
}

.dash-steps .step-todo {
  color: var(--text-muted);
}

.dash-row {
  display: flex;
  align-items: baseline;
  gap: var(--space-4);
  padding: var(--space-3) 0;
  border-bottom: var(--border-width) solid var(--border-subtle);
  font-size: var(--font-size-body-sm);
}

.dash-row:last-child {
  border-bottom: none;
}

.dash-row .r-name {
  font-weight: 600;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dash-row .r-meta {
  color: var(--text-muted);
  font-size: var(--font-size-body-sm);
  white-space: nowrap;
  margin-left: auto;
}

/* Empty states: one quiet, centred treatment inside frames and lists. */
.dash-empty {
  color: var(--text-muted);
  font-size: var(--font-size-body-sm);
  padding: var(--space-4) 0;
  text-align: center;
}

.dash-actions {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-4);
}

.dash-action {
  display: block;
  background: var(--bg-secondary);
  border: var(--border-width) solid var(--border-default);
  border-radius: var(--radius-md);
  padding: var(--space-4);
  color: var(--text-primary);
  text-decoration: none;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.dash-action:hover {
  background: var(--bg-surface);
  border-color: var(--border-strong);
}

.dash-action:focus-visible {
  outline: 2px solid var(--accent-primary);
  outline-offset: 2px;
}

.dash-action strong {
  display: block;
  font-size: var(--font-size-body-sm);
  margin-bottom: var(--space-1);
}

.dash-action span {
  color: var(--text-muted);
  font-size: var(--font-size-body-sm);
  line-height: 1.45;
}

.dash-foot {
  color: var(--text-muted);
  font-size: var(--font-size-body-sm);
  padding: var(--space-6) 0;
}

/* Feature pages (batch 94, 12 Nov 2026): every dashboard page opens with a
   .dash-page-head (group eyebrow, H1, one plain sentence saying what the
   page is and what you can do here), groups its content in .dash-card
   panels, and explains every control with a .dash-help line. Setting rows
   (.dash-row-setting) put the label + help on the left and the control on
   the right, Muse-app settings style. JS-rendered lists sit inside a
   .dash-list-frame so the panel exists before the JS fills it — the JS
   only replaces the frame's contents, never the frame.
   Professional pass (13 Nov 2026): the head is re-scaled to app sizes —
   28px H1, quiet muted eyebrow, body-size lead capped at a readable
   measure — and cards go flat (see the header note). */
.dash-page-head {
  margin-bottom: var(--space-8);
}

.dash-page-head .eyebrow {
  margin: 0 0 var(--space-2);
  font-size: var(--font-size-caption);
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--text-muted);
}

.dash-page-head h1 {
  font-size: 28px;
  line-height: 1.2;
  letter-spacing: -0.02em;
  font-weight: 700;
  margin: 0 0 var(--space-2);
}

.dash-page-head .lead {
  margin: 0;
  font-size: var(--font-size-body);
  line-height: 1.55;
  color: var(--text-secondary);
  max-width: 68ch;
}

.dash-card {
  background: var(--bg-secondary);
  border: var(--border-width) solid var(--border-default);
  border-radius: var(--radius-md);
  padding: var(--space-6);
  margin: 0 0 var(--space-5);
}

.dash-card:last-child {
  margin-bottom: 0;
}

.dash-card > :first-child {
  margin-top: 0;
}

.dash-card > :last-child {
  margin-bottom: 0;
}

.dash-card h2 {
  font-size: var(--font-size-body);
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 0 0 var(--space-2);
}

.dash-card h3 {
  font-size: var(--font-size-body);
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: var(--space-6) 0 var(--space-2);
}

.dash-card h3:first-child {
  margin-top: 0;
}

.dash-help {
  color: var(--text-muted);
  font-size: var(--font-size-body-sm);
  line-height: 1.55;
  margin: var(--space-1) 0 0;
}

.dash-row-setting {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(200px, 320px);
  gap: var(--space-2) var(--space-6);
  align-items: start;
  padding: var(--space-4) 0;
  border-bottom: var(--border-width) solid var(--border-subtle);
}

.dash-row-setting:first-child {
  padding-top: 0;
}

.dash-row-setting:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.dash-row-setting .rs-label label {
  display: block;
}

.dash-row-setting .rs-control {
  min-width: 0;
}

.dash-row-setting .rs-control input,
.dash-row-setting .rs-control select,
.dash-row-setting .rs-control textarea {
  width: 100%;
  margin: 0;
}

.dash-row-setting .rs-control .btn {
  white-space: nowrap;
}

.dash-feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: var(--space-4);
  margin: 0 0 var(--space-5);
}

.dash-feature {
  background: var(--bg-secondary);
  border: var(--border-width) solid var(--border-default);
  border-radius: var(--radius-md);
  padding: var(--space-5);
  display: flex;
  flex-direction: column;
}

.dash-feature h3 {
  font-size: var(--font-size-body);
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 0 0 var(--space-2);
}

.dash-feature p {
  color: var(--text-secondary);
  font-size: var(--font-size-body-sm);
  line-height: 1.55;
  margin: 0;
}

.dash-feature .dash-help {
  margin-top: var(--space-2);
}

/* The feature's action sits at one consistent offset under its text. */
.dash-feature .btn {
  margin-top: var(--space-3);
  align-self: flex-start;
}

.dash-list-frame {
  border: var(--border-width) solid var(--border-default);
  border-radius: var(--radius-md);
  background: var(--bg-secondary);
  padding: var(--space-2) var(--space-5);
  margin: var(--space-4) 0;
}

.dash-list-frame > p {
  color: var(--text-secondary);
  font-size: var(--font-size-body-sm);
}

/* JS-rendered .card entries inside a frame sit at app density (the
   marketing .card is restyled app-wide below); the renderers' inline
   12px bottom margin is dropped on the last entry. */
.dash-list-frame > .card:last-child {
  margin-bottom: 0 !important;
}

.dash-fineprint {
  color: var(--text-muted);
  font-size: var(--font-size-body-sm);
  line-height: 1.55;
  margin-top: var(--space-6);
}

.dash-back {
  margin-top: var(--space-6);
  font-size: var(--font-size-body-sm);
}

/* Small presentation utilities (professional pass): these classes carry
   the declarations that used to be per-page inline style="…" hacks. They
   are presentation-only — no script queries any of them. */
.dash-text-secondary {
  color: var(--text-secondary);
}

.dash-logo-lockup {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.dash-scroll-x {
  overflow-x: auto;
}

.dash-code {
  overflow-x: auto;
  background: var(--bg-primary);
  border: var(--border-width) solid var(--border-default);
  border-radius: var(--radius-md);
  padding: var(--space-4);
  font-family: var(--font-family-mono);
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-secondary);
}

.dash-code-input {
  letter-spacing: 4px;
  font-variant-numeric: tabular-nums;
}

.dash-section-lead {
  color: var(--text-secondary);
  font-size: var(--font-size-body);
  line-height: 1.55;
  margin: 0 0 var(--space-4);
}

.dash-transcript {
  border: var(--border-width) solid var(--border-default);
  border-radius: var(--radius-md);
  padding: var(--space-4);
  min-height: 120px;
  max-height: 320px;
  overflow-y: auto;
  background: var(--bg-primary);
}

.dash-transcript p {
  margin: 0 0 var(--space-2);
  font-size: var(--font-size-body-sm);
  line-height: 1.55;
}

/* Buttons inside the app. RICH pattern (22 Nov 2026, owner's verdict:
   the earlier flat pass looked blank and cheap) — the primary carries
   the brand gradient and a soft shadow with a small hover lift, the
   ghost carries a soft violet tint instead of transparency, so no
   button ever looks empty. App radius kept. A .danger variant is
   defined for destructive actions. */
body.dash-shell .btn {
  background: var(--grad-accent);
  border-radius: var(--radius-sm);
  box-shadow: 0 4px 14px rgba(116,87,255,.35);
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
}

body.dash-shell .btn:hover {
  background: var(--grad-accent);
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(116,87,255,.42);
  filter: brightness(1.06);
}

body.dash-shell .btn:active {
  background: var(--grad-accent);
  transform: translateY(0);
  box-shadow: 0 3px 10px rgba(116,87,255,.3);
  filter: brightness(.97);
}

body.dash-shell .btn.ghost,
body.dash-shell .btn-ghost {
  background: rgba(116,87,255,.08);
  border: var(--border-width) solid rgba(116,87,255,.45);
  color: var(--text-primary);
  box-shadow: none;
}

body.dash-shell .btn.ghost:hover,
body.dash-shell .btn-ghost:hover {
  background: rgba(116,87,255,.16);
  border-color: var(--accent-primary);
  color: var(--text-primary);
}

body.dash-shell .btn.danger {
  background: var(--status-error);
}

body.dash-shell .btn.danger:hover {
  background: var(--status-error);
  filter: brightness(1.1);
}

/* Form controls inside the app: ELEVATED surface fill with a clear
   border (22 Nov 2026 — the old page-background fill made fields
   look blank against the cards), app radius, comfortable padding,
   violet focus ring — cyan stays voice/live only. Labels drop to
   app size. */
body.dash-shell label {
  font-size: var(--font-size-body-sm);
  font-weight: 600;
}

body.dash-shell input,
body.dash-shell select,
body.dash-shell textarea {
  background: var(--bg-surface);
  border-color: var(--border-strong);
  border-radius: var(--radius-sm);
  padding: var(--space-3);
  margin: var(--space-1) 0 var(--space-3);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

body.dash-shell input:hover,
body.dash-shell select:hover,
body.dash-shell textarea:hover {
  border-color: var(--border-strong);
}

body.dash-shell input:focus,
body.dash-shell select:focus,
body.dash-shell textarea:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(116,87,255,.25);
}
/* Focus ring is --accent-primary at 25% over 3px. */

body.dash-shell input:disabled,
body.dash-shell select:disabled,
body.dash-shell textarea:disabled {
  opacity: .55;
  cursor: not-allowed;
}

/* Inline code and tables inside the app: one mono chip treatment and
   one quiet table treatment (hairline rows, small-caps muted heads). */
body.dash-shell code {
  font-family: var(--font-family-mono);
  font-size: .92em;
  background: var(--bg-surface);
  border: var(--border-width) solid var(--border-subtle);
  border-radius: var(--radius-xs);
  padding: 1px 5px;
  overflow-wrap: anywhere;
}

body.dash-shell pre code {
  background: transparent;
  border: 0;
  padding: 0;
  font-size: inherit;
  overflow-wrap: normal;
}

body.dash-shell table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--font-size-body-sm);
}

body.dash-shell th {
  text-align: left;
  font-size: var(--font-size-caption);
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: var(--space-2) var(--space-3);
  border-bottom: var(--border-width) solid var(--border-default);
}

body.dash-shell td {
  padding: var(--space-3);
  border-bottom: var(--border-width) solid var(--border-subtle);
  color: var(--text-secondary);
  line-height: 1.55;
  vertical-align: top;
}

body.dash-shell tbody tr {
  transition: background 0.15s ease;
}

body.dash-shell tbody tr:hover {
  background: rgba(255,255,255,.02);
}
/* Row hover is --color-white at 2%. */

body.dash-shell tr:last-child td {
  border-bottom: 0;
}

/* JS-rendered .card entries (agent list, session list, transcript):
   the marketing card's gradient, lift, shadow, spotlight hover and
   22px title are replaced with the app surface treatment. */
body.dash-shell .card {
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  padding: var(--space-4);
  box-shadow: none;
}

body.dash-shell .card:hover {
  transform: none;
  border-color: var(--border-strong);
  box-shadow: none;
}

body.dash-shell .card::after {
  display: none;
}

body.dash-shell .card h3 {
  font-size: var(--font-size-body);
  font-weight: 600;
  margin: 0 0 var(--space-1);
}

body.dash-shell .card p {
  font-size: var(--font-size-body-sm);
  line-height: 1.55;
}

/* Loading skeletons inside the app: flat blocks with breathing room
   (the global .skeleton keeps its border and zero margin). */
body.dash-shell .skeleton {
  display: block;
  border: 0;
  border-radius: var(--radius-sm);
  margin: var(--space-2) 0;
}

/* Dashboard mobile menu button (R-03 / P4): hidden on desktop; below --bp-md it toggles
   the collapsed sidebar (.dash-sidebar.open). The P4 worker adds the button markup and the
   JS toggle; until then the sidebar below 900px is hidden by default — see the --bp-md block. */
.dash-menu-btn {
  display: none;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  padding: var(--space-2) var(--space-3);
  background: transparent;
  border: var(--border-width) solid var(--border-strong);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: var(--font-size-body-sm);
  font-weight: 700;
  cursor: pointer;
}

.dash-menu-btn:hover {
  border-color: var(--accent-primary);
  color: var(--color-violet-300);
}

.dash-menu-btn:focus-visible,
.dash-fold-btn:focus-visible {
  outline: 2px solid var(--accent-primary);
  outline-offset: 2px;
}

@media (max-width: 900px) {
  /* --bp-md */
  body.dash-shell {
    flex-direction: column;
  }

  .dash-menu-btn {
    display: inline-flex;
  }

  body.dash-shell .dash-content .wrap {
    padding: var(--space-6) var(--space-5) var(--space-12);
  }

  body.dash-shell .dash-content > header > nav {
    padding-left: var(--space-5);
    padding-right: var(--space-5);
  }

  .dash-topbar {
    padding-left: var(--space-5);
    padding-right: var(--space-5);
  }

  .dash-sidebar {
    display: none;
    width: auto;
    height: auto;
    position: static;
    border-right: none;
    border-bottom: var(--border-width) solid var(--border-default);
    padding: var(--space-3);
    overflow-x: auto;
  }

  .dash-sidebar.open {
    display: block;
  }

  .dash-sidebar h2 {
    margin: var(--space-3) var(--space-2) var(--space-1);
  }

  .dash-sidebar nav {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-1);
  }

  /* Group labels take their own row above their chip group on mobile. */
  .dash-sidebar nav h2 {
    flex-basis: 100%;
  }

  .dash-sidebar a {
    padding: var(--space-2);
  }

  .dash-stats {
    grid-template-columns: repeat(2, 1fr);
  }

  .dash-actions {
    grid-template-columns: repeat(2, 1fr);
  }
}


/* Batch 102 (13 Nov 2026): sidebar brand row + fold (collapse) state and
   the two-panel split used by agent-first pages. Folded = icons only,
   labels return on unfold; the choice persists (shell.js, localStorage).
   Easier than the reference dashboard: labels are the DEFAULT, folding is
   the user's opt-in, and every folded link keeps a title tooltip.
   Professional pass: the brand name is set as a wordmark (16px/700,
   no uppercase eyebrow treatment), divided from the nav by a hairline;
   the fold button hovers on the violet accent. */
.dash-brand {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  padding: 0 var(--space-2) var(--space-4);
  margin-bottom: var(--space-2);
  border-bottom: var(--border-width) solid var(--border-subtle);
}

.dash-sidebar .dash-brand h2 {
  font-size: var(--font-size-body);
  font-weight: 700;
  letter-spacing: -0.01em;
  text-transform: none;
  color: var(--text-primary);
  margin: 0;
}

.dash-fold-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  background: transparent;
  border: var(--border-width) solid var(--border-default);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.dash-fold-btn:hover {
  color: var(--color-violet-300);
  border-color: var(--accent-primary);
}

.dash-fold-btn .dash-ico {
  transition: transform 0.15s ease;
}

body.dash-folded .dash-fold-btn .dash-ico {
  transform: rotate(180deg);
}

@media (min-width: 901px) {
  body.dash-folded .dash-sidebar {
    width: 72px;
    padding-left: var(--space-2);
    padding-right: var(--space-2);
  }

  body.dash-folded .dash-sidebar h2,
  body.dash-folded .dash-side-legal {
    display: none;
  }

  /* The pill tag keeps its own font size, so hiding link text with
     font-size:0 would still show it — hide it explicitly when folded. */
  body.dash-folded .dash-sidebar .dash-tag {
    display: none;
  }

  body.dash-folded .dash-brand {
    justify-content: center;
    padding-left: 0;
    padding-right: 0;
  }

  body.dash-folded .dash-sidebar a {
    font-size: 0;
    gap: 0;
    justify-content: center;
    padding-left: 0;
    padding-right: 0;
  }

  body.dash-folded .dash-sidebar a .dash-ico {
    width: 20px;
    height: 20px;
  }
}

/* Two-panel split (list + detail), Vapi-pattern made plain: the list
   column folds away under 1100px into a single stacked column. */
.dash-split {
  display: grid;
  grid-template-columns: 340px minmax(0, 1fr);
  gap: var(--space-5);
  align-items: start;
  margin: 0 0 var(--space-5);
}

.dash-split > * {
  min-width: 0;
}

.dash-split .dash-card {
  margin: 0;
}

@media (max-width: 1100px) {
  .dash-split {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  /* --bp-dashboard */
  .dash-actions {
    grid-template-columns: 1fr;
  }

  .dash-stats {
    gap: var(--space-3);
  }

  .dash-card {
    padding: var(--space-5);
  }

  .dash-page-head h1 {
    font-size: 24px;
  }

  .dash-row-setting {
    grid-template-columns: 1fr;
  }

  .dash-topbar {
    flex-wrap: wrap;
  }

  .dash-row {
    flex-wrap: wrap;
    gap: var(--space-1) var(--space-3);
  }

  .dash-row .r-meta {
    margin-left: 0;
  }
}

/* Reduced motion: the app's colour-only transitions switch off too
   (the global rule in styles.css covers the shared components). */
@media (prefers-reduced-motion: reduce) {
  .dash-sidebar a,
  .dash-sidebar .dash-ico,
  .dash-action,
  .dash-fold-btn,
  .dash-fold-btn .dash-ico,
  body.dash-shell .btn,
  body.dash-shell input,
  body.dash-shell select,
  body.dash-shell textarea,
  body.dash-shell tbody tr {
    transition: none !important;
  }
}

/* Developers group + API credentials (professional pass, 14 Nov 2026):
   how Stripe / OpenAI / Vapi present this area — the Developers group in
   the sidebar is a fold, shut by default for new users and open only on
   a Developers page or when the user opens it (shell.js wires it, the
   choice persists). The API page uses credential rows: a label, a
   Public/Private badge, the value, and a Copy button — never a raw dump. */
.dash-sidebar h2.dash-dev-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  font: inherit;
  color: var(--text-muted);
  text-align: left;
}
.dash-sidebar h2.dash-dev-head:hover { color: var(--text-primary); }
.dash-sidebar h2.dash-dev-head:focus-visible {
  outline: 2px solid var(--accent-primary);
  outline-offset: 2px;
}
.dash-dev-chevron { transition: transform 0.15s ease; flex-shrink: 0; }
.dash-dev-head[aria-expanded="true"] .dash-dev-chevron { transform: rotate(180deg); }
.dash-sidebar a.dash-dev-hidden { display: none; }
body.dash-folded .dash-sidebar h2.dash-dev-head { display: none; }

.dash-badge {
  display: inline-flex;
  align-items: center;
  font-size: var(--font-size-caption);
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  border: var(--border-width) solid var(--border-default);
  border-radius: var(--radius-full);
  padding: 1px 8px;
  margin-left: var(--space-2);
  vertical-align: 1px;
  white-space: nowrap;
}
.dash-badge-public { color: var(--status-success); border-color: var(--status-success); }
.dash-badge-private { color: var(--status-error); border-color: var(--status-error); }
.dash-badge-live { color: var(--color-violet-300); border-color: var(--accent-primary); }

.dash-cred {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: var(--space-1) var(--space-4);
  align-items: start;
  padding: var(--space-4) 0;
  border-bottom: var(--border-width) solid var(--border-subtle);
}
.dash-cred:first-of-type { padding-top: 0; }
.dash-cred:last-of-type { border-bottom: none; padding-bottom: 0; }
.dash-cred .cred-label { font-weight: 600; font-size: var(--font-size-body-sm); }
.dash-cred .cred-value {
  display: block;
  margin-top: var(--space-1);
  overflow-wrap: anywhere;
}
.dash-copy-btn {
  background: transparent;
  border: var(--border-width) solid var(--border-strong);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: var(--font-size-body-sm);
  font-weight: 600;
  padding: var(--space-1) var(--space-3);
  cursor: pointer;
  white-space: nowrap;
}
.dash-copy-btn:hover { border-color: var(--accent-primary); color: var(--color-violet-300); }
.dash-copy-btn:focus-visible {
  outline: 2px solid var(--accent-primary);
  outline-offset: 2px;
}

.dash-quicksteps {
  list-style: none;
  margin: 0;
  padding: 0;
  counter-reset: none;
}
.dash-quicksteps li {
  display: flex;
  gap: var(--space-3);
  padding: var(--space-3) 0;
  border-bottom: var(--border-width) solid var(--border-subtle);
  font-size: var(--font-size-body-sm);
  line-height: 1.55;
  color: var(--text-secondary);
}
.dash-quicksteps li:last-child { border-bottom: none; padding-bottom: 0; }
.dash-quicksteps li:first-child { padding-top: 0; }
.dash-quicksteps .qs-num {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-full);
  background: rgba(116,87,255,.20);
  color: var(--color-violet-300);
  font-weight: 700;
  font-size: var(--font-size-caption);
}
.dash-quicksteps strong { color: var(--text-primary); }

.dash-method {
  display: inline-block;
  font-family: var(--font-family-mono);
  font-size: var(--font-size-caption);
  font-weight: 700;
  letter-spacing: 0.04em;
  border: var(--border-width) solid var(--border-default);
  border-radius: var(--radius-xs);
  padding: 0 6px;
  margin-right: var(--space-2);
  color: var(--color-violet-300);
  white-space: nowrap;
}

/* Org switcher (25 Nov 2026): injected by shell.js under the brand
   row, only for users with 2+ organisations. Hidden when the
   sidebar is folded (icons-only rail has no room for a select). */
.dash-org-switch {
  padding: 0 var(--space-2) var(--space-4);
  margin-bottom: var(--space-2);
  border-bottom: var(--border-width) solid var(--border-subtle);
}

.dash-org-switch label {
  display: block;
  font-size: var(--font-size-caption);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: var(--space-1);
}

.dash-org-switch select {
  width: 100%;
  background: var(--bg-secondary);
  color: var(--text-primary);
  border: var(--border-width) solid var(--border-default);
  border-radius: var(--radius-sm);
  padding: var(--space-2);
  font-size: var(--font-size-body);
}

body.dash-folded .dash-org-switch {
  display: none;
}
