/* =============================================================================
 * Via Hive Command Center V2 — shell, primitives, dashboard (J4-J7, CC-V2-P1)
 * -----------------------------------------------------------------------------
 * Consumes ONLY semantic --vh2-* roles from vh2-tokens.css. Scoped under
 * .v2-app throughout so nothing here can leak onto a legacy (flag-off)
 * screen. html[data-vh2="on"] is stamped before paint by viahive-theme.js.
 * ========================================================================== */

html[data-vh2="on"] body { background: var(--vh2-bg-canvas); }

.v2-app {
  position: fixed;
  inset: 0;
  z-index: var(--vh2-z-shell);
  background: var(--vh2-bg-canvas);
  color: var(--vh2-text-primary);
  display: flex;
  overflow: hidden;
}

/* ---------------------------------------------------------------- sidebar */
/* CC-V2-P1 gate fix: approved spec (VIA-HIVE-DESIGN-SYSTEM-V2-SPEC.md §13.1,
   §17) requires expanded 248px / rail 64px with remembered per-browser state,
   plus responsive rail<=1024px / drawer<=768px. Widths are variables so the
   rail media query and the manual .vh2-shell--rail toggle share one source. */
:root { --vh2-sidebar-w-expanded: 248px; --vh2-sidebar-w-rail: 64px; }
.vh2-sidebar {
  width: var(--vh2-sidebar-w-expanded);
  flex: 0 0 var(--vh2-sidebar-w-expanded);
  background: var(--vh2-surface-sidebar);
  border-right: 1px solid var(--vh2-border-subtle);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overflow-x: hidden;
  padding: var(--vh2-s4) 0 var(--vh2-s6);
  transition: width var(--vh2-dur-base) var(--vh2-ease-standard), flex-basis var(--vh2-dur-base) var(--vh2-ease-standard);
  position: relative;
}
.vh2-sidebar__brand {
  display: flex;
  align-items: center;
  padding: var(--vh2-s2) var(--vh2-s5) var(--vh2-s5);
}
.vh2-sidebar__brand img { max-width: 132px; height: auto; }
.vh2-sidebar__nav { display: flex; flex-direction: column; padding: 0 var(--vh2-s3); }
.vh2-sidebar__group {
  color: var(--vh2-text-tertiary);
  padding: var(--vh2-s4) var(--vh2-s3) var(--vh2-s1);
  white-space: nowrap;
}
.vh2-sidebar__item {
  display: flex;
  align-items: center;
  gap: var(--vh2-s3);
  height: var(--vh2-sidebar-item-h);
  padding: 0 var(--vh2-s3);
  border-radius: var(--vh2-r-md);
  color: var(--vh2-text-secondary);
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  position: relative;
  transition: background var(--vh2-dur-fast) var(--vh2-ease-standard), color var(--vh2-dur-fast) var(--vh2-ease-standard);
}
.vh2-sidebar__item:hover { background: var(--vh2-bg-sunken); color: var(--vh2-text-primary); }
.vh2-sidebar__item.vh2-sidebar__item--active { background: #F1F1EF; color: #B8340F; font-weight: 600; }
/* One wrapper per menu entry: the parent link and its sub-list are SIBLINGS (an <a> may not contain another <a>;
   the HTML parser split the old nested markup and the child links never reached the DOM). The entry is the
   positioning/hover/active anchor for the rail flyout and keeps the parent highlighted on any child route. */
.vh2-sidebar__entry { position: relative; }
.vh2-sidebar__entry.vh2-sidebar__entry--active > .vh2-sidebar__item { background: #F1F1EF; color: #B8340F; font-weight: 600; }
.vh2-sidebar__sub { list-style: none; margin: var(--vh2-s1) 0 var(--vh2-s2) var(--vh2-s6); padding: 0; display: none; }
/* Compact sidebar (Founder UI direction 2026-10-06): a parent's children show only while that entry is active (the
   current route is under it) or has KEYBOARD focus inside it (:focus-visible, not :focus-within: expanding on mouse focus
   moved the target under the pointer between mousedown and mouseup and swallowed the click). Every destination stays
   reachable (the parent link opens its first child, which activates the entry and reveals the rest). */
.vh2-sidebar__entry--active > .vh2-sidebar__sub { display: block; }
.vh2-sidebar__entry:has(:focus-visible) > .vh2-sidebar__sub { display: block; }
.vh2-sidebar__sub li a {
  display: block;
  padding: 6px var(--vh2-s2);
  font-size: 14px;
  color: var(--vh2-text-tertiary);
  border-radius: var(--vh2-r-xs);
}
.vh2-sidebar__sub li a:hover { color: var(--vh2-text-primary); background: var(--vh2-bg-sunken); }
.vh2-sidebar__sub li a.vh2-sidebar__item--active { color: var(--vh2-brand-text); font-weight: 600; }

.vh2-sidebar__rail-toggle {
  margin: var(--vh2-s2) auto 0;
  color: var(--vh2-text-tertiary);
}

/* ---- rail mode (manual toggle, desktop >=1025px only — see media queries
   below for the forced <=1024px/<=768px responsive bands) ---- */
.vh2-shell--rail .vh2-sidebar {
  width: var(--vh2-sidebar-w-rail);
  flex-basis: var(--vh2-sidebar-w-rail);
}
.vh2-shell--rail .vh2-sidebar__brand { justify-content: center; padding-left: 0; padding-right: 0; }
.vh2-shell--rail .vh2-sidebar__brand img { max-width: 32px; }
.vh2-shell--rail .vh2-sidebar__group,
.vh2-shell--rail .vh2-sidebar__item span,
.vh2-shell--rail .vh2-sidebar__sub { display: none; }
.vh2-shell--rail .vh2-sidebar__item { justify-content: center; padding: 0; }
/* Rail mode "shows flyout" (spec §13, SidebarGroup) — the sub-list is still
   in the DOM (ng-if='menu.childs', unchanged), only hidden by the rule above;
   hovering/focusing the rail item re-shows it as an absolutely-positioned
   flyout instead of an inline expansion. Keyboard-reachable via :focus-within
   (Tab into a child link), not just :hover. */
.vh2-shell--rail .vh2-sidebar__entry:hover .vh2-sidebar__sub,
.vh2-shell--rail .vh2-sidebar__entry:focus-within .vh2-sidebar__sub {
  display: block;
  position: absolute;
  left: 100%;
  top: 0;
  margin: 0;
  min-width: 190px;
  background: var(--vh2-surface-raised);
  border: 1px solid var(--vh2-border-default);
  border-radius: var(--vh2-r-md);
  box-shadow: var(--vh2-shadow-lg);
  padding: var(--vh2-s2);
  z-index: var(--vh2-z-dropdown);
}
.vh2-shell--rail .vh2-sidebar__sub li a { white-space: nowrap; }

/* -------------------------------------------------------------- main/topbar */
.vh2-shell__main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; height: 100%; }
.vh2-topbar {
  height: 60px;
  flex: 0 0 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--vh2-s6);
  background: var(--vh2-surface);
  border-bottom: 1px solid var(--vh2-border-subtle);
}
.vh2-topbar__search {
  display: flex;
  align-items: center;
  gap: var(--vh2-s2);
  height: var(--vh2-control-h);
  padding: 0 var(--vh2-s3);
  border-radius: var(--vh2-r-md);
  background: var(--vh2-bg-sunken);
  color: var(--vh2-text-tertiary);
  font-size: 14px;
  min-width: 280px;
}
.vh2-topbar__search:hover { background: var(--vh2-border-subtle); color: var(--vh2-text-secondary); }
.vh2-topbar__search kbd {
  margin-left: auto;
  font-family: var(--vh2-font-mono);
  font-size: 12px;
  background: var(--vh2-surface);
  border: 1px solid var(--vh2-border-default);
  border-radius: var(--vh2-r-xs);
  padding: 1px 5px;
}
.vh2-topbar__right { display: flex; align-items: center; gap: var(--vh2-s3); }
/* Cross-entity operator search (vh-global-search, restored from the legacy header) + pending-provider queue link. */
.vh2-topbar__gsearch { flex: 1 1 auto; min-width: 0; max-width: 440px; margin: 0 var(--vh2-s4); }
.vh2-topbar__gsearch .vh-gsearch { display: block; width: 100%; }
.vh2-topbar__gsearch .vh-gsearch-box { width: 100%; max-width: none; }
.vh2-topbar__gsearch .vh-gsearch-panel { z-index: var(--vh2-z-dropdown); }
.vh2-topbar__pending {
  display: inline-flex; align-items: center; gap: var(--vh2-s2);
  height: var(--vh2-control-h); padding: 0 var(--vh2-s3);
  border-radius: var(--vh2-r-pill); border: 1px solid var(--vh2-warning-border);
  background: var(--vh2-warning-bg); color: var(--vh2-warning-fg);
  font-size: 12px; font-weight: 600; white-space: nowrap;
}
.vh2-topbar__pending vh2-icon { width: 16px; height: 16px; }
.vh2-icon-btn {
  width: var(--vh2-control-h);
  height: var(--vh2-control-h);
  border-radius: var(--vh2-r-md);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--vh2-text-secondary);
}
.vh2-icon-btn:hover { background: var(--vh2-bg-sunken); color: var(--vh2-text-primary); }
.vh2-topbar__user { display: flex; align-items: center; gap: var(--vh2-s2); font-size: 14px; color: var(--vh2-text-secondary); }
.vh2-topbar__logout { color: var(--vh2-text-tertiary); }
.vh2-topbar__logout:hover { color: var(--vh2-danger-fg); }

