﻿/**
 * Inner-page beauty layer â€” all authenticated surfaces inherit landing polish.
 * v3.62.12 (2026-05-22). Composes with design-tokens-personality.css per slug.
 */

/* === Control plane /super/ inner canvas ================================= */
body.control-plane-shell .cp-page-body,
body.control-plane-shell [data-rmc-cp-page-body="1"] {
  padding-top: 0.25rem;
}

/* Collapse dead vertical bands under breadcrumb-only headers */
body.control-plane-shell .cp-page-body > .container-fluid:empty,
body.control-plane-shell .cp-page-body > .w-100:empty,
body.admin-manager-shell .cp-admin-page-body > .w-100:empty {
  display: none;
  min-height: 0;
  padding: 0;
  margin: 0;
}

body.control-plane-shell .rmc-os-page-header:only-child,
body.admin-manager-shell .rmc-admin-breadcrumb-nav:only-child {
  margin-bottom: 0.25rem;
}

body.control-plane-shell .cp-page-body .breadcrumb + .container-fluid {
  margin-top: 0;
  padding-top: 0.5rem;
}

body.control-plane-shell .cp-page-body .card,
body.control-plane-shell .cp-page-body .page-family-content-card,
body.control-plane-shell .rmc-os-page-header,
body.control-plane-shell .rmc-data-table-wrap {
  border-radius: var(--radius-lg, 16px);
}

body.control-plane-shell .rmc-os-page-header__title,
body.control-plane-shell .cp-page-body > .container-fluid > h1,
body.control-plane-shell .cp-page-body h1.h5 {
  font-family: var(--serif, "Source Serif 4", Georgia, serif);
  font-weight: 500;
  letter-spacing: -0.01em;
}

body.control-plane-shell .breadcrumb {
  font-size: 12px;
}

body.control-plane-shell .table {
  font-size: 13px;
}

body.control-plane-shell .table thead th {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-tertiary);
}

/* === Manager /admin/ inner (non-index) ================================ */
body.admin-manager-shell:not([data-rmc-admin-index-v200x="1"]) .cp-admin-page-body .card,
body.admin-manager-shell:not([data-rmc-admin-index-v200x="1"]) .rmc-admin-catalog-section {
  border-radius: var(--radius-lg, 16px);
  box-shadow: var(--elev-1);
}

body.admin-manager-shell .rmc-os-page-header__title {
  font-family: var(--serif, "Source Serif 4", Georgia, serif);
}

/* === Tenant portal inner (backoffice / parent / teacher / student) === */
body.portal-body-with-layout:not(.control-plane-shell) .portal-page-body,
body.portal-body-with-layout:not(.control-plane-shell) [data-rmc-portal-page-body="1"] {
  padding-top: 0.5rem;
}

body.portal-body-with-layout:not(.control-plane-shell) .portal-page-body .card,
body.portal-body-with-layout:not(.control-plane-shell) .portal-stat-card,
body.portal-body-with-layout:not(.control-plane-shell) .page-family-content-card {
  border-radius: var(--radius-lg, 16px);
  border: 1px solid var(--hairline);
  box-shadow: var(--elev-1);
}

body.portal-body-with-layout:not(.control-plane-shell) .rmc-os-page-header__title,
body.portal-body-with-layout:not(.control-plane-shell) .portal-page-body h1,
body.portal-body-with-layout:not(.control-plane-shell) .section-title {
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text-primary);
}

body.portal-body-with-layout:not(.control-plane-shell) .section-title {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-tertiary);
  gap: 8px;
}

