/**
 * rmc-platform-vertical-compact.css — v3.85.0 (2026-05-24)
 * Platform-wide vertical density: collapse dead bands, tighten admin changelists,
 * align operator canvas with v8 200x preview (content hugs header chrome).
 */

/* === Chrome stack z-index ladder (tenant fixed mount + manager bridge) ===
   Bootstrap sticky header = 1030; copilot rail must sit ABOVE pinned tenant
   header/mission chrome so the right column stays clickable (/super/ grid parity).
   Dropdown menus = 1080+; modals = 1055+. */
:root {
  --rmc-shell-header-z: 1030;
  --rmc-shell-sidebar-z: 1020;
  --rmc-copilot-rail-z: 1042;
}

/* === Bleed guard: never render template comment leakage as text ========= */
body.control-plane-shell,
body.admin-manager-shell,
body.portal-body-with-layout {
  /* No-op anchor — documents intent for scanners */
}

/* === Remove workspace card dead zone (sidebar starts at nav catalog) === */
body.control-plane-shell .cp-sidebar .rmc-cockpit-workspace,
body.admin-manager-shell .cp-sidebar .rmc-cockpit-workspace {
  display: none !important;
}

body.control-plane-shell .cp-sidebar-inner,
body.admin-manager-shell .cp-sidebar {
  padding-top: 0.35rem !important;
}

/* === Canvas: collapse empty wrappers (breadcrumb-only void) ============== */
body.control-plane-shell .rmc-app-shell__canvas-body > .container-fluid:empty,
body.control-plane-shell .cp-page-body > .container-fluid:empty,
body.control-plane-shell .cp-layout > main > .w-100:empty,
body.admin-manager-shell .cp-admin-canvas-main > .w-100:empty,
body.admin-manager-shell #content > .w-100:empty {
  display: none !important;
  min-height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
}

body.control-plane-shell .rmc-app-shell__canvas-body,
body.admin-manager-shell .cp-admin-canvas-main {
  padding-top: 0 !important;
}

body.control-plane-shell .cp-layout {
  padding-top: 0.25rem !important;
  padding-bottom: 0.5rem !important;
}

body.control-plane-shell .breadcrumb,
body.admin-manager-shell .rmc-admin-breadcrumb-nav {
  margin-bottom: 0.35rem !important;
  padding-top: 0.25rem !important;
  padding-bottom: 0.25rem !important;
}

body.admin-manager-shell .cp-admin-page-body {
  padding-top: 0.25rem !important;
  padding-bottom: 0.75rem !important;
}

body.admin-manager-shell #content.colM,
body.admin-manager-shell #content {
  padding-top: 0 !important;
  margin-top: 0 !important;
}

body.admin-manager-shell .admin-operator-steering-strip,
body.admin-manager-shell [data-rmc-operator-surface-strip] {
  margin-top: 0 !important;
  margin-bottom: 0.5rem !important;
}

/* MFA / preview cues — slim vertical footprint */
body.admin-manager-shell .preview-cue,
body.control-plane-shell .preview-cue {
  margin-bottom: 0.5rem !important;
  padding-top: 0.5rem !important;
  padding-bottom: 0.5rem !important;
}

/* === /admin/ changelist & inner config surfaces (10x density) =========== */
body.admin-manager-shell #changelist {
  margin-top: 0 !important;
}

body.admin-manager-shell #changelist .changelist-form-container,
body.admin-manager-shell #changelist-form {
  margin-top: 0.35rem !important;
}

body.admin-manager-shell #changelist-filter {
  top: 0;
  border-radius: var(--radius-lg, 16px);
  border: 1px solid var(--hairline);
  box-shadow: var(--elev-1);
}

body.admin-manager-shell .object-tools {
  margin-bottom: 0.5rem !important;
}

body.admin-manager-shell #result_list,
body.admin-manager-shell .results {
  border-radius: var(--radius-lg, 16px);
  overflow: hidden;
  border: 1px solid var(--hairline);
  box-shadow: var(--elev-1);
}