.vh2-shell__content { flex: 1 1 auto; overflow-y: auto; padding: var(--vh2-s6); }
.vh2-shell__content .view-container,
.vh2-shell__content #content { background: transparent; box-shadow: none; padding: 0; margin: 0; }
/* The legacy shell's fixed sidebar was offset with `body.appWrapper #content { margin-left: var(--vh-sidebar-width) !important }`
   (and `body.sidebar-xs #content { margin-left: 64px !important }`) in viahive-admin.css. Inside the V2 shell the sidebar is part
   of the flex layout, so that offset pushed every legacy screen ~236px too far right. Under the V2 flag the content has no offset. */
html[data-vh2="on"] body.aside-fixed #content,
html[data-vh2="on"] body.appWrapper #content,
html[data-vh2="on"] body.sidebar-xs #content { margin-left: 0 !important; }

/* Legacy stat tiles (.feature-box-container .card .front). viahive-admin.css gives BOTH .card and .front 20px padding with
   !important, and the Clients tiles carry a bg-* class which re-applies it (padding: var(--vh-s5) !important), so the label
   column shrank to ~61px and legacy `word-break: break-word` split words mid-word ("Pendin g Clients"). Inside the V2 shell every tile keeps only the .card
   padding (a consistent, cosmetic normalisation: the reset applies to ALL .feature-box-container tiles under the V2 flag; legacy gave .card and .front
   20px each with !important). */
