/* Remove duplicated module chrome without changing the individual tab panels. */
.staff-clients-page:has(> main) {
  display: flex;
  flex-direction: column;
  overflow: clip;
}
.staff-clients-page:has(> main) > main {
  display: flex;
  flex-direction: column;
  width: 100%;
  padding-block: 8px 0;
  gap: 10px;
}
.staff-clients-page:has(> main) > main > * {
  margin-block: 0;
}
.staff-clients-page > main > .staff-clients-summary,
.staff-clients-page > main > .staff-clients-account > span {
  display: none;
}
.staff-clients-page:has(> main) > main > .staff-clients-account {
  order: 4;
}
.staff-clients-page:has(> main) > main > .sd-assistant-entry {
  order: 5;
}
.staff-clients-page:has(> main) > button[aria-label="Salir de la cuenta"] {
  position: static;
  order: 5;
  align-self: flex-end;
  margin: 4px max(12px,calc((100% - 80rem)/2 + 18px)) 12px;
}
.staff-clients-page .crm-web-module[data-view="network"]:has(.nv-live-dashboard) > .client-module-tabs {
  margin-block-start: 0;
}
.staff-clients-page .crm-web-module[data-view="network"]:has(.nv-live-dashboard) > .client-module-tabs > button {
  min-height: 44px;
}

/* Staff settings: put its navigation first. Keep Back, NueBot and Sign out. */
.staff-module-page:has(> main > .mg-settings) > main {
  display: grid;
  grid-template-columns: minmax(0,1fr) auto;
  align-items: center;
  padding-block-start: 8px;
  gap: 8px;
}
.staff-module-page:has(> main > .mg-settings) > main > * {
  grid-column: 1 / -1;
  margin-block: 0;
}
.staff-module-page:has(> main > .mg-settings) > main > .sd-assistant-entry {
  grid-area: 1 / 2;
}
.staff-module-page:has(> main > .mg-settings) > main > :has(> .mg-back) {
  grid-area: 1 / 1;
  display: flex;
  justify-content: flex-start;
}
.staff-module-page:has(> main > .mg-settings) > main > :has(> .mg-back) > span,
.staff-module-page:has(> main > .mg-settings) > main > .staff-module-summary {
  display: none;
}
.staff-module-page:has(> main > .mg-settings) :is(.mg-back,.sd-assistant-launcher) {
  min-block-size: 44px;
}
@media (min-width:1024px) {
  .staff-module-page:has(> main > .mg-settings) > main > .sd-assistant-entry { margin-inline-end: 82px; }
  .staff-module-page:has(> main > .mg-settings) > button[aria-label="Salir de la cuenta"] {
    inset-block-start: 8px;
    inset-inline-end: max(24px,calc((100% - 80rem)/2 + 24px));
    min-block-size: 44px;
  }
}

/* Portal: use the same compact shell for every Red view, even during loading. */
body[data-portal-authenticated="true"]:not([data-order-link="true"]) .customer-shell:has(#account:not([hidden]) > #channel-section:not([hidden])) > :is(.portal-header,.portal-entry) {
  display: none;
}
body[data-portal-authenticated="true"]:not([data-order-link="true"]) .customer-shell:has(#account:not([hidden]) > #channel-section:not([hidden])) {
  padding-block-start: 8px;
}
body[data-portal-authenticated="true"]:not([data-order-link="true"]) #account:not([hidden]):has(> #channel-section:not([hidden])) {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-block-start: 0;
  padding-block-start: 0;
}
body[data-portal-authenticated="true"]:not([data-order-link="true"]) #account:has(> #channel-section:not([hidden])) > .account-heading {
  display: flex;
  flex-direction: column;
  gap: 8px;
  order: 4;
  margin-block: 0;
}
body[data-portal-authenticated="true"]:not([data-order-link="true"]) #account:has(> #channel-section:not([hidden])) :is(#welcome,#channel-section > .page-heading) {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  padding: 0;
  margin: -1px;
  clip-path: inset(50%);
  overflow: hidden;
  white-space: nowrap;
}
body[data-portal-authenticated="true"]:not([data-order-link="true"]) #account:has(> #channel-section:not([hidden])) > .account-heading > #account-nav {
  order: -1;
  margin-block-start: 0;
}
body[data-portal-authenticated="true"]:not([data-order-link="true"]) #account > #channel-section:not([hidden]) {
  order: 0;
  margin: 0;
  padding: 0;
}
#channel-status:empty { display: none; }