body.admin-manager-shell #result_list thead th,
body.admin-manager-shell .results thead th {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-tertiary);
  background: var(--surface-elevated);
}

body.admin-manager-shell .paginator {
  margin-top: 0.75rem !important;
  font-size: 13px;
}

body.admin-manager-shell .rmc-admin-changelist-header,
body.admin-manager-shell #content h1 {
  margin-top: 0.35rem !important;
  margin-bottom: 0.5rem !important;
}

body.admin-manager-shell .rmc-admin-filter-panel,
body.admin-manager-shell fieldset.module {
  border-radius: var(--radius-lg, 16px);
  border: 1px solid var(--hairline);
  box-shadow: var(--elev-1);
  margin-bottom: 0.75rem !important;
}

body.admin-manager-shell #toolbar,
body.admin-manager-shell .actions,
body.admin-manager-shell .changelist-search {
  margin-top: 0.25rem !important;
  margin-bottom: 0.5rem !important;
}

body.admin-manager-shell #changelist-search input[type="search"],
body.admin-manager-shell #searchbar {
  border-radius: var(--radius-md, 12px);
  border: 1px solid var(--hairline);
  min-height: 2.25rem;
}

body.admin-manager-shell #changelist .actions select,
body.admin-manager-shell #changelist .actions button {
  border-radius: var(--radius-md, 12px);
}

body.admin-manager-shell #result_list tbody tr:hover,
body.admin-manager-shell .results tbody tr:hover {
  background: color-mix(in srgb, var(--surface-elevated) 88%, var(--text-primary) 12%);
}

body.admin-manager-shell .submit-row {
  margin-top: 0.75rem !important;
  padding-top: 0.75rem !important;
  border-top: 1px solid var(--hairline);
}

body.manager-portal-bridge .cp-sidebar .rmc-cockpit-workspace {
  display: none !important;
}

body.manager-portal-bridge .cp-sidebar-inner {
  padding-top: 0.35rem !important;
}

body.manager-portal-bridge .page-wrap > .container-fluid:first-child,
body.manager-portal-bridge #main-content > .container-fluid:first-child {
  padding-top: 0.35rem !important;
}

/* === Footer notebook: right dock, collapsed default ==================== */
.rmc-footer-notebook-anchor {
  display: block;
  min-height: 0;
  padding: 0;
  pointer-events: none;
}

.rmc-footer-notebook-anchor .lx-notebook {
  pointer-events: auto;
}

body[data-rmc-notebook-footer-dock="1"] .rmc-footer-notebook-anchor .lx-notebook[data-rmc-notebook-state="minimized"] {
  width: min(280px, 92vw);
  max-width: 280px;
}

/* === Manager portal bridge: fixed copilot rail (Bootstrap layout) ====== */
body.manager-portal-bridge .rmc-manager-portal-copilot-mount {
  position: fixed;
  top: var(--rmc-app-shell-header-h, 104px);
  right: 0;
  bottom: calc(var(--rmc-operator-footer-height, 56px) + 8px);
  width: var(--rmc-app-shell-copilot-w, 44px);
  z-index: var(--rmc-copilot-rail-z, 1042);
  pointer-events: none;
  overflow: hidden;
}

body.manager-portal-bridge .rmc-manager-portal-copilot-mount .rmc-app-shell__copilot,
body.manager-portal-bridge .rmc-manager-portal-copilot-mount .lx-copilot {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: auto;
}

body.manager-portal-bridge[data-copilot="expanded"] .rmc-manager-portal-copilot-mount {
  --rmc-app-shell-copilot-w: 360px;
  width: 360px;
}

body.manager-portal-bridge[data-rmc-copilot-page-help="1"] .rmc-help-contextual-drawer {
  display: none !important;
}

body.manager-portal-bridge .portal-main-col,
body.manager-portal-bridge #main-content {
  padding-right: calc(var(--rmc-app-shell-copilot-w, 44px) + 8px);
}

body.manager-portal-bridge[data-copilot="expanded"] .portal-main-col,
body.manager-portal-bridge[data-copilot="expanded"] #main-content {
  padding-right: calc(360px + 8px);
}