html[data-vh2="on"] .feature-box-container .card .front,
html[data-vh2="on"] .feature-box-container .card .front[class*="bg-"] { padding: 0 !important; }

/* ------------------------------------------------------------ command palette */
.vh2-command-palette { position: fixed; inset: 0; z-index: var(--vh2-z-command); display: flex; align-items: flex-start; justify-content: center; padding-top: 12vh; }
.vh2-command-palette__backdrop { position: absolute; inset: 0; background: rgba(20, 26, 36, .45); }
:root[data-theme="dark"] .vh2-command-palette__backdrop { background: rgba(28,25,23,.6); }
.vh2-command-palette__panel {
  position: relative;
  width: 560px;
  max-width: calc(100vw - 32px);
  max-height: 60vh;
  background: var(--vh2-surface-raised);
  border-radius: var(--vh2-r-lg);
  box-shadow: var(--vh2-shadow-overlay);
  border: 1px solid var(--vh2-border-default);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.vh2-command-palette__input-row { display: flex; align-items: center; gap: var(--vh2-s3); padding: var(--vh2-s4) var(--vh2-s5); border-bottom: 1px solid var(--vh2-border-subtle); color: var(--vh2-text-tertiary); }
.vh2-command-palette__input { flex: 1; border: 0; background: none; font-size: 16px; color: var(--vh2-text-primary); }
.vh2-command-palette__results { list-style: none; margin: 0; padding: var(--vh2-s2); overflow-y: auto; }
.vh2-command-palette__results li {
  display: flex;
  align-items: center;
  gap: var(--vh2-s3);
  padding: var(--vh2-s2) var(--vh2-s3);
  border-radius: var(--vh2-r-md);
  cursor: pointer;
  font-size: 14px;
}
.vh2-command-palette__result--active { background: var(--vh2-brand-soft); }
.vh2-command-palette__label { color: var(--vh2-text-primary); }
.vh2-command-palette__group { margin-left: auto; color: var(--vh2-text-tertiary); font-size: 12px; }
.vh2-command-palette__empty { color: var(--vh2-text-tertiary); justify-content: center; }

/* =============================================================================
 * Core primitives (J6) — Button / Card / Badge / KPI / EmptyState / Skeleton
 * ========================================================================== */
.vh2-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--vh2-s2);
  height: var(--vh2-control-h); padding: 0 var(--vh2-s4);
  border-radius: var(--vh2-r-md); font-size: 14px; font-weight: 500;
  transition: background var(--vh2-dur-fast) var(--vh2-ease-standard), opacity var(--vh2-dur-fast) var(--vh2-ease-standard);
  border: 1px solid transparent;
}
.vh2-btn--primary { background: var(--vh2-action-primary-bg); color: var(--vh2-action-primary-fg); }
.vh2-btn--primary:hover { background: var(--vh2-action-primary-bg-hover); }
.vh2-btn--secondary { background: var(--vh2-action-secondary-bg); color: var(--vh2-action-secondary-fg); border-color: var(--vh2-action-secondary-border); }
.vh2-btn--secondary:hover { background: var(--vh2-bg-sunken); }
.vh2-btn--ghost { background: transparent; color: var(--vh2-action-ghost-fg); }
.vh2-btn--ghost:hover { background: var(--vh2-bg-sunken); }
.vh2-btn--danger { background: var(--vh2-action-danger-bg); color: var(--vh2-action-danger-fg); }
.vh2-btn:disabled { opacity: .5; cursor: not-allowed; }