/* Reuse the Nuevita loading mark, without a sign-in message on normal transitions.
   Do not expose protected content through the privacy cover while it is locked. */
.nv-session-cover[data-nv-spinner-only] {
  display: grid;
  place-content: center;
}
.nv-session-cover[data-nv-spinner-only] > :is(strong,p) {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.nv-session-cover[data-nv-spinner-only]::after,
[data-nv-inline-spinner]::after {
  content: "";
  grid-area: 1 / 1;
  inline-size: 2.3rem;
  aspect-ratio: 1;
  align-self: center;
  justify-self: center;
  background: url("/favicon.png") center / contain no-repeat;
}
.nv-session-cover[data-nv-spinner-only]::before,
[data-nv-inline-spinner]::before {
  content: "";
  box-sizing: border-box;
  grid-area: 1 / 1;
  inline-size: 3.5rem;
  aspect-ratio: 1;
  border: 2px solid currentColor;
  border-inline-start-color: transparent;
  border-radius: 50%;
  animation: nuevita-loading-spin .85s linear infinite;
}
[data-nv-inline-spinner]:not([hidden]) {
  display: grid;
  grid-template: auto / auto;
  place-content: center;
  font-size: 0;
  color: var(--forest-deep,#173428);
  padding-block: 8px;
}
[data-nv-inline-spinner]::before,
[data-nv-inline-spinner]::after {
  grid-area: 1 / 1;
}
.staff-module-page > main > .nuevita-loading {
  position: relative;
  inset: auto;
  z-index: auto;
  grid-template-columns: 1fr;
  min-block-size: 5rem;
  background: none;
  color: inherit;
}
.staff-module-page > main > .nuevita-loading::before {
  border-inline-start-color: transparent;
}
@media (prefers-reduced-motion: reduce) {
  .nv-session-cover[data-nv-spinner-only]::before,
  [data-nv-inline-spinner]::before { animation: none; }
}

/* Once inside a Red tab, let its own title and controls lead the view. */
:is(.staff-clients-page,#channel-section) .nv-live-workspace:not([data-live-tab="overview"]) .nv-live-title {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  padding: 0;
  margin: -1px;
  clip-path: inset(50%);
  overflow: hidden;
  white-space: nowrap;
}
:is(.staff-clients-page,#channel-section) .nv-live-workspace:not([data-live-tab="overview"]) .channel-nav {
  display: flex;
  flex-wrap: wrap;
  gap: .28rem;
}
:is(.staff-clients-page,#channel-section) .nv-live-workspace:not([data-live-tab="overview"]) .channel-nav > button {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  min-block-size: 44px;
  padding-inline: .42rem;
  font-size: .84rem;
}
:is(.staff-clients-page,#channel-section) .nv-live-workspace:not([data-live-tab="overview"]) .channel-nav > button > svg {
  flex-shrink: 0;
  inline-size: 1rem;
  block-size: 1rem;
}
:is(.staff-clients-page,#channel-section) .nv-live-workspace:not([data-live-tab="overview"]) .channel-mobile-nav {
  display: none;
}
@media(max-width: 640px) {
  :is(.staff-clients-page,#channel-section) .nv-live-workspace:not([data-live-tab="overview"]) .channel-nav { display: none; }
  :is(.staff-clients-page,#channel-section) .nv-live-workspace:not([data-live-tab="overview"]) .channel-mobile-nav {
    display: grid;
    gap: .28rem;
    align-items: center;
    margin: 0;
    font-size: .85rem;
    color: inherit;
  }
  :is(.staff-clients-page,#channel-section) .nv-live-workspace:not([data-live-tab="overview"]) .channel-mobile-nav select {
    min-block-size: 44px;
    width: 100%;
    font-size: 1rem;
  }
}
/* Override legacy Tailwind sibling margins, which otherwise add 24 px
   even to the first visible panel after the removed header. */
:is(.staff-clients-page,.staff-module-page:has(> main > .mg-settings)) > main.space-y-6 > :not([hidden]) ~ :not([hidden]) {
  margin-top: 0;
  margin-bottom: 0;
}
.staff-module-page > main > .mg-settings { gap: .75rem; }