@media (max-width: 1199.98px) {
  body.manager-portal-bridge .rmc-manager-portal-copilot-mount {
    display: none;
  }
  body.manager-portal-bridge .portal-main-col,
  body.manager-portal-bridge #main-content {
    padding-right: 0;
  }
}

/* === Tenant canvas: fill the main column (no 1320px left-aligned cap) ===== */
/* design-tokens.css documents the intent as --rmc-shell-max-width:none ("dashboards
   use the full main column between sidebar rails … tenant portal …"), but
   root-base-shell.css re-caps it to 1320px on :root. With .page-wrap's margin-inline:0
   (left-aligned), the tenant canvas hugged the left on wide screens and left dead space
   between the content and the copilot rail. Restore the documented full-column fill for
   the TENANT portal only — the cockpit grids are built to fill (4/6-col snapshot &
   quick-actions, auto-fill wizard grid). Manager / control-plane keep their own cap.
   Safe from overflow: .portal-main-col is overflow-x:clip + min-width:0 and the grids
   use minmax(0, 1fr). */
body.portal-body-with-layout:not(.control-plane-shell) {
  --rmc-shell-max-width: none;
}

/* === Tenant portal bridge: fixed copilot rail (Bootstrap layout) ====== */
/* v4.04.x: tenant copilot rail widened 44 → 56px to match the single-rail
   tenant-admin workspace preview. The tools edge-tab folds into the bottom of
   this same column (see rmc-operator-tools-tray.css, tenant block) so the right
   edge reads as ONE 56px rail. Scoped to the tenant copilot-rail body attribute
   only — the manager grid (data-rmc-notebook-footer-dock) is untouched. The var
   cascades to both the mount width (below) and the main-col padding-right. */
body[data-rmc-tenant-copilot-rail="1"] {
  --rmc-app-shell-copilot-w: 56px;
}
body[data-rmc-tenant-copilot-rail="1"] .rmc-tenant-portal-copilot-mount {
  position: fixed;
  top: var(--rmc-app-shell-header-h, 72px);
  right: 0;
  bottom: 8px;
  width: var(--rmc-app-shell-copilot-w, 56px);
  max-width: var(--rmc-app-shell-copilot-w, 56px);
  z-index: var(--rmc-copilot-rail-z, 1042);
  pointer-events: none;
  overflow: hidden;
  transition: width var(--motion-slow, 420ms cubic-bezier(0.22, 0.61, 0.36, 1));
}

body[data-rmc-tenant-copilot-rail="1"] .rmc-tenant-portal-copilot-mount .rmc-app-shell__copilot,
body[data-rmc-tenant-copilot-rail="1"] .rmc-tenant-portal-copilot-mount .lx-copilot {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: auto;
}

body[data-rmc-tenant-copilot-rail="1"][data-copilot="expanded"] .rmc-tenant-portal-copilot-mount,
body[data-rmc-tenant-copilot-rail="1"][data-rmc-copilot-shell="expanded"] .rmc-tenant-portal-copilot-mount {
  --rmc-app-shell-copilot-w: 360px;
  width: 360px !important; /* style-allow: tenant-copilot-expanded-must-widen */
  max-width: 360px !important;
}

body[data-rmc-tenant-copilot-rail="1"][data-rmc-copilot-page-help="1"] .rmc-help-contextual-drawer {
  display: none !important;
}

body[data-rmc-tenant-copilot-rail="1"] .portal-main-col,
body[data-rmc-tenant-copilot-rail="1"] #main-content {
  padding-right: calc(var(--rmc-app-shell-copilot-w, 44px) + var(--rmc-workspace-edge-gap, 2px));
  transition: padding-right var(--motion-slow, 420ms cubic-bezier(0.22, 0.61, 0.36, 1));
}