.vh2-card {
  background: var(--vh2-surface);
  border: 1px solid var(--vh2-border-subtle);
  border-radius: var(--vh2-r-lg);
  padding: var(--vh2-card-pad);
  box-shadow: var(--vh2-shadow-xs);
}
.vh2-card--interactive { transition: box-shadow var(--vh2-dur-base) var(--vh2-ease-standard), border-color var(--vh2-dur-base) var(--vh2-ease-standard); }
.vh2-card--interactive:hover { box-shadow: var(--vh2-shadow-md); border-color: var(--vh2-border-default); }

.vh2-badge {
  display: inline-flex; align-items: center; height: 22px; padding: 0 var(--vh2-s2);
  border-radius: var(--vh2-r-pill); font-size: 12px; font-weight: 600;
  border: 1px solid transparent;
}
.vh2-badge--success { background: var(--vh2-success-bg); color: var(--vh2-success-fg); border-color: var(--vh2-success-border); }
.vh2-badge--warning { background: var(--vh2-warning-bg); color: var(--vh2-warning-fg); border-color: var(--vh2-warning-border); }
.vh2-badge--danger  { background: var(--vh2-danger-bg);  color: var(--vh2-danger-fg);  border-color: var(--vh2-danger-border); }
.vh2-badge--info    { background: var(--vh2-info-bg);    color: var(--vh2-info-fg);    border-color: var(--vh2-info-border); }
.vh2-badge--neutral { background: var(--vh2-neutral-bg); color: var(--vh2-neutral-fg); border-color: var(--vh2-neutral-border); }

.vh2-kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: var(--vh2-s4); }
.vh2-kpi {
  background: var(--vh2-surface);
  border: 1px solid var(--vh2-border-subtle);
  border-radius: var(--vh2-r-lg);
  padding: var(--vh2-card-pad);
  display: block;
  transition: box-shadow var(--vh2-dur-base) var(--vh2-ease-standard), border-color var(--vh2-dur-base) var(--vh2-ease-standard);
}
a.vh2-kpi:hover { box-shadow: var(--vh2-shadow-md); border-color: var(--vh2-border-default); }
.vh2-kpi__label { font-size: 14px; color: var(--vh2-text-secondary); margin-bottom: var(--vh2-s2); }
.vh2-kpi__value { font-size: 28px; line-height: 34px; font-weight: 600; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; color: var(--vh2-text-primary); }
.vh2-kpi__meta { font-size: 12px; color: var(--vh2-text-tertiary); margin-top: var(--vh2-s1); }