/* Personality accent bridges (tabs, primary buttons) */
body[data-rmc-page-personality] .btn-primary,
body[data-rmc-page-personality] .cp-btn--primary {
  /* White label: several personality gradients end in a 300-400 shade
     (#53ab45 under "Open invoices" measured 2.33:1). A chrome-ink veil over
     the gradient keeps each personality's hue and gives the label its ground. */
  background:
    linear-gradient(color-mix(in srgb, var(--cp-chrome-bg) 45%, transparent), color-mix(in srgb, var(--cp-chrome-bg) 45%, transparent)),
    var(--personality-gradient, linear-gradient(135deg, #4f46e5, #7c3aed));
  --luxury-text: var(--text-on-brand);
  border-color: transparent;
}

body[data-rmc-page-personality="parent"] .btn-primary,
body[data-rmc-page-personality="teacher"] .btn-primary,
body[data-rmc-page-personality="student"] .btn-primary,
body[data-rmc-page-personality="tenant-admin"] .btn-primary {
  background: var(--school-gradient, linear-gradient(color-mix(in srgb, var(--cp-chrome-bg) 45%, transparent), color-mix(in srgb, var(--cp-chrome-bg) 45%, transparent)), var(--personality-gradient));
}

/* Page fold nav */
.rmc-page-fold-nav a {
  border-radius: var(--radius-pill, 999px);
  padding: 6px 14px;
  font-size: 12.5px;
  font-weight: 600;
  border: 1px solid var(--hairline-strong, var(--hairline));
  background: var(--surface-elevated);
  color: var(--text-secondary);
  text-decoration: none;
}

.rmc-page-fold-nav a.active,
.rmc-page-fold-nav a.is-active {
  background: var(--personality-gradient, linear-gradient(135deg, #4f46e5, #7c3aed));
  color: #fff; /* off-token-allow: fixed-shell-accent */
  border-color: transparent;
  text-decoration: none;
}

/* Click safety on all shells */
body.control-plane-shell a,
body.control-plane-shell button,
body.admin-manager-shell a,
body.admin-manager-shell button,
body.portal-body-with-layout a,
body.portal-body-with-layout button {
  pointer-events: auto;
}

/* v8 200x inner-page h1 row (preview_app_shell_manager_v8_200x) */
body.control-plane-shell .cp-page-h1-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 1rem;
}

body.control-plane-shell .cp-page-h1-row__copy {
  flex: 1 1 16rem;
  min-width: 0;
}

body.control-plane-shell .cp-page-h1-row__actions {
  flex: 0 1 auto;
  min-width: 0;
}

body.admin-manager-shell .cp-page-h1-row__copy,
body.admin-manager-shell .cp-page-h1-row__actions {
  min-width: 0;
}

body.control-plane-shell .cp-page-h1 {
  font-size: var(--type-size-2xl, 1.5rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

body.control-plane-shell .cp-page-h1-sub {
  font-size: var(--type-size-sm, 0.875rem);
  color: var(--text-secondary);
  margin-top: 0.25rem;
}

body.control-plane-shell .cp-sidebar__group-label {
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* Balanced rail layouts: operator and tenant pages with a primary work area plus a utility rail. */
body.control-plane-shell #cp-main-content [data-rmc-balanced-layout$="-rail"],
body.control-plane-shell .cp-page-body [data-rmc-balanced-layout$="-rail"],
body.admin-manager-shell .cp-admin-page-body [data-rmc-balanced-layout$="-rail"],
body.portal-body-with-layout:not(.control-plane-shell) .portal-page-body [data-rmc-balanced-layout$="-rail"],
body.portal-body-with-layout:not(.control-plane-shell) #main-content [data-rmc-balanced-layout$="-rail"] {
  display: grid !important;
  grid-template-columns: minmax(0, 1.55fr) minmax(min(100%, 24rem), 0.85fr);
  gap: clamp(0.85rem, 1.1vw, 1.25rem);
  align-items: start;
  width: 100%;
}

body.control-plane-shell [data-rmc-balanced-layout$="-rail"] > [class*="col-"],
body.admin-manager-shell [data-rmc-balanced-layout$="-rail"] > [class*="col-"],
body.portal-body-with-layout:not(.control-plane-shell) [data-rmc-balanced-layout$="-rail"] > [class*="col-"] {
  width: auto !important;
  max-width: none !important;
  min-width: 0;
  padding-left: 0 !important;
  padding-right: 0 !important;
}

body.control-plane-shell [data-rmc-balanced-layout$="-rail"] > [data-dashboard-column="main"],
body.admin-manager-shell [data-rmc-balanced-layout$="-rail"] > [data-dashboard-column="main"],
body.portal-body-with-layout:not(.control-plane-shell) [data-rmc-balanced-layout$="-rail"] > [data-dashboard-column="main"] {
  min-width: min(100%, 34rem);
}

body.control-plane-shell [data-rmc-balanced-layout$="-rail"] > [data-dashboard-column="rail"],
body.admin-manager-shell [data-rmc-balanced-layout$="-rail"] > [data-dashboard-column="rail"],
body.portal-body-with-layout:not(.control-plane-shell) [data-rmc-balanced-layout$="-rail"] > [data-dashboard-column="rail"] {
  min-width: 0;
}

body.control-plane-shell [data-rmc-balanced-layout="operator-detail-rail"] {
  grid-template-columns: minmax(0, 1.72fr) minmax(min(100%, 23rem), 0.78fr);
}

/* A rail written FIRST (e.g. the /super/migration/ connector list) sits narrow on
   the left; without this it took the wide track and squeezed the detail column. */
@media (min-width: 992px) {
  body.control-plane-shell :is(#cp-main-content, .cp-page-body) [data-rmc-balanced-layout="operator-detail-rail"]:has(> [data-dashboard-column="rail"]:first-child) {
    grid-template-columns: minmax(min(100%, 23rem), 0.78fr) minmax(0, 1.72fr);
  }
}

body.control-plane-shell [data-rmc-balanced-layout="operator-form-rail"] {
  grid-template-columns: minmax(0, 1.38fr) minmax(min(100%, 25rem), 0.92fr);
}

body.portal-body-with-layout:not(.control-plane-shell) [data-rmc-balanced-layout="tenant-dashboard-rail"] {
  grid-template-columns: minmax(0, 1.62fr) minmax(min(100%, 23rem), 0.82fr);
}

body.portal-body-with-layout:not(.control-plane-shell) [data-rmc-balanced-layout="tenant-dashboard-rail"] .parent-sidebar-cards,
body.control-plane-shell [data-rmc-balanced-layout$="-rail"] > [data-dashboard-column="rail"] {
  display: flex;
  flex-direction: column;
  gap: clamp(0.75rem, 1vw, 1rem);
}

body.portal-body-with-layout:not(.control-plane-shell) [data-rmc-balanced-layout="tenant-dashboard-rail"] .sidebar-sticky {
  position: sticky;
  top: calc(var(--portal-header-height, 72px) + 1rem);
}

@media (max-height: 760px) {
  body.portal-body-with-layout:not(.control-plane-shell) [data-rmc-balanced-layout="tenant-dashboard-rail"] .sidebar-sticky {
    position: static;
  }
}

@media (max-width: 1199.98px) and (min-width: 992px) {
  body.portal-body-with-layout:not(.control-plane-shell) .portal-page-body [data-rmc-balanced-layout="tenant-dashboard-rail"],
  body.portal-body-with-layout:not(.control-plane-shell) #main-content [data-rmc-balanced-layout="tenant-dashboard-rail"] {
    grid-template-columns: minmax(0, 1fr);
  }

  body.portal-body-with-layout:not(.control-plane-shell) [data-rmc-balanced-layout="tenant-dashboard-rail"] > [data-dashboard-column="main"] {
    min-width: 0;
  }

  body.portal-body-with-layout:not(.control-plane-shell) [data-rmc-balanced-layout="tenant-dashboard-rail"] .parent-sidebar-cards,
  body.portal-body-with-layout:not(.control-plane-shell) [data-rmc-balanced-layout="tenant-dashboard-rail"] > [data-dashboard-column="rail"] {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: clamp(0.75rem, 1vw, 1rem);
  }

  body.portal-body-with-layout:not(.control-plane-shell) [data-rmc-balanced-layout="tenant-dashboard-rail"] .sidebar-sticky {
    position: static;
  }
}

@media (max-width: 991.98px) {
  body.control-plane-shell #cp-main-content [data-rmc-balanced-layout$="-rail"],
  body.control-plane-shell .cp-page-body [data-rmc-balanced-layout$="-rail"],
  body.admin-manager-shell .cp-admin-page-body [data-rmc-balanced-layout$="-rail"],
  body.portal-body-with-layout:not(.control-plane-shell) .portal-page-body [data-rmc-balanced-layout$="-rail"],
  body.portal-body-with-layout:not(.control-plane-shell) #main-content [data-rmc-balanced-layout$="-rail"] {
    grid-template-columns: minmax(0, 1fr);
  }

  body.control-plane-shell [data-rmc-balanced-layout$="-rail"] > [data-dashboard-column="main"],
  body.admin-manager-shell [data-rmc-balanced-layout$="-rail"] > [data-dashboard-column="main"],
  body.portal-body-with-layout:not(.control-plane-shell) [data-rmc-balanced-layout$="-rail"] > [data-dashboard-column="main"] {
    min-width: 0;
  }

  body.portal-body-with-layout:not(.control-plane-shell) [data-rmc-balanced-layout="tenant-dashboard-rail"] .parent-sidebar-cards,
  body.portal-body-with-layout:not(.control-plane-shell) [data-rmc-balanced-layout="tenant-dashboard-rail"] > [data-dashboard-column="rail"] {
    display: flex;
    flex-direction: column;
    grid-template-columns: none;
  }
}