@media (prefers-reduced-motion: reduce) {
  body[data-rmc-tenant-copilot-rail="1"] .rmc-tenant-portal-copilot-mount,
  body[data-rmc-tenant-copilot-rail="1"] .portal-main-col,
  body[data-rmc-tenant-copilot-rail="1"] #main-content {
    transition: none;
  }
}

/* xl+ only: the expanded 360px panel reserves space by pushing content. Below
   xl the panel is allowed to OVERLAY (content keeps its collapsed 56px padding,
   set by the base rule above) so the narrower lg canvas isn't squeezed — the
   panel is position:fixed, so it floats over the right edge instead. */
@media (min-width: 1200px) {
  body[data-rmc-tenant-copilot-rail="1"][data-copilot="expanded"] .portal-main-col,
  body[data-rmc-tenant-copilot-rail="1"][data-copilot="expanded"] #main-content {
    padding-right: calc(360px + var(--rmc-workspace-edge-gap, 2px));
  }
}

/* v4.04.x: rail now shows at lg+ (≥992px) to match the header inline-nav
   breakpoint — was xl+ (≥1200px). Below lg (tablet / mobile) the rail is hidden
   and the tools tab floats free, as before. */
@media (max-width: 991.98px) {
  body[data-rmc-tenant-copilot-rail="1"] .rmc-tenant-portal-copilot-mount {
    display: none;
  }
  body[data-rmc-tenant-copilot-rail="1"] .portal-main-col,
  body[data-rmc-tenant-copilot-rail="1"] #main-content {
    padding-right: 0;
  }
}

/* === Manager /admin/ copilot rail (3rd grid column) ===================== */
body.admin-manager-shell .rmc-app-shell.admin-cp-unified-page {
  grid-template-columns: var(--rmc-app-shell-sidebar-w, clamp(240px, 18vw, 320px)) 1fr var(--rmc-app-shell-copilot-w, 44px);
}

body.admin-manager-shell .rmc-app-shell.admin-cp-unified-page[data-copilot="expanded"] {
  --rmc-app-shell-copilot-w: 360px;
}

body.admin-manager-shell .rmc-app-shell__copilot {
  grid-row: 2;
  grid-column: 3;
}

@media (max-width: 1199.98px) {
  body.admin-manager-shell .rmc-app-shell.admin-cp-unified-page {
    grid-template-columns: var(--rmc-app-shell-sidebar-w, clamp(240px, 18vw, 320px)) 1fr;
  }
  body.admin-manager-shell .rmc-app-shell__copilot {
    display: none;
  }
}

/* Floating help drawer hidden when copilot owns page-help */
body.control-plane-shell[data-rmc-copilot-page-help="1"] .rmc-help-contextual-drawer,
body.admin-manager-shell[data-rmc-copilot-page-help="1"] .rmc-help-contextual-drawer {
  display: none !important;
}

/* ============================================================
   v4.02.x — PUSH CONTENT UP (platform-wide, every manager.runmycampus.com page)
   ------------------------------------------------------------
   The page hero (rmc-wcx-hero, e.g. "Platform Command Center") + its top
   margins left a tall dead band between the header chrome and the first real
   content (Platform Pulse, changelists, dashboards). Tighten the hero and zero
   the first-child top margin so content hugs the header — like the v8 200x
   mockup where the dashboard begins right under the header. Compact, NOT
   cramped: real padding is kept, just trimmed. No viewport-lock, no clipping.
   Scope = all manager-host operator shells.
   ============================================================ */
body.control-plane-shell #cp-main-content > *:first-child,
body.admin-manager-shell #cp-main-content > *:first-child,
body[data-rmc-host-kind="manager"]:not(.marketing-surface) #cp-main-content > *:first-child,
body.control-plane-shell .rmc-app-shell__canvas-body > *:first-child,
body.admin-manager-shell .cp-admin-page-body > *:first-child {
  margin-top: 0 !important;
}

/* Slim the world-class page hero on operator surfaces (it's a band, not a
   landing splash here). */