.vh2-empty-state {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: var(--vh2-s2); padding: var(--vh2-s10) var(--vh2-s4); text-align: center;
  color: var(--vh2-text-tertiary); font-size: 14px;
}
.vh2-error-state { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--vh2-s2); padding: var(--vh2-s8) var(--vh2-s4); text-align: center; color: var(--vh2-danger-fg); font-size: 14px; background: var(--vh2-danger-bg); border: 1px solid var(--vh2-danger-border); border-radius: var(--vh2-r-lg); }

.vh2-skeleton {
  background: linear-gradient(90deg, var(--vh2-bg-sunken) 25%, var(--vh2-border-subtle) 37%, var(--vh2-bg-sunken) 63%);
  background-size: 400% 100%;
  animation: vh2-skeleton-pulse 1.4s ease infinite;
  border-radius: var(--vh2-r-sm);
}
@keyframes vh2-skeleton-pulse { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }
@media (prefers-reduced-motion: reduce) { .vh2-skeleton { animation: none; } }

/* =============================================================================
 * Dashboard V2 (J7) — reuses the exact DLC.statistics.* / DLC.alerts.* fields
 * already resolved by DashboardCtrl (see dashboard.js) and already proven in
 * the existing "Admin V3" .vh-dash template; only the presentation is new.
 * ========================================================================== */
.vh2-dash { display: flex; flex-direction: column; gap: var(--vh2-s8); }
.vh2-dash__head h1 { font-size: 22px; line-height: 32px; font-weight: 600; letter-spacing: -.015em; color: var(--vh2-text-primary); margin: 0; }
.vh2-dash__head p { font-size: 14px; color: var(--vh2-text-tertiary); margin: var(--vh2-s1) 0 0; }
.vh2-dash__section-title { font-size: 16px; font-weight: 600; color: var(--vh2-text-primary); margin: 0 0 var(--vh2-s3); }
.vh2-dash__hint { font-size: 12px; color: var(--vh2-text-tertiary); margin: -8px 0 var(--vh2-s3); }

.vh2-alerts-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.vh2-alerts-table th { text-align: left; color: var(--vh2-text-tertiary); font-weight: 500; padding: var(--vh2-s2) var(--vh2-s3); border-bottom: 1px solid var(--vh2-border-subtle); }
.vh2-alerts-table td { padding: var(--vh2-s2) var(--vh2-s3); border-bottom: 1px solid var(--vh2-border-subtle); color: var(--vh2-text-primary); vertical-align: middle; }
.vh2-alerts-table tr:last-child td { border-bottom: 0; }
.vh2-alerts-table tr.vh2-alerts-table__row--hot td:first-child { color: var(--vh2-danger-fg); font-weight: 600; }
.vh2-alerts-table .vh2-num { font-variant-numeric: tabular-nums; }
.vh2-alerts-table a.vh2-review { color: var(--vh2-text-link); font-size: 12px; font-weight: 500; }

.vh2-stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: var(--vh2-s3); }
.vh2-stat { display: block; background: var(--vh2-surface); border: 1px solid var(--vh2-border-subtle); border-radius: var(--vh2-r-md); padding: var(--vh2-s4); }
a.vh2-stat:hover { border-color: var(--vh2-border-default); box-shadow: var(--vh2-shadow-sm); }
.vh2-stat__label { font-size: 12px; color: var(--vh2-text-secondary); margin-bottom: 4px; }
.vh2-stat__value { font-size: 22px; font-weight: 600; letter-spacing: -.01em; color: var(--vh2-text-primary); font-variant-numeric: tabular-nums; }
.vh2-stat__meta { font-size: 12px; color: var(--vh2-text-tertiary); margin-top: 2px; }

.vh2-dash__growth { list-style: none; display: flex; flex-wrap: wrap; gap: var(--vh2-s2) var(--vh2-s6); padding: 0; margin: 0; font-size: 14px; color: var(--vh2-text-secondary); }
.vh2-dash__growth strong { color: var(--vh2-text-primary); }
.vh2-dash__growth a { color: inherit; }
.vh2-dash__growth a:hover strong { color: var(--vh2-text-link); }