body.control-plane-shell .rmc-wcx-hero,
body.admin-manager-shell .rmc-wcx-hero,
body[data-rmc-host-kind="manager"]:not(.marketing-surface) .rmc-wcx-hero {
  padding: clamp(0.55rem, 1vw, 0.85rem) !important;
  margin-bottom: 0.6rem !important;
}
body.control-plane-shell .rmc-wcx-hero__title,
body.admin-manager-shell .rmc-wcx-hero__title,
body[data-rmc-host-kind="manager"]:not(.marketing-surface) .rmc-wcx-hero__title {
  font-size: clamp(1.3rem, 1.7vw, 1.7rem) !important;
  margin: 0.1rem 0 !important;
  line-height: 1.12 !important;
}
body.control-plane-shell .rmc-wcx-hero__copy,
body.admin-manager-shell .rmc-wcx-hero__copy,
body[data-rmc-host-kind="manager"]:not(.marketing-surface) .rmc-wcx-hero__copy {
  margin-bottom: 0.4rem !important;
}

/* Tighten the canvas/page-body top padding that opens the header gap. */
body.control-plane-shell .cp-page-body,
body.control-plane-shell .cp-canvas-body,
body.admin-manager-shell .cp-page-body {
  padding-top: 0.35rem !important;
}

/* Collapsable cockpit sections (Platform pulse, world map, …) shouldn't carry
   a big top margin on the first band either. */
body.control-plane-shell .cp-content > .rmc-collapsable:first-child,
body.control-plane-shell #cp-main-content > .rmc-collapsable:first-child {
  margin-top: 0 !important;
}

/* ------------------------------------------------------------------
   MEASURED top-gap killers (headless: header bottom 177px, first
   content band 267px = 90px gap). The existing rmc-cp-200x rules only
   pin `.cp-platform-pulse`, but the operator landing uses
   rmc-cockpit-pulse inside cp-page-body — so these contributors were
   never tightened. Reclaim ~65px so the first band hugs the header
   (compact, not cramped — a small 4–6px breath is kept).
   ------------------------------------------------------------------ */
body[data-rmc-shell-main="control-plane"] #cp-main-content,
body[data-rmc-host-kind="manager"]:not(.marketing-surface) #cp-main-content {
  padding-top: 4px !important;          /* was ~17px */
}
/* Empty/idle operator status stack (offline-sync bar is d-none when all
   synced) — kill its dead 16px top margin + collapse the empty wrapper. */
body[data-rmc-shell-main="control-plane"] .rmc-os-status-stack,
body.admin-manager-shell .rmc-os-status-stack {
  margin-top: 0 !important;
  margin-bottom: 0 !important;
}
body[data-rmc-shell-main="control-plane"] .rmc-os-status-stack:not(:has(.rmc-offline-sync-bar:not(.d-none))):not(:has(.rmc-os-payment-readiness-slot:not([hidden]) *)) {
  display: none !important;
}
/* The page-body band carried a 16px top margin above the first card. */
body[data-rmc-shell-main="control-plane"] .cp-page-body,
body[data-rmc-host-kind="manager"]:not(.marketing-surface) .cp-page-body {
  margin-top: 0 !important;
  padding-top: 2px !important;
}
/* Empty breadcrumb/page-header wrapper (height 0 on landing) — no margin. */
body[data-rmc-shell-main="control-plane"] .cp-page-header:empty {
  margin: 0 !important;
}

/* ------------------------------------------------------------------
   /admin/ BACKOFFICE top-gap (measured: header 114 → content 218 = 104px).
   The Unfold breadcrumb carries a 16px top margin (the earlier rule only
   tightened its bottom) and the admin page-body adds top padding. Same
   push-up intent as the control-plane landing, applied to the admin shell
   so the reclaim is truly platform-wide across manager.runmycampus.com.
   ------------------------------------------------------------------ */
body.admin-manager-shell .rmc-admin-breadcrumb-nav {
  margin-top: 2px !important;
}
body.admin-manager-shell .cp-admin-page-body,
body.admin-manager-shell .cp-page-body {
  padding-top: 2px !important;
}
body.admin-manager-shell #cp-main-content {
  padding-top: 4px !important;
}