/* =============================================================================
 * Toastr / $modal restyle (J6) — same widgets, tokens only, V2 shell only.
 * ========================================================================== */
html[data-vh2="on"] .toast { background-color: var(--vh2-ink-800); border-radius: var(--vh2-r-md); box-shadow: var(--vh2-shadow-lg); font-family: var(--vh2-font); }
html[data-vh2="on"] .toast-success { background-color: var(--vh2-emerald-700); }   /* white label: 6.5:1 (emerald-500 was 4.36:1) */
html[data-vh2="on"] .toast-error { background-color: var(--vh2-red-600); }
html[data-vh2="on"] .toast-info { background-color: var(--vh2-blue-500); }
html[data-vh2="on"] .toast-warning { background-color: var(--vh2-orange-700); }   /* brand pass U11: no amber */
html[data-vh2="on"] .modal-content { background: var(--vh2-surface-raised); color: var(--vh2-text-primary); border-radius: var(--vh2-r-lg); border: 1px solid var(--vh2-border-default); font-family: var(--vh2-font); }
html[data-vh2="on"] .modal-header, html[data-vh2="on"] .modal-footer { border-color: var(--vh2-border-subtle); }
html[data-vh2="on"] .modal-backdrop { background: rgba(20, 26, 36, .5); }

.vh2-topbar__menu { display: none; }
.vh2-sidebar__backdrop { display: none; }
/* Rail toggle is a desktop (>=1025px) affordance only — <=1024px forces rail
   automatically (below) and <=768px is a drawer, neither needs a manual
   expand/collapse control. */
.vh2-sidebar__rail-toggle { display: flex; }

/* ------------------------------------------------------------- responsive */
/* Approved spec §17: "<=1024 sidebar -> rail * <=768 sidebar -> drawer."
   Two separate bands, not one — <=1024 forces rail (regardless of the manual
   .vh2-shell--rail toggle state, since there's no room for both a rail and an
   expanded option to coexist meaningfully at that width); <=768 goes further
   to an off-canvas drawer, which needs the FULL expanded-width content (not
   rail) once opened, so it explicitly un-hides what the 1024 band hid. */
@media (max-width: 1024px) {
  .vh2-sidebar__rail-toggle { display: none; }
  .vh2-sidebar { width: var(--vh2-sidebar-w-rail); flex-basis: var(--vh2-sidebar-w-rail); }
  .vh2-sidebar__brand { justify-content: center; padding-left: 0; padding-right: 0; }
  .vh2-sidebar__brand img { max-width: 32px; }
  .vh2-sidebar__group, .vh2-sidebar__item span, .vh2-sidebar__sub { display: none; }
  /* the compact "active entry shows its children" rule must not reopen the sub-list inside the icon rail band */
  .vh2-sidebar__entry--active > .vh2-sidebar__sub { display: none; }
  .vh2-sidebar__entry:has(:focus-visible) > .vh2-sidebar__sub { display: none; }
  .vh2-sidebar__item { justify-content: center; padding: 0; }
  .vh2-sidebar__entry:hover .vh2-sidebar__sub, .vh2-sidebar__entry:focus-within .vh2-sidebar__sub {
    display: block; position: absolute; left: 100%; top: 0; margin: 0; min-width: 190px;
    background: var(--vh2-surface-raised); border: 1px solid var(--vh2-border-default);
    border-radius: var(--vh2-r-md); box-shadow: var(--vh2-shadow-lg); padding: var(--vh2-s2);
    z-index: var(--vh2-z-dropdown);
  }
  .vh2-sidebar__sub li a { white-space: nowrap; }
}
@media (max-width: 768px) {
  .vh2-topbar__menu { display: inline-flex; }
  .vh2-sidebar, .vh2-shell--rail .vh2-sidebar {
    width: var(--vh2-sidebar-w-expanded); flex-basis: var(--vh2-sidebar-w-expanded);
    position: fixed; top: 0; left: 0; z-index: var(--vh2-z-sidebar); height: 100%;
    transform: translateX(-100%); transition: transform var(--vh2-dur-base) var(--vh2-ease-standard);
    box-shadow: var(--vh2-shadow-lg);
  }
  .vh2-shell--nav-open .vh2-sidebar { transform: translateX(0); }
  /* Undo the <=1024 rail collapse AND the manual desktop .vh2-shell--rail
     toggle: a drawer, once opened, always shows full content regardless of
     whichever collapse state was active at a wider width before the viewport
     shrank (its higher class-specificity would otherwise win over a bare
     .vh2-sidebar__item span rule here — matched explicitly below instead of
     relying on cascade order once !important-free specificity is tied). */
  .vh2-sidebar__brand, .vh2-shell--rail .vh2-sidebar__brand { justify-content: flex-start; padding-left: var(--vh2-s5); padding-right: var(--vh2-s5); }
  .vh2-sidebar__brand img, .vh2-shell--rail .vh2-sidebar__brand img { max-width: 132px; }
  .vh2-sidebar__group, .vh2-sidebar__item span,
  .vh2-shell--rail .vh2-sidebar__group, .vh2-shell--rail .vh2-sidebar__item span { display: block; }
  .vh2-sidebar__item, .vh2-shell--rail .vh2-sidebar__item { justify-content: flex-start; padding: 0 var(--vh2-s3); }
  .vh2-sidebar__entry:hover .vh2-sidebar__sub, .vh2-sidebar__entry:focus-within .vh2-sidebar__sub,
  .vh2-shell--rail .vh2-sidebar__entry:hover .vh2-sidebar__sub, .vh2-shell--rail .vh2-sidebar__entry:focus-within .vh2-sidebar__sub { position: static; box-shadow: none; border: 0; background: transparent; padding: 0; }
  /* drawer: compact like the desktop sidebar - the active entry and any keyboard-focused entry show their children inline; hover/focus-within flyout rules above also still open a sub-list on pointer hover (harmless: the pointer target does not move) */
  .vh2-sidebar__sub, .vh2-shell--rail .vh2-sidebar__sub { display: none; }
  .vh2-sidebar__entry--active > .vh2-sidebar__sub, .vh2-shell--rail .vh2-sidebar__entry--active > .vh2-sidebar__sub { display: block; }
  .vh2-sidebar__entry:has(:focus-visible) > .vh2-sidebar__sub { display: block; }
  .vh2-shell--rail .vh2-sidebar__entry:has(:focus-visible) > .vh2-sidebar__sub { display: block; }
  .vh2-sidebar__backdrop { display: block; position: fixed; inset: 0; z-index: calc(var(--vh2-z-sidebar) - 1); background: rgba(20, 26, 36, .45); }
  .vh2-topbar__search { min-width: 0; flex: 1; }
  .vh2-topbar__gsearch { display: none; }   /* same as the legacy header, which hides the host on narrow widths */
  .vh2-topbar__search span { display: none; }
  .vh2-topbar__search kbd { display: none; }
  .vh2-shell__content { padding: var(--vh2-s4); }
  .vh2-kpi-grid, .vh2-stat-grid { grid-template-columns: 1fr; }
}

/* ---------------------------------------------------------------- icons */
/* CC-V2-P1 gate fix: self-hosted inline-SVG Lucide icons (vh2-icons.js),
   replacing the legacy `fa`/Font Awesome directive inside the V2 shell only
   (D-314: Lucide-only, no second icon family). Sized per context exactly
   like the `.fa` rule it replaces. */
vh2-icon { display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; width: 16px; height: 16px; }
vh2-icon svg { width: 100%; height: 100%; }
.vh2-sidebar__item > vh2-icon { width: 16px; height: 16px; opacity: .9; color: var(--vh2-brand); }
.vh2-sidebar__rail-toggle vh2-icon { width: 16px; height: 16px; }
.vh2-icon-btn vh2-icon { width: 18px; height: 18px; }
.vh2-topbar__logout vh2-icon { width: 16px; height: 16px; }
.vh2-topbar__search vh2-icon { width: 16px; height: 16px; }
.vh2-command-palette__input-row vh2-icon { width: 16px; height: 16px; }
.vh2-command-palette__results vh2-icon { width: 14px; height: 14px; }
