@layer layout {
  .cx-shell {
    --cx-sidebar-width: 352px;
    min-height: 100vh;
    display: grid;
    grid-template-columns: var(--cx-sidebar-width) minmax(0, 1fr);
    transition: grid-template-columns 220ms ease;}

  .cx-shell[data-sidebar-state="hidden"] {
    grid-template-columns: 0 minmax(0, 1fr);
  }

  .cx-sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 1.15rem;
    overflow: auto;
    backdrop-filter: blur(18px);
    transition:
      opacity 180ms ease,
      transform 220ms ease,
      padding 220ms ease,
      border-color 180ms ease,
      inline-size 220ms ease;}

  .cx-shell[data-sidebar-state="hidden"] .cx-sidebar {
    inline-size: 0;
    padding-inline: 0;
    opacity: 0;
    pointer-events: none;
    overflow: hidden;
    border-inline-end-color: transparent;
    transform: translateX(1.25rem);
  }

  .cx-brand-block {
    display: flex;
    padding: var(--cx-space-3);
    border-radius: var(--cx-radius-lg);
    border: 1px solid color-mix(in srgb, var(--cx-brand-secondary) 12%, transparent);
    box-shadow: 0 10px 28px color-mix(in srgb, var(--cx-brand-secondary) 6%, transparent);}

  .cx-brand-mark {
    inline-size: 46px;
    block-size: 46px;
    display: grid;
    place-items: center;
    border-radius: 16px;
    font-weight: 800;
    box-shadow: var(--cx-shadow-soft);}

  .cx-nav {
    display: grid;
    align-content: start;
    gap: .35rem;
    padding: .35rem .2rem 1.25rem;
  }

  .cx-nav-group {
    display: grid;
    gap: .18rem;
    padding: .22rem 0 .34rem;
    border: 0;
    border-radius: 0;
    background: transparent;
    border-block-end: 1px solid color-mix(in srgb, var(--cx-brand-secondary) 8%, transparent);
    transition: background var(--cx-transition);
  }

  .cx-nav-group:last-child { border-block-end: 0; }

  .cx-nav-group[data-open="true"] {
    background: transparent;
  }

  .cx-nav-group-title {
    width: 100%;
    border: 0;
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .65rem;
    font: inherit;
    font-size: .94rem;
    font-weight: 900;
    padding: .72rem .78rem;
    border-radius: .9rem;
    cursor: pointer;
    text-align: start;
    transition: background var(--cx-transition), color var(--cx-transition), transform var(--cx-transition);}

  .cx-nav-group-main {
    display: inline-flex;
    align-items: center;
    gap: .58rem;
    min-width: 0;
  }

  .cx-nav-group-icon {
    inline-size: 1.7rem;
    display: inline-grid;
    place-items: center;
    flex: 0 0 auto;
  }

  .cx-nav-group-caret {
    inline-size: 1.65rem;
    block-size: 1.65rem;
    border-radius: 999px;
    display: inline-grid;
    place-items: center;
    transition: transform 180ms ease, background var(--cx-transition), color var(--cx-transition);}

  .cx-nav-group[data-open="true"] .cx-nav-group-caret {
    transform: rotate(180deg);
    color: var(--cx-brand-strong);
    background: var(--cx-brand-soft);
  }

  .cx-nav-group-pages {
    display: grid;
    gap: .24rem;
    padding: .08rem .28rem .32rem .12rem;
  }

  .cx-nav-group-pages[hidden] {
    display: none !important;
  }

  .cx-nav-link {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: .7rem;
    padding: .86rem 1rem;
    border-radius: .88rem;
    border: 1px solid transparent;
    background: transparent;
    transition: background var(--cx-transition), color var(--cx-transition), transform var(--cx-transition), border-color var(--cx-transition), box-shadow var(--cx-transition);}

  .cx-nav-link-label {
    display: inline-flex;
    align-items: center;
    min-width: 0;
    gap: .58rem;
    font-size: .95rem;
    font-weight: 780;
    flex: 1 1 auto;
  }

  .cx-nav-link-text {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.35;
  }

  .cx-nav-link:hover {
    transform: translateX(-2px);}

  .cx-nav-link[aria-current="page"]::after,
  .cx-nav-link.is-active::after {
    content: '';
    inline-size: .48rem;
    block-size: .48rem;
    border-radius: 999px;
    position: absolute;
    inset-inline-start: .56rem;
    top: 50%;
    transform: translateY(-50%);}

  .cx-nav-icon {
    display: inline-flex;
    inline-size: 1.55rem;
    justify-content: center;
    flex: 0 0 auto;
  }
  .cx-nav-icon-modern { display: none; }
  .cx-nav-icon-legacy { display: inline; }
  .cx-nav-chevron-modern { display: none; }
  .cx-nav-chevron-legacy { display: inline; }
  .cx-sidebar-toggle-icon-modern { display: none; }
  .cx-sidebar-toggle-icon-legacy { display: inline; }

  .cx-nav-link small {
    color: var(--cx-muted);
    font-size: .68rem;
    font-weight: 900;
    white-space: nowrap;
    border-radius: 999px;
    padding: .12rem .44rem;
    background: rgba(16, 42, 45, .045);
  }

  .cx-nav-link[aria-current="page"] small,
  .cx-nav-link.is-active small {
    color: var(--cx-brand-strong);
    background: color-mix(in srgb, var(--cx-brand-secondary) 10%, transparent);
  }



  .cx-nav-link small,
  .cx-nav-status,
  .cx-nav-marker {
    display: none !important;
  }

  .cx-main {
    min-width: 0;
    display: grid;
    grid-template-rows: var(--cx-topbar-height) minmax(0, 1fr);
  }

  .cx-topbar {
    position: sticky;
    top: 0;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--cx-space-4);
    padding: 0 var(--cx-space-6);
    border-block-end: 1px solid var(--cx-border);
    backdrop-filter: blur(18px);}

  .cx-topbar-start {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: .8rem;
  }

  .cx-sidebar-toggle {
    position: relative;
    flex: 0 0 auto;
    min-height: 2.55rem;
    padding-inline: .78rem 1rem;
    border-color: color-mix(in srgb, var(--cx-brand-secondary) 18%, transparent) !important;
    background: rgba(255, 255, 255, .72) !important;
    box-shadow: 0 8px 22px color-mix(in srgb, var(--cx-brand-secondary) 8%, transparent);
  }

  .cx-sidebar-toggle:hover {
    background: var(--cx-brand-soft) !important;
    color: var(--cx-brand-strong) !important;
  }

  .cx-sidebar-toggle-icon {
    font-size: 1.12rem;
    line-height: 1;
  }

  .cx-shell[data-sidebar-state="hidden"] .cx-sidebar-toggle {
    border-color: rgba(15, 118, 110, .28) !important;
    background: rgba(236, 253, 245, .90) !important;}

  .cx-topbar-title-block {
    display: grid;
    gap: .18rem;
    min-width: 0;
  }

  .cx-topbar-title-block strong {
    color: var(--cx-ink);
    font-size: 1.03rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .cx-topbar-actions {
    justify-content: flex-end;
  }

  .cx-shell-owner-pill {
    max-width: 210px;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .cx-content {
    min-width: 0;
    padding: var(--cx-space-6);
    transition: padding 180ms ease;
  }

  @media (max-width: 960px) {
    .cx-shell,
    .cx-shell[data-sidebar-state="hidden"] {
      grid-template-columns: 1fr;
    }

    .cx-sidebar {
      position: fixed;
      z-index: 40;
      inset-block: 0;
      inset-inline-start: 0;
      inline-size: min(92vw, 360px);
      height: 100vh;
      box-shadow: -18px 0 42px rgba(16, 42, 45, .18);
      transform: translateX(0);
    }

    .cx-shell[data-sidebar-state="hidden"] .cx-sidebar {
      inline-size: min(92vw, 360px);
      padding: var(--cx-space-5);
      opacity: 0;
      pointer-events: none;
      transform: translateX(110%);
      border-inline-end-color: transparent;
    }

    .cx-topbar {
      min-height: var(--cx-topbar-height);
      height: auto;
      flex-direction: column;
      align-items: stretch;
      padding: var(--cx-space-4);
    }

    .cx-topbar-start {
      width: 100%;
      justify-content: space-between;
    }

    .cx-topbar-actions {
      justify-content: stretch;
    }

    .cx-main { grid-template-rows: auto minmax(0, 1fr); }
  }

  @media (max-width: 620px) {
    .cx-sidebar-toggle [data-sidebar-toggle-text] { display: none; }
    .cx-content { padding: var(--cx-space-4); }
    .cx-topbar-title-block strong { font-size: .96rem; }
  }
}

@layer layout {
  .cx-shell-session-card {
    border: 1px solid color-mix(in srgb, var(--cx-brand-secondary) 10%, transparent);
    border-radius: var(--cx-radius-lg);
    padding: .9rem 1rem;
    display: grid;
    gap: .2rem;}
  .cx-shell-session-card strong {
    font-size: .96rem;}
  .cx-shell-session-label {
    color: var(--cx-muted);
    font-size: .72rem;
    font-weight: 900;
    letter-spacing: .02em;
  }

  .cx-auth-page {
    min-height: calc(100vh - var(--cx-topbar-height) - 2 * var(--cx-space-6));
    display: grid;
    grid-template-columns: minmax(0, .9fr) minmax(320px, 460px);
    gap: var(--cx-space-6);
    align-items: center;
  }
  .cx-auth-hero {
    border-radius: calc(var(--cx-radius-lg) + .4rem);
    background:
      radial-gradient(circle at top right, color-mix(in srgb, var(--cx-brand-secondary) 18%, transparent), transparent 24rem),
      linear-gradient(135deg, rgba(236,253,245,.92), rgba(255,255,255,.76));
    border: 1px solid color-mix(in srgb, var(--cx-brand-secondary) 14%, transparent);
    box-shadow: var(--cx-shadow-soft);
    padding: clamp(1.25rem, 4vw, 2.6rem);
    display: grid;
    gap: .8rem;
  }
  .cx-auth-hero h1 {
    margin: 0;
    color: var(--cx-ink);
    font-size: clamp(2rem, 5vw, 3.25rem);
  }
  .cx-auth-hero p {
    margin: 0;
    color: var(--cx-muted);
    max-width: 48ch;
    line-height: 1.85;
    font-weight: 750;
  }
  .cx-auth-brand-mark { inline-size: 58px; block-size: 58px; font-size: 1.25rem; }
  .cx-auth-panel { align-self: center; box-shadow: 0 18px 42px rgba(15,42,45,.09); }
  .cx-auth-owner {
    color: var(--cx-muted);
    background: color-mix(in srgb, var(--cx-brand-secondary) 8%, transparent);
    border-radius: 999px;
    padding: .28rem .65rem;
    font-size: .74rem;
    font-weight: 900;
  }
  .cx-password-field {
    position: relative;
    display: block;
  }
  .cx-password-field .cx-input { padding-inline-end: 4.9rem; }
  [dir="rtl"] .cx-password-field .cx-input { padding-inline-end: .85rem; padding-inline-start: 4.9rem; }
  .cx-password-toggle {
    position: absolute;
    inset-inline-end: .42rem;
    top: 50%;
    transform: translateY(-50%);
    border: 0;
    border-radius: 999px;
    background: color-mix(in srgb, var(--cx-brand-secondary) 9%, transparent);
    color: var(--cx-brand-strong);
    padding: .35rem .7rem;
    font-weight: 900;
    cursor: pointer;
  }
  [dir="rtl"] .cx-password-toggle { inset-inline-end: auto; inset-inline-start: .42rem; }
  .cx-password-toggle:hover { background: color-mix(in srgb, var(--cx-brand-secondary) 16%, transparent); }

  @media (max-width: 960px) {
    .cx-auth-page { grid-template-columns: 1fr; align-items: stretch; }
    .cx-auth-hero { min-height: auto; }
  }
  @media (max-width: 620px) {
    .cx-auth-page { min-height: auto; gap: var(--cx-space-4); }
    .cx-auth-hero, .cx-auth-panel { border-radius: var(--cx-radius-lg); }
  }
}

/* Costix Shell V2 — canonical tenant Sidebar + Topbar.
   Scope: global shell only. No page content, route permission, polling or business ownership changes. */
@layer layout {
  .cx-shell[data-ui-skin="backoffice"][data-shell-mode="tenant_app"] {
    --cx-sidebar-width: 276px;
    --cx-shell-rail-width: 76px;
    --cx-topbar-height: 64px;
    --cx-shell-motion-fast: 140ms;
    --cx-shell-motion-base: 190ms;
    --cx-shell-motion-panel: 240ms;
    --cx-shell-motion-ease: cubic-bezier(.2,.8,.2,1);
    grid-template-columns: var(--cx-sidebar-width) minmax(0, 1fr);
    background:
      radial-gradient(circle at 84% 0%, rgba(91,26,163,.045), transparent 31rem),
      var(--cx-bg);
    transition: grid-template-columns var(--cx-shell-motion-panel) var(--cx-shell-motion-ease);
  }

  .cx-shell[data-ui-skin="backoffice"][data-shell-mode="tenant_app"] .cx-main {
    min-width: 0;
    background: transparent;
  }

  /* Sidebar: neutral surface first, brand color only as accent. */
  .cx-shell[data-ui-skin="backoffice"][data-shell-mode="tenant_app"] .cx-sidebar {
    position: sticky;
    top: 0;
    height: 100dvh;
    gap: .62rem;
    padding: .82rem .72rem;
    color: var(--cx-text);
    background:
      linear-gradient(180deg, rgba(255,255,255,.985), rgba(249,247,253,.985)),
      var(--cx-surface);
    border-inline-end: 1px solid rgba(36,16,102,.10);
    box-shadow: -8px 0 28px rgba(36,16,102,.045);
    backdrop-filter: none;
    scrollbar-width: thin;
    scrollbar-color: rgba(91,26,163,.22) transparent;
    transition:
      transform var(--cx-shell-motion-panel) var(--cx-shell-motion-ease),
      opacity var(--cx-shell-motion-base) var(--cx-shell-motion-ease),
      padding var(--cx-shell-motion-panel) var(--cx-shell-motion-ease),
      border-color var(--cx-shell-motion-base) ease;
  }
  [dir="rtl"] .cx-shell[data-ui-skin="backoffice"][data-shell-mode="tenant_app"] .cx-sidebar {
    box-shadow: -8px 0 28px rgba(36,16,102,.045);
  }
  .cx-shell[data-ui-skin="backoffice"][data-shell-mode="tenant_app"] .cx-sidebar::-webkit-scrollbar { inline-size: 7px; }
  .cx-shell[data-ui-skin="backoffice"][data-shell-mode="tenant_app"] .cx-sidebar::-webkit-scrollbar-thumb {
    border-radius: 999px;
    background: rgba(91,26,163,.18);
    border: 2px solid transparent;
    background-clip: padding-box;
  }

  .cx-shell[data-ui-skin="backoffice"][data-shell-mode="tenant_app"] .cx-brand-block {
    min-height: 62px;
    align-items: center;
    gap: .68rem;
    padding: .58rem .62rem;
    border: 0;
    border-radius: 14px;
    background: transparent;
    box-shadow: none;
  }
  .cx-shell[data-ui-skin="backoffice"][data-shell-mode="tenant_app"] .cx-brand-logo {
    inline-size: 42px;
    block-size: 42px;
    object-fit: contain;
    border-radius: 12px;
    padding: .24rem;
    background: #fff;
    box-shadow: 0 7px 18px rgba(36,16,102,.10);
    flex: 0 0 auto;
  }
  .cx-shell[data-ui-skin="backoffice"][data-shell-mode="tenant_app"] .cx-brand-logo-mark { display: none; }
  .cx-shell[data-ui-skin="backoffice"][data-shell-mode="tenant_app"] .cx-brand-copy {
    display: grid;
    gap: .08rem;
    min-width: 0;
  }
  .cx-shell[data-ui-skin="backoffice"][data-shell-mode="tenant_app"] .cx-brand-copy strong {
    color: var(--cx-brand-primary);
    font-size: 1.03rem;
    font-weight: 900;
    letter-spacing: -.01em;
  }
  .cx-shell[data-ui-skin="backoffice"][data-shell-mode="tenant_app"] .cx-brand-copy .cx-help {
    color: var(--cx-muted);
    font-size: .68rem;
    font-weight: 750;
  }

  .cx-shell[data-ui-skin="backoffice"][data-shell-mode="tenant_app"] .cx-shell-company-card {
    display: flex;
    align-items: center;
    gap: .45rem;
    min-height: 34px;
    padding: .28rem .68rem .58rem;
    border: 0;
    border-block-end: 1px solid rgba(36,16,102,.08);
    border-radius: 0;
    background: transparent;
    box-shadow: none;
  }
  .cx-shell[data-ui-skin="backoffice"][data-shell-mode="tenant_app"] .cx-shell-company-card .cx-shell-session-label {
    color: #968ca3;
    font-size: .66rem;
  }
  .cx-shell[data-ui-skin="backoffice"][data-shell-mode="tenant_app"] .cx-shell-company-card strong {
    min-width: 0;
    color: #51465e;
    font-size: .76rem;
    font-weight: 850;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .cx-shell[data-ui-skin="backoffice"][data-shell-mode="tenant_app"] .cx-nav {
    gap: .44rem;
    padding: .18rem .08rem .8rem;
  }
  .cx-shell[data-ui-skin="backoffice"][data-shell-mode="tenant_app"] .cx-nav-group {
    gap: .1rem;
    padding: 0 0 .34rem;
    border: 0;
    border-block-end: 1px solid rgba(36,16,102,.055);
    background: transparent;
  }
  .cx-shell[data-ui-skin="backoffice"][data-shell-mode="tenant_app"] .cx-nav-group:last-child { border-block-end: 0; }
  .cx-shell[data-ui-skin="backoffice"][data-shell-mode="tenant_app"] .cx-nav-group[data-active-group] {
    background: transparent;
  }

  .cx-shell[data-ui-skin="backoffice"][data-shell-mode="tenant_app"] .cx-nav-group-title {
    min-height: 38px;
    padding: .48rem .58rem;
    border: 1px solid transparent;
    border-radius: 10px;
    color: #665b72;
    font-size: .79rem;
    font-weight: 900;
    transition:
      background var(--cx-shell-motion-fast) ease,
      color var(--cx-shell-motion-fast) ease,
      border-color var(--cx-shell-motion-fast) ease,
      transform var(--cx-shell-motion-fast) var(--cx-shell-motion-ease);
  }
  .cx-shell[data-ui-skin="backoffice"][data-shell-mode="tenant_app"] .cx-nav-group-title:hover {
    color: var(--cx-brand-secondary);
    background: rgba(91,26,163,.055);
    border-color: rgba(91,26,163,.075);
  }
  .cx-shell[data-ui-skin="backoffice"][data-shell-mode="tenant_app"] .cx-nav-group[data-active-group] > .cx-nav-group-title {
    color: #4f247e;
    background: rgba(91,26,163,.07);
  }
  .cx-shell[data-ui-skin="backoffice"][data-shell-mode="tenant_app"] .cx-nav-group-main { gap: .54rem; min-width: 0; }
  .cx-shell[data-ui-skin="backoffice"][data-shell-mode="tenant_app"] .cx-nav-group-main strong {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .cx-shell[data-ui-skin="backoffice"][data-shell-mode="tenant_app"] .cx-nav-group-icon,
  .cx-shell[data-ui-skin="backoffice"][data-shell-mode="tenant_app"] .cx-nav-icon {
    display: inline-grid;
    place-items: center;
    flex: 0 0 auto;
    color: #8a7d98;
    transition: color var(--cx-shell-motion-fast) ease, transform var(--cx-shell-motion-fast) var(--cx-shell-motion-ease);
  }
  .cx-shell[data-ui-skin="backoffice"][data-shell-mode="tenant_app"] .cx-nav-group-icon { inline-size: 25px; block-size: 25px; }
  .cx-shell[data-ui-skin="backoffice"][data-shell-mode="tenant_app"] .cx-nav-icon { inline-size: 23px; block-size: 23px; }
  .cx-shell[data-ui-skin="backoffice"][data-shell-mode="tenant_app"] .cx-nav-svg { inline-size: 17px; block-size: 17px; display: block; }
  .cx-shell[data-ui-skin="backoffice"][data-shell-mode="tenant_app"] .cx-nav-icon-legacy,
  .cx-shell[data-ui-skin="backoffice"][data-shell-mode="tenant_app"] .cx-nav-chevron-legacy,
  .cx-shell[data-ui-skin="backoffice"][data-shell-mode="tenant_app"] .cx-sidebar-toggle-icon-legacy { display: none; }
  .cx-shell[data-ui-skin="backoffice"][data-shell-mode="tenant_app"] .cx-nav-icon-modern,
  .cx-shell[data-ui-skin="backoffice"][data-shell-mode="tenant_app"] .cx-nav-chevron-modern,
  .cx-shell[data-ui-skin="backoffice"][data-shell-mode="tenant_app"] .cx-sidebar-toggle-icon-modern { display: inline-grid; place-items: center; }

  .cx-shell[data-ui-skin="backoffice"][data-shell-mode="tenant_app"] .cx-nav-group-caret {
    inline-size: 24px;
    block-size: 24px;
    border-radius: 8px;
    background: transparent;
    color: #9a90a5;
    transition: transform var(--cx-shell-motion-base) var(--cx-shell-motion-ease), background var(--cx-shell-motion-fast) ease, color var(--cx-shell-motion-fast) ease;
  }
  .cx-shell[data-ui-skin="backoffice"][data-shell-mode="tenant_app"] .cx-nav-chevron-svg { inline-size: 14px; block-size: 14px; }
  .cx-shell[data-ui-skin="backoffice"][data-shell-mode="tenant_app"] .cx-nav-group[data-open="true"] .cx-nav-group-caret {
    transform: rotate(180deg);
    color: var(--cx-brand-secondary);
    background: rgba(91,26,163,.065);
  }

  /* Keep the same nodes mounted; only collapse their visual box. */
  .cx-shell[data-ui-skin="backoffice"][data-shell-mode="tenant_app"] .cx-nav-group-pages {
    display: grid;
    gap: .16rem;
    max-height: 900px;
    padding: .12rem .34rem .08rem .08rem;
    opacity: 1;
    overflow: hidden;
    transform: translate3d(0,0,0);
    transition:
      max-height var(--cx-shell-motion-panel) var(--cx-shell-motion-ease),
      opacity var(--cx-shell-motion-fast) ease,
      transform var(--cx-shell-motion-base) var(--cx-shell-motion-ease),
      padding var(--cx-shell-motion-panel) var(--cx-shell-motion-ease);
  }
  .cx-shell[data-ui-skin="backoffice"][data-shell-mode="tenant_app"] .cx-nav-group-pages[data-collapsed="true"] {
    max-height: 0;
    padding-block: 0;
    opacity: 0;
    pointer-events: none;
    transform: translate3d(0,-4px,0);
  }
  .cx-shell[data-ui-skin="backoffice"][data-shell-mode="tenant_app"] .cx-nav-group-pages[hidden] { display: none !important; }

  .cx-shell[data-ui-skin="backoffice"][data-shell-mode="tenant_app"] .cx-nav-link {
    position: relative;
    min-height: 38px;
    padding: .46rem .64rem;
    border: 1px solid transparent;
    border-radius: 10px;
    color: #70667b;
    background: transparent;
    font-size: .82rem;
    font-weight: 800;
    transition:
      background var(--cx-shell-motion-fast) ease,
      color var(--cx-shell-motion-fast) ease,
      border-color var(--cx-shell-motion-fast) ease,
      box-shadow var(--cx-shell-motion-fast) ease,
      transform var(--cx-shell-motion-fast) var(--cx-shell-motion-ease);
  }
  .cx-shell[data-ui-skin="backoffice"][data-shell-mode="tenant_app"] .cx-nav-link:hover {
    color: #4f247e;
    background: rgba(91,26,163,.05);
    border-color: rgba(91,26,163,.07);
    transform: translate3d(-2px,0,0);
  }
  .cx-shell[data-ui-skin="backoffice"][data-shell-mode="tenant_app"] .cx-nav-link:hover .cx-nav-icon {
    color: var(--cx-brand-secondary);
    transform: translate3d(-1px,0,0);
  }
  .cx-shell[data-ui-skin="backoffice"][data-shell-mode="tenant_app"] .cx-nav-link[aria-current="page"],
  .cx-shell[data-ui-skin="backoffice"][data-shell-mode="tenant_app"] .cx-nav-link.is-active {
    color: #3f176f;
    background: linear-gradient(135deg, rgba(255,255,255,.98), rgba(245,239,252,.94));
    border-color: rgba(91,26,163,.13);
    box-shadow: 0 6px 16px rgba(36,16,102,.065);
  }
  .cx-shell[data-ui-skin="backoffice"][data-shell-mode="tenant_app"] .cx-nav-link[aria-current="page"] .cx-nav-icon,
  .cx-shell[data-ui-skin="backoffice"][data-shell-mode="tenant_app"] .cx-nav-link.is-active .cx-nav-icon {
    color: var(--cx-brand-secondary);
  }
  .cx-shell[data-ui-skin="backoffice"][data-shell-mode="tenant_app"] .cx-nav-link[aria-current="page"]::after,
  .cx-shell[data-ui-skin="backoffice"][data-shell-mode="tenant_app"] .cx-nav-link.is-active::after {
    content: '';
    position: absolute;
    inset-inline-start: .2rem;
    top: 50%;
    inline-size: 3px;
    block-size: 20px;
    border-radius: 999px;
    background: linear-gradient(180deg, var(--cx-brand-secondary), var(--cx-brand-accent));
    transform: translateY(-50%);
    box-shadow: none;
  }

  .cx-shell[data-ui-skin="backoffice"][data-shell-mode="tenant_app"] .cx-shell-session-card {
    margin-block-start: auto;
    padding: .72rem .68rem .2rem;
    border: 0;
    border-block-start: 1px solid rgba(36,16,102,.08);
    border-radius: 0;
    color: #675d72;
    background: transparent;
    box-shadow: none;
  }
  .cx-shell[data-ui-skin="backoffice"][data-shell-mode="tenant_app"] .cx-shell-session-card strong {
    color: #3f3549;
    font-size: .82rem;
  }
  .cx-shell[data-ui-skin="backoffice"][data-shell-mode="tenant_app"] .cx-shell-session-card .cx-help,
  .cx-shell[data-ui-skin="backoffice"][data-shell-mode="tenant_app"] .cx-shell-session-label {
    color: #9a90a5;
    font-size: .66rem;
  }

  /* Topbar: fixed global context, quiet neutral surface. */
  .cx-shell[data-ui-skin="backoffice"][data-shell-mode="tenant_app"] .cx-topbar {
    position: sticky;
    top: 0;
    z-index: 30;
    min-height: var(--cx-topbar-height);
    height: var(--cx-topbar-height);
    display: grid;
    grid-template-columns: minmax(190px, auto) minmax(0, 1fr);
    align-items: center;
    gap: clamp(.75rem,1.4vw,1.3rem);
    padding: .58rem clamp(.8rem,1.5vw,1.35rem);
    background: rgba(253,252,255,.94);
    border-block-end: 1px solid rgba(36,16,102,.085);
    box-shadow: 0 6px 22px rgba(36,16,102,.035);
    backdrop-filter: blur(14px);
  }
  .cx-shell[data-ui-skin="backoffice"][data-shell-mode="tenant_app"] .cx-topbar-start {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: .65rem;
  }
  .cx-shell[data-ui-skin="backoffice"][data-shell-mode="tenant_app"] .cx-topbar-title-block {
    display: grid;
    gap: .12rem;
    min-width: 0;
  }
  .cx-shell[data-ui-skin="backoffice"][data-shell-mode="tenant_app"] .cx-topbar-title-block strong {
    color: #2b2035;
    font-size: .98rem;
    font-weight: 900;
    line-height: 1.2;
    letter-spacing: -.01em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .cx-shell[data-ui-skin="backoffice"][data-shell-mode="tenant_app"] .cx-topbar-title-block .cx-help {
    color: #94899f;
    font-size: .68rem;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .cx-shell[data-ui-skin="backoffice"][data-shell-mode="tenant_app"] .cx-topbar-eyebrow { display: none; }

  .cx-shell[data-ui-skin="backoffice"][data-shell-mode="tenant_app"] .cx-sidebar-toggle {
    inline-size: 40px;
    block-size: 40px;
    min-height: 40px;
    padding: 0;
    display: grid;
    place-items: center;
    border: 1px solid rgba(91,26,163,.11) !important;
    border-radius: 11px;
    background: rgba(255,255,255,.92) !important;
    color: #6a358f !important;
    box-shadow: 0 4px 12px rgba(36,16,102,.045);
    transition: transform var(--cx-shell-motion-fast) var(--cx-shell-motion-ease), background var(--cx-shell-motion-fast) ease, border-color var(--cx-shell-motion-fast) ease, color var(--cx-shell-motion-fast) ease;
  }
  .cx-shell[data-ui-skin="backoffice"][data-shell-mode="tenant_app"] .cx-sidebar-toggle:hover {
    background: #f6f0fb !important;
    color: #4e207b !important;
    border-color: rgba(91,26,163,.2) !important;
    transform: translate3d(0,-1px,0);
  }
  .cx-shell[data-ui-skin="backoffice"][data-shell-mode="tenant_app"] .cx-sidebar-toggle [data-sidebar-toggle-text] { display: none; }
  .cx-shell[data-ui-skin="backoffice"][data-shell-mode="tenant_app"] .cx-sidebar-toggle-icon,
  .cx-shell[data-ui-skin="backoffice"][data-shell-mode="tenant_app"] .cx-sidebar-toggle-icon svg {
    inline-size: 18px;
    block-size: 18px;
    display: block;
  }

  .cx-shell[data-ui-skin="backoffice"][data-shell-mode="tenant_app"] .cx-topbar-actions {
    min-width: 0;
    display: grid;
    grid-template-columns: minmax(180px, 1fr) auto auto;
    align-items: center;
    gap: .48rem;
    justify-content: stretch;
  }
  .cx-shell[data-ui-skin="backoffice"][data-shell-mode="tenant_app"] .cx-topbar-context,
  .cx-shell[data-ui-skin="backoffice"][data-shell-mode="tenant_app"] .cx-topbar-account {
    display: flex;
    align-items: center;
    gap: .4rem;
    min-width: 0;
  }
  .cx-shell[data-ui-skin="backoffice"][data-shell-mode="tenant_app"] .cx-topbar-action,
  .cx-shell[data-ui-skin="backoffice"][data-shell-mode="tenant_app"] .cx-default-branch-button,
  .cx-shell[data-ui-skin="backoffice"][data-shell-mode="tenant_app"] .cx-recovery-bell,
  .cx-shell[data-ui-skin="backoffice"][data-shell-mode="tenant_app"] .cx-topbar-more > summary {
    min-height: 40px;
    height: 40px;
    border: 1px solid rgba(36,16,102,.10);
    border-radius: 11px;
    background: rgba(255,255,255,.9);
    color: #594d64;
    box-shadow: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .42rem;
    padding: 0 .7rem;
    font-size: .72rem;
    font-weight: 800;
    white-space: nowrap;
    transition: transform var(--cx-shell-motion-fast) var(--cx-shell-motion-ease), border-color var(--cx-shell-motion-fast) ease, background var(--cx-shell-motion-fast) ease, box-shadow var(--cx-shell-motion-fast) ease;
  }
  .cx-shell[data-ui-skin="backoffice"][data-shell-mode="tenant_app"] :is(.cx-topbar-action,.cx-default-branch-button,.cx-recovery-bell,.cx-topbar-more > summary):hover {
    border-color: rgba(91,26,163,.19);
    background: #fff;
    box-shadow: 0 5px 14px rgba(36,16,102,.055);
    transform: translate3d(0,-1px,0);
  }
  .cx-shell[data-ui-skin="backoffice"][data-shell-mode="tenant_app"] :is(.cx-topbar-action,.cx-default-branch-button,.cx-recovery-bell,.cx-topbar-more > summary) svg {
    inline-size: 16px;
    block-size: 16px;
    flex: 0 0 auto;
    color: #7133a0;
  }
  .cx-shell[data-ui-skin="backoffice"][data-shell-mode="tenant_app"] .cx-default-branch-button {
    max-inline-size: 190px;
    padding-inline: .68rem;
  }
  .cx-shell[data-ui-skin="backoffice"][data-shell-mode="tenant_app"] .cx-default-branch-button span {
    display: block;
    min-width: 0;
  }
  .cx-shell[data-ui-skin="backoffice"][data-shell-mode="tenant_app"] .cx-default-branch-button small { display: none; }
  .cx-shell[data-ui-skin="backoffice"][data-shell-mode="tenant_app"] .cx-default-branch-button strong {
    display: block;
    max-inline-size: 112px;
    color: #43374e;
    font-size: .72rem;
    font-weight: 850;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .cx-shell[data-ui-skin="backoffice"][data-shell-mode="tenant_app"] .cx-recovery-bell {
    position: relative;
    inline-size: 40px;
    padding: 0;
  }
  .cx-shell[data-ui-skin="backoffice"][data-shell-mode="tenant_app"] .cx-recovery-bell[hidden] { display: none; }
  .cx-shell[data-ui-skin="backoffice"][data-shell-mode="tenant_app"] .cx-recovery-bell [data-order-recovery-count] {
    position: absolute;
    inset-inline-end: -4px;
    inset-block-start: -5px;
    min-inline-size: 18px;
    block-size: 18px;
    padding-inline: 4px;
    display: grid;
    place-items: center;
    border: 2px solid #fff;
    border-radius: 999px;
    background: var(--cx-danger);
    color: #fff;
    font-size: 9px;
    font-weight: 900;
  }
  .cx-shell[data-ui-skin="backoffice"][data-shell-mode="tenant_app"] .cx-topbar-profile {
    inline-size: 40px;
    block-size: 40px;
    flex: 0 0 40px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(91,26,163,.14);
    border-radius: 12px;
    background: linear-gradient(135deg, #f6f1ff, #eee5ff);
    color: #6c2bb0;
    text-decoration: none;
    box-shadow: 0 5px 14px rgba(36,16,102,.07);
    transition: transform var(--cx-shell-motion-fast) var(--cx-shell-motion-ease), border-color var(--cx-shell-motion-fast) ease, background var(--cx-shell-motion-fast) ease, box-shadow var(--cx-shell-motion-fast) ease;
  }
  .cx-shell[data-ui-skin="backoffice"][data-shell-mode="tenant_app"] .cx-topbar-profile:hover {
    transform: translate3d(0,-1px,0);
    border-color: rgba(91,26,163,.24);
    background: #fff;
    box-shadow: 0 7px 18px rgba(36,16,102,.10);
  }
  .cx-shell[data-ui-skin="backoffice"][data-shell-mode="tenant_app"] .cx-topbar-profile:focus-visible {
    outline: 2px solid rgba(111,48,185,.55);
    outline-offset: 2px;
  }
  .cx-shell[data-ui-skin="backoffice"][data-shell-mode="tenant_app"] .cx-topbar-profile svg {
    inline-size: 18px;
    block-size: 18px;
  }

  .cx-shell[data-ui-skin="backoffice"][data-shell-mode="tenant_app"] .cx-topbar-more { position: relative; }
  .cx-shell[data-ui-skin="backoffice"][data-shell-mode="tenant_app"] .cx-topbar-more > summary {
    inline-size: 40px;
    padding: 0;
    list-style: none;
    cursor: pointer;
  }
  .cx-shell[data-ui-skin="backoffice"][data-shell-mode="tenant_app"] .cx-topbar-more > summary::-webkit-details-marker { display: none; }
  .cx-shell[data-ui-skin="backoffice"][data-shell-mode="tenant_app"] .cx-topbar-more-menu {
    position: absolute;
    z-index: 90;
    top: calc(100% + 8px);
    inset-inline-end: 0;
    display: grid;
    gap: 4px;
    min-width: 196px;
    padding: 7px;
    border: 1px solid rgba(36,16,102,.10);
    border-radius: 13px;
    background: #fff;
    box-shadow: 0 18px 42px rgba(36,16,102,.14);
    transform-origin: top left;
  }
  .cx-shell[data-ui-skin="backoffice"][data-shell-mode="tenant_app"] .cx-topbar-more[open] .cx-topbar-more-menu {
    animation: cx-shell-popover-in var(--cx-shell-motion-base) var(--cx-shell-motion-ease) both;
  }
  .cx-shell[data-ui-skin="backoffice"][data-shell-mode="tenant_app"] .cx-topbar-more-menu .cx-topbar-action {
    width: 100%;
    height: 36px;
    justify-content: flex-start;
    border: 0;
    box-shadow: none;
    font-size: .74rem;
  }
  .cx-shell[data-ui-skin="backoffice"][data-shell-mode="tenant_app"] .cx-topbar-more-menu .cx-topbar-action span { display: inline; }

  .cx-shell[data-ui-skin="backoffice"][data-shell-mode="tenant_app"] .cx-shell-search-anchor {
    position: relative;
    width: 100%;
    min-width: 0;
    max-width: 440px;
    justify-self: center;
  }
  .cx-shell[data-ui-skin="backoffice"][data-shell-mode="tenant_app"] .cx-shell-search-trigger {
    width: 100%;
    height: 40px;
    padding: 0 .78rem;
    border: 1px solid rgba(36,16,102,.10);
    border-radius: 11px;
    background: rgba(255,255,255,.92);
    color: #94899f;
    display: flex;
    align-items: center;
    gap: .55rem;
    text-align: start;
    cursor: pointer;
    transition: transform var(--cx-shell-motion-fast) var(--cx-shell-motion-ease), border-color var(--cx-shell-motion-fast) ease, box-shadow var(--cx-shell-motion-fast) ease, background var(--cx-shell-motion-fast) ease;
  }
  .cx-shell[data-ui-skin="backoffice"][data-shell-mode="tenant_app"] .cx-shell-search-trigger:hover,
  .cx-shell[data-ui-skin="backoffice"][data-shell-mode="tenant_app"] .cx-shell-search-trigger[aria-expanded="true"] {
    border-color: rgba(91,26,163,.20);
    background: #fff;
    box-shadow: 0 5px 14px rgba(36,16,102,.055);
  }
  .cx-shell[data-ui-skin="backoffice"][data-shell-mode="tenant_app"] .cx-shell-search-trigger svg {
    inline-size: 17px;
    block-size: 17px;
    flex: 0 0 auto;
    color: #7133a0;
  }
  .cx-shell[data-ui-skin="backoffice"][data-shell-mode="tenant_app"] .cx-shell-search-trigger span {
    flex: 1;
    min-width: 0;
    font-size: .72rem;
    font-weight: 700;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .cx-shell[data-ui-skin="backoffice"][data-shell-mode="tenant_app"] .cx-shell-search-trigger kbd { display: none; }

  .cx-shell-search {
    position: absolute;
    z-index: 70;
    top: calc(100% + 9px);
    inset-inline-start: 0;
    width: min(460px, calc(100vw - 28px));
    max-height: min(520px,75dvh);
    overflow: auto;
    padding: 12px;
    border: 1px solid rgba(36,16,102,.11);
    border-radius: 15px;
    background: #fff;
    color: #302738;
    box-shadow: 0 22px 58px rgba(36,16,102,.15);
    animation: cx-shell-popover-in var(--cx-shell-motion-base,190ms) var(--cx-shell-motion-ease,cubic-bezier(.2,.8,.2,1)) both;
  }

  .cx-shell-search[data-portaled="true"] {
    position: fixed;
    z-index: 10040;
    inset: auto;
    margin: 0;
  }
  .cx-shell-search-field {
    height: 42px;
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 0 11px;
    border: 1px solid rgba(91,26,163,.22);
    border-radius: 10px;
    box-shadow: 0 0 0 3px rgba(91,26,163,.055);
  }
  .cx-shell-search-field svg { width: 17px; height: 17px; flex: none; color: #7133a0; }
  .cx-shell-search-field input { flex: 1; min-width: 0; height: 100%; border: 0; outline: 0; background: transparent; color: inherit; font: inherit; font-size: 12px; }
  .cx-shell-search-field > span { color: #7133a0; background: #f5effa; border-radius: 6px; padding: 4px 6px; font-size: 9px; font-weight: 800; }
  .cx-shell-search-meta { display: flex; justify-content: space-between; gap: 8px; padding: 12px 4px 8px; border-bottom: 1px solid #eee9f1; font-size: 10px; }
  .cx-shell-search-meta small { color: #958b9c; font-size: 9px; }
  .cx-shell-search [data-route-search-results] { display: grid; gap: 2px; max-height: 390px; overflow: auto; padding-top: 5px; }
  .cx-shell-search [data-route-search-results] a { display: grid; grid-template-columns: 28px minmax(0,1fr) 20px; gap: 9px; align-items: center; padding: 9px 10px; border-radius: 10px; color: inherit; text-decoration: none; }
  .cx-shell-search [data-route-search-results] a:hover,
  .cx-shell-search [data-route-search-results] a:focus-visible { background: #f6f1fa; outline: 0; }
  .cx-shell-search-result-icon { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 8px; background: #f1e9f7; color: #7133a0; }
  .cx-shell-search-result-icon .cx-nav-icon-legacy { display: none; }
  .cx-shell-search-result-icon .cx-nav-icon-modern,
  .cx-shell-search-result-icon svg { display: block; width: 16px; height: 16px; }
  .cx-shell-search [data-route-search-results] strong { display: block; font-size: 11px; }
  .cx-shell-search [data-route-search-results] small { display: block; margin-top: 3px; color: #958b9c; font-size: 9px; }
  .cx-shell-search-result-arrow { color: #958b9c; }
  .cx-shell-search-empty { margin: 0; padding: 22px 12px; color: #958b9c; font-size: 11px; text-align: center; }

  .cx-shell[data-ui-skin="backoffice"][data-shell-mode="tenant_app"] .cx-content {
    padding: clamp(1rem,1.8vw,1.55rem);
    background: transparent;
  }

  /* Desktop icon rail: DOM stays mounted; labels/data do not re-render. */
  @media (min-width: 961px) {
    .cx-shell[data-ui-skin="backoffice"][data-shell-mode="tenant_app"]:is([data-sidebar-state="collapsed"],[data-sidebar-state="hidden"]) {
      grid-template-columns: var(--cx-shell-rail-width) minmax(0,1fr);
    }
    .cx-shell[data-ui-skin="backoffice"][data-shell-mode="tenant_app"]:is([data-sidebar-state="collapsed"],[data-sidebar-state="hidden"]) .cx-sidebar {
      inline-size: auto;
      padding: .72rem .38rem;
      opacity: 1;
      pointer-events: auto;
      overflow-x: hidden;
      overflow-y: auto;
      transform: none;
    }
    .cx-shell[data-ui-skin="backoffice"][data-shell-mode="tenant_app"]:is([data-sidebar-state="collapsed"],[data-sidebar-state="hidden"]) .cx-brand-block {
      justify-content: center;
      padding: .45rem 0;
    }
    .cx-shell[data-ui-skin="backoffice"][data-shell-mode="tenant_app"]:is([data-sidebar-state="collapsed"],[data-sidebar-state="hidden"]) .cx-brand-logo:not(.cx-brand-logo-mark),
    .cx-shell[data-ui-skin="backoffice"][data-shell-mode="tenant_app"]:is([data-sidebar-state="collapsed"],[data-sidebar-state="hidden"]) .cx-brand-copy,
    .cx-shell[data-ui-skin="backoffice"][data-shell-mode="tenant_app"]:is([data-sidebar-state="collapsed"],[data-sidebar-state="hidden"]) .cx-shell-company-card,
    .cx-shell[data-ui-skin="backoffice"][data-shell-mode="tenant_app"]:is([data-sidebar-state="collapsed"],[data-sidebar-state="hidden"]) .cx-shell-session-card,
    .cx-shell[data-ui-skin="backoffice"][data-shell-mode="tenant_app"]:is([data-sidebar-state="collapsed"],[data-sidebar-state="hidden"]) .cx-nav-group-main strong,
    .cx-shell[data-ui-skin="backoffice"][data-shell-mode="tenant_app"]:is([data-sidebar-state="collapsed"],[data-sidebar-state="hidden"]) .cx-nav-group-caret,
    .cx-shell[data-ui-skin="backoffice"][data-shell-mode="tenant_app"]:is([data-sidebar-state="collapsed"],[data-sidebar-state="hidden"]) .cx-nav-group-pages {
      display: none;
    }
    .cx-shell[data-ui-skin="backoffice"][data-shell-mode="tenant_app"]:is([data-sidebar-state="collapsed"],[data-sidebar-state="hidden"]) .cx-brand-logo-mark {
      display: block;
      inline-size: 42px;
      block-size: 42px;
    }
    .cx-shell[data-ui-skin="backoffice"][data-shell-mode="tenant_app"]:is([data-sidebar-state="collapsed"],[data-sidebar-state="hidden"]) .cx-nav-group-title {
      justify-content: center;
      min-height: 46px;
      padding: .3rem;
    }
    .cx-shell[data-ui-skin="backoffice"][data-shell-mode="tenant_app"]:is([data-sidebar-state="collapsed"],[data-sidebar-state="hidden"]) .cx-nav-group-main { justify-content: center; }
    .cx-shell[data-ui-skin="backoffice"][data-shell-mode="tenant_app"]:is([data-sidebar-state="collapsed"],[data-sidebar-state="hidden"]) .cx-nav-group-icon {
      inline-size: 38px;
      block-size: 38px;
      border-radius: 10px;
    }
    .cx-shell[data-ui-skin="backoffice"][data-shell-mode="tenant_app"]:is([data-sidebar-state="collapsed"],[data-sidebar-state="hidden"]) .cx-nav-group[data-active-group] .cx-nav-group-icon {
      color: var(--cx-brand-secondary);
      background: rgba(91,26,163,.08);
    }
  }

  .cx-sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 39;
    border: 0;
    padding: 0;
    background: rgba(25,15,39,.30);
    opacity: 0;
    pointer-events: none;
    backdrop-filter: blur(2px);
    transition: opacity var(--cx-shell-motion-base) ease;
  }

  @media (max-width: 1120px) {
    .cx-shell[data-ui-skin="backoffice"][data-shell-mode="tenant_app"] .cx-shell-search-anchor {
      width: 40px;
      min-width: 40px;
      max-width: 40px;
      justify-self: end;
    }
    .cx-shell[data-ui-skin="backoffice"][data-shell-mode="tenant_app"] .cx-shell-search-trigger {
      justify-content: center;
      padding: 0;
    }
    .cx-shell[data-ui-skin="backoffice"][data-shell-mode="tenant_app"] .cx-shell-search-trigger span { display: none; }
    .cx-shell-search:not([data-portaled="true"]) { position: fixed; inset-inline: 12px; top: 68px; width: auto; }
  }

  @media (max-width: 960px) {
    .cx-shell[data-ui-skin="backoffice"][data-shell-mode="tenant_app"],
    .cx-shell[data-ui-skin="backoffice"][data-shell-mode="tenant_app"]:is([data-sidebar-state="collapsed"],[data-sidebar-state="hidden"]) {
      grid-template-columns: 1fr;
    }
    .cx-shell[data-ui-skin="backoffice"][data-shell-mode="tenant_app"] .cx-sidebar {
      position: fixed;
      z-index: 40;
      inset-block: 0;
      inset-inline-start: 0;
      inline-size: min(88vw, 330px);
      height: 100dvh;
      padding: .82rem .72rem;
      opacity: 1;
      pointer-events: auto;
      transform: translate3d(0,0,0);
      box-shadow: -18px 0 46px rgba(36,16,102,.16);
    }
    .cx-shell[data-ui-skin="backoffice"][data-shell-mode="tenant_app"]:is([data-sidebar-state="hidden"],[data-sidebar-state="collapsed"]) .cx-sidebar {
      opacity: 0;
      pointer-events: none;
      transform: translate3d(108%,0,0);
    }
    .cx-shell[data-ui-skin="backoffice"][data-shell-mode="tenant_app"] .cx-sidebar-backdrop { display: block; }
    .cx-shell[data-ui-skin="backoffice"][data-shell-mode="tenant_app"][data-sidebar-state="visible"] .cx-sidebar-backdrop {
      opacity: 1;
      pointer-events: auto;
    }
    .cx-shell[data-ui-skin="backoffice"][data-shell-mode="tenant_app"] .cx-topbar {
      grid-template-columns: minmax(0,1fr) auto;
      gap: .45rem;
      padding-inline: .65rem;
    }
    .cx-shell[data-ui-skin="backoffice"][data-shell-mode="tenant_app"] .cx-topbar-actions {
      width: auto;
      display: flex;
      align-items: center;
      gap: .32rem;
      min-width: 0;
    }
    .cx-shell[data-ui-skin="backoffice"][data-shell-mode="tenant_app"] .cx-topbar-context,
    .cx-shell[data-ui-skin="backoffice"][data-shell-mode="tenant_app"] .cx-topbar-account { gap: .28rem; }
    .cx-shell[data-ui-skin="backoffice"][data-shell-mode="tenant_app"] .cx-default-branch-button {
      inline-size: 40px;
      padding: 0;
    }
    .cx-shell[data-ui-skin="backoffice"][data-shell-mode="tenant_app"] .cx-default-branch-button span,
    .cx-shell[data-ui-skin="backoffice"][data-shell-mode="tenant_app"] .cx-default-branch-button svg:last-child { display: none; }
  }

  @media (max-width: 620px) {
    .cx-shell[data-ui-skin="backoffice"][data-shell-mode="tenant_app"] {
      --cx-topbar-height: 58px;
    }
    .cx-shell[data-ui-skin="backoffice"][data-shell-mode="tenant_app"] .cx-topbar {
      height: var(--cx-topbar-height);
      min-height: var(--cx-topbar-height);
      padding: .48rem .48rem;
    }
    .cx-shell[data-ui-skin="backoffice"][data-shell-mode="tenant_app"] .cx-topbar-start { gap: .4rem; }
    .cx-shell[data-ui-skin="backoffice"][data-shell-mode="tenant_app"] .cx-sidebar-toggle,
    .cx-shell[data-ui-skin="backoffice"][data-shell-mode="tenant_app"] .cx-shell-search-anchor,
    .cx-shell[data-ui-skin="backoffice"][data-shell-mode="tenant_app"] .cx-shell-search-trigger,
    .cx-shell[data-ui-skin="backoffice"][data-shell-mode="tenant_app"] .cx-default-branch-button,
    .cx-shell[data-ui-skin="backoffice"][data-shell-mode="tenant_app"] .cx-recovery-bell,
    .cx-shell[data-ui-skin="backoffice"][data-shell-mode="tenant_app"] .cx-topbar-more > summary {
      inline-size: 38px;
      width: 38px;
      block-size: 38px;
      height: 38px;
      min-height: 38px;
    }
    .cx-shell[data-ui-skin="backoffice"][data-shell-mode="tenant_app"] .cx-topbar-profile {
      inline-size: 38px;
      width: 38px;
      block-size: 38px;
      height: 38px;
      flex-basis: 38px;
    }
    .cx-shell[data-ui-skin="backoffice"][data-shell-mode="tenant_app"] .cx-topbar-title-block strong { font-size: .88rem; }
    .cx-shell[data-ui-skin="backoffice"][data-shell-mode="tenant_app"] .cx-topbar-title-block .cx-help { display: none; }
    .cx-shell[data-ui-skin="backoffice"][data-shell-mode="tenant_app"] .cx-content { padding: var(--cx-space-4); }
    .cx-shell-search:not([data-portaled="true"]) { inset-inline: 8px; top: 62px; }
  }

  @media (max-width: 430px) {
    .cx-shell[data-ui-skin="backoffice"][data-shell-mode="tenant_app"] .cx-topbar { gap: .28rem; }
    .cx-shell[data-ui-skin="backoffice"][data-shell-mode="tenant_app"] .cx-topbar-actions { gap: .18rem; }
    .cx-shell[data-ui-skin="backoffice"][data-shell-mode="tenant_app"] .cx-topbar-title-block strong { max-inline-size: 104px; }
  }

  [data-theme="dark"] .cx-shell[data-ui-skin="backoffice"][data-shell-mode="tenant_app"] {
    background: linear-gradient(180deg,#100b1e,#0d0918);
  }
  [data-theme="dark"] .cx-shell[data-ui-skin="backoffice"][data-shell-mode="tenant_app"] .cx-sidebar {
    background: linear-gradient(180deg,rgba(28,20,48,.985),rgba(20,14,37,.985));
    border-inline-end-color: rgba(255,255,255,.075);
    box-shadow: -8px 0 28px rgba(0,0,0,.22);
  }
  [data-theme="dark"] .cx-shell[data-ui-skin="backoffice"][data-shell-mode="tenant_app"] .cx-brand-copy strong,
  [data-theme="dark"] .cx-shell[data-ui-skin="backoffice"][data-shell-mode="tenant_app"] .cx-nav-link[aria-current="page"],
  [data-theme="dark"] .cx-shell[data-ui-skin="backoffice"][data-shell-mode="tenant_app"] .cx-nav-link.is-active { color: #f3e8ff; }
  [data-theme="dark"] .cx-shell[data-ui-skin="backoffice"][data-shell-mode="tenant_app"] .cx-nav-group-title,
  [data-theme="dark"] .cx-shell[data-ui-skin="backoffice"][data-shell-mode="tenant_app"] .cx-nav-link,
  [data-theme="dark"] .cx-shell[data-ui-skin="backoffice"][data-shell-mode="tenant_app"] .cx-shell-session-card strong,
  [data-theme="dark"] .cx-shell[data-ui-skin="backoffice"][data-shell-mode="tenant_app"] .cx-shell-company-card strong { color: #d9d0e3; }
  [data-theme="dark"] .cx-shell[data-ui-skin="backoffice"][data-shell-mode="tenant_app"] .cx-nav-link[aria-current="page"],
  [data-theme="dark"] .cx-shell[data-ui-skin="backoffice"][data-shell-mode="tenant_app"] .cx-nav-link.is-active {
    background: linear-gradient(135deg,rgba(117,60,164,.30),rgba(74,36,112,.25));
    border-color: rgba(216,180,255,.16);
  }
  [data-theme="dark"] .cx-shell[data-ui-skin="backoffice"][data-shell-mode="tenant_app"] .cx-topbar-profile {
    border-color: rgba(216,180,255,.16);
    background: linear-gradient(135deg,rgba(117,60,164,.30),rgba(74,36,112,.25));
    color: #f3e8ff;
    box-shadow: none;
  }
  [data-theme="dark"] .cx-shell[data-ui-skin="backoffice"][data-shell-mode="tenant_app"] .cx-topbar-profile:hover {
    border-color: rgba(216,180,255,.26);
    background: rgba(117,60,164,.38);
  }

  [data-theme="dark"] .cx-shell[data-ui-skin="backoffice"][data-shell-mode="tenant_app"] .cx-topbar {
    background: rgba(18,12,33,.92);
    border-block-end-color: rgba(255,255,255,.075);
  }
  [data-theme="dark"] .cx-shell[data-ui-skin="backoffice"][data-shell-mode="tenant_app"] .cx-topbar-title-block strong { color: #f8f5ff; }
  [data-theme="dark"] .cx-shell[data-ui-skin="backoffice"][data-shell-mode="tenant_app"] :is(.cx-sidebar-toggle,.cx-topbar-action,.cx-default-branch-button,.cx-recovery-bell,.cx-topbar-more > summary,.cx-shell-search-trigger),
  [data-theme="dark"] .cx-shell[data-ui-skin="backoffice"][data-shell-mode="tenant_app"] .cx-topbar-more-menu,
  [data-theme="dark"] .cx-shell-search {
    background: #20162f !important;
    border-color: #483857 !important;
    color: #f2eafa !important;
  }
  [data-theme="dark"] .cx-shell-search-field { border-color: #6a4c82; }
  [data-theme="dark"] .cx-shell-search-field input { color: #f2eafa; }
  [data-theme="dark"] .cx-shell-search [data-route-search-results] a:hover { background: #342444; }
}

@keyframes cx-shell-popover-in {
  from { opacity: 0; transform: translate3d(0,-5px,0) scale(.985); }
  to { opacity: 1; transform: translate3d(0,0,0) scale(1); }
}
@keyframes cx-shell-title-in {
  from { opacity: .35; transform: translate3d(0,4px,0); }
  to { opacity: 1; transform: translate3d(0,0,0); }
}
@media (prefers-reduced-motion: no-preference) {
  .cx-shell[data-ui-skin="backoffice"][data-shell-mode="tenant_app"] .cx-topbar-title-block.is-route-enter {
    animation: cx-shell-title-in 170ms cubic-bezier(.2,.8,.2,1) both;
  }
}

/* Phase 35AW — Super Admin LTR shell side isolation hotfix */
@layer layout {
  .cx-shell.cx-shell--super-admin {
    direction: ltr;
    grid-template-columns: var(--cx-sidebar-width) minmax(0, 1fr);
  }
  .cx-shell.cx-shell--super-admin[data-sidebar-state="hidden"] {
    grid-template-columns: 0 minmax(0, 1fr);
  }
  .cx-shell.cx-shell--super-admin .cx-sidebar {
    grid-column: 1;
    grid-row: 1;
    direction: ltr;
    text-align: left;
    border-inline-end: 1px solid var(--cx-border);
    border-inline-start: 0;
  }
  .cx-shell.cx-shell--super-admin .cx-main {
    grid-column: 2;
    grid-row: 1;
    direction: ltr;
    text-align: left;
    min-width: 0;
  }
  .cx-shell.cx-shell--super-admin .cx-topbar,
  .cx-shell.cx-shell--super-admin .cx-topbar-start,
  .cx-shell.cx-shell--super-admin .cx-topbar-actions,
  .cx-shell.cx-shell--super-admin .cx-nav-link,
  .cx-shell.cx-shell--super-admin .cx-nav-group-title,
  .cx-shell.cx-shell--super-admin .cx-shell-session-card,
  .cx-shell.cx-shell--super-admin .cx-shell-company-card {
    direction: ltr;
    text-align: left;
  }
  .cx-shell.cx-shell--super-admin .cx-topbar {
    justify-content: space-between;
  }
  .cx-shell.cx-shell--super-admin .cx-actions-row,
  .cx-shell.cx-shell--super-admin .cx-topbar-actions {
    justify-content: flex-end;
  }
}

/* Phase 37L — Clean settings/account internal tabs and editable cards */
@layer components {
  .cx-settings-hero {
    background: linear-gradient(135deg, color-mix(in srgb, var(--cx-brand) 88%, #16003c), color-mix(in srgb, var(--cx-accent) 76%, #4b0068));
    color: #fff;
    border-color: rgba(255,255,255,.16);
  }
  .cx-settings-hero .cx-help,
  .cx-settings-hero .cx-section-eyebrow { color: rgba(255,255,255,.82); }
  .cx-section-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    margin-block-end: .35rem;
    font-size: .78rem;
    font-weight: 950;
    letter-spacing: .02em;
  }
  .cx-settings-summary-strip {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    flex-wrap: wrap;
    padding: .85rem 1rem;
    border: 1px solid var(--cx-border);
    border-radius: var(--cx-radius-lg);
    background: color-mix(in srgb, var(--cx-surface) 88%, transparent);
    box-shadow: var(--cx-shadow-soft);
  }
  /* Global local content tabs — canonical contained-tab contract.
     Content tabs are intentionally distinct from page/center navigation tabs. */
  .cx-local-tabs {
    display: flex;
    align-items: stretch;
    gap: .22rem;
    min-width: 0;
    overflow-x: auto;
    overflow-y: hidden;
    padding: .28rem;
    border: 1px solid color-mix(in srgb, var(--cx-brand-secondary) 10%, var(--cx-border));
    border-radius: .82rem;
    background: color-mix(in srgb, var(--cx-surface-muted, #f8f7fb) 76%, var(--cx-surface));
    box-shadow: none;
    scrollbar-width: thin;
    scroll-snap-type: inline proximity;
  }
  .cx-local-tab {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .45rem;
    flex: 0 0 auto;
    min-height: 40px;
    padding: .5rem .82rem;
    border: 1px solid transparent;
    border-radius: .58rem;
    background: transparent;
    color: var(--cx-muted);
    font-weight: 900;
    white-space: nowrap;
    cursor: pointer;
    scroll-snap-align: start;
    transition: color .14s ease, border-color .14s ease, background .14s ease, box-shadow .14s ease;
  }
  .cx-local-tab:hover {
    color: var(--cx-text);
    background: color-mix(in srgb, var(--cx-surface) 82%, var(--cx-brand-soft));
    border-color: color-mix(in srgb, var(--cx-brand-secondary) 12%, var(--cx-control-border));
  }
  .cx-local-tab:focus-visible { outline: 2px solid color-mix(in srgb, var(--cx-accent) 55%, transparent); outline-offset: 2px; }
  .cx-local-tab[data-active="true"],
  .cx-local-tab.is-active {
    color: var(--cx-brand-strong);
    border-color: color-mix(in srgb, var(--cx-accent) 24%, var(--cx-control-border));
    background: var(--cx-surface);
    box-shadow: 0 2px 7px color-mix(in srgb, var(--cx-brand-secondary) 7%, transparent);
  }

  /* Compact filter segments are filters, not content navigation tabs. */
  .cx-segmented-filter {
    display: inline-flex;
    align-items: center;
    gap: .2rem;
    max-width: 100%;
    overflow-x: auto;
    padding: .22rem;
    border: 1px solid var(--cx-control-border);
    border-radius: 999px;
    background: var(--cx-surface);
    scrollbar-width: none;
  }
  .cx-segmented-filter::-webkit-scrollbar { display: none; }
  .cx-segmented-filter-option {
    flex: 0 0 auto;
    min-height: 32px;
    padding: .34rem .7rem;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: var(--cx-muted);
    font: inherit;
    font-size: .75rem;
    font-weight: 900;
    white-space: nowrap;
    cursor: pointer;
  }
  .cx-segmented-filter-option:hover { color: var(--cx-text); background: var(--cx-surface-muted); }
  .cx-segmented-filter-option[aria-pressed="true"],
  .cx-segmented-filter-option.is-active { color: var(--cx-brand-strong); background: var(--cx-brand-soft); }
  .cx-segmented-filter-option:focus-visible { outline: 2px solid color-mix(in srgb, var(--cx-accent) 50%, transparent); outline-offset: 1px; }
  .cx-local-tab-content { display: grid; gap: 1rem; }
  .cx-tab-panel { display: grid; gap: 1rem; }
  .cx-tab-panel[hidden] { display: none !important; }
  .cx-config-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
    gap: 1rem;
  }
  .cx-config-card .cx-card-body { display: grid; gap: .8rem; }
  .cx-mini-form {
    display: grid;
    gap: .8rem;
    padding: .72rem .82rem;
    border: 1px solid var(--cx-border);
    border-radius: var(--cx-radius-lg);
    background: color-mix(in srgb, var(--cx-bg) 52%, var(--cx-surface));
  }
  .cx-mini-form-title {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: .75rem;
    flex-wrap: wrap;
  }
  .cx-mini-form-title strong { font-size: 1.02rem; }
  .cx-check-grid {
    display: flex;
    flex-wrap: wrap;
    gap: .55rem;
    align-content: start;
  }
  .cx-check {
    display: inline-flex;
    align-items: center;
    gap: .42rem;
    padding: .45rem .68rem;
    border: 1px solid var(--cx-border);
    border-radius: 999px;
    background: var(--cx-surface);
    font-weight: 850;
  }
  .cx-check input { accent-color: var(--cx-accent); }
  .cx-save-row {
    justify-content: space-between;
    padding-block-start: .2rem;
  }
  .cx-setting-map {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: .72rem;
  }
  .cx-setting-map-item {
    display: grid;
    gap: .25rem;
    min-height: 92px;
    padding: .82rem;
    border: 1px solid var(--cx-border);
    border-radius: var(--cx-radius-lg);
    background: linear-gradient(180deg, color-mix(in srgb, var(--cx-surface) 92%, transparent), color-mix(in srgb, var(--cx-bg) 55%, var(--cx-surface)));
  }
  .cx-setting-map-item span { color: var(--cx-muted); font-weight: 900; }
  .cx-setting-map-item strong { font-size: 1rem; overflow-wrap: anywhere; }
  .cx-setting-map-item em { color: var(--cx-muted); font-style: normal; font-size: .78rem; }
  .cx-invoice-preview {
    display: grid;
    grid-template-columns: repeat(4, minmax(120px, 1fr));
    gap: .7rem;
    padding: 1rem;
  }
  .cx-invoice-preview > div {
    display: grid;
    gap: .3rem;
    padding: 1rem;
    border-radius: var(--cx-radius-lg);
    border: 1px solid var(--cx-border);
    background: color-mix(in srgb, var(--cx-surface) 90%, transparent);
  }
  .cx-invoice-preview span { color: var(--cx-muted); font-weight: 900; }
  .cx-invoice-preview strong { font-size: 1.25rem; }
  .cx-clean-list { margin: 0; padding-inline-start: 1.2rem; display: grid; gap: .55rem; }
  .cx-account-sticky-head {
    display: grid;
    gap: .65rem;
    margin-block-end: 1rem;
    min-inline-size: 0;
  }
  .cx-account-profile-card {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 1rem;
    align-items: center;
    padding: 1rem 1.1rem;
    background: linear-gradient(135deg, color-mix(in srgb, var(--cx-brand-soft) 24%, var(--cx-surface)), var(--cx-surface) 52%);
  }
  @media (min-width: 721px) {
    .cx-account-sticky-head {
      position: sticky;
      inset-block-start: 0;
      z-index: 12;
      padding-block: .15rem .72rem;
      background: var(--cx-bg);
      isolation: isolate;
    }
    .cx-account-sticky-head::after {
      content: "";
      position: absolute;
      inset-inline: 0;
      inset-block-end: 0;
      block-size: 1px;
      background: color-mix(in srgb, var(--cx-brand) 8%, transparent);
      pointer-events: none;
    }
  }
  .cx-account-page-head { margin-block-end: .8rem; }
  .cx-account-avatar.cx-account-avatar--person { inline-size: 56px; block-size: 56px; border-radius: 18px; }
  .cx-account-avatar.cx-account-avatar--person svg { inline-size: 25px; block-size: 25px; }
  .cx-account-tabs { margin: 0; }
  .cx-account-tabs .cx-local-tab { flex: 1 1 0; min-inline-size: 160px; }
  .cx-account-tab-content,
  .cx-account-panel { min-inline-size: 0; }
  .cx-account-panel { display: grid; gap: 1rem; }
  .cx-account-panel[hidden] { display: none !important; }
  .cx-account-primary-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(300px, .85fr); gap: 1rem; min-inline-size: 0; }
  .cx-account-section-card { overflow: hidden; }
  .cx-account-section-card .cx-card-header > div { min-inline-size: 0; }
  .cx-account-section-card .cx-card-header h2 { margin: 0 0 .16rem; font-size: 1rem; }
  .cx-account-section-card .cx-card-header p { margin: 0; }
  .cx-account-info-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .7rem; }
  .cx-account-info-item { min-inline-size: 0; display: grid; gap: .3rem; padding: .82rem .9rem; border: 1px solid color-mix(in srgb, var(--cx-brand) 8%, var(--cx-border)); border-radius: 13px; background: color-mix(in srgb, var(--cx-bg) 42%, var(--cx-surface)); }
  .cx-account-info-item span { color: var(--cx-muted); font-size: .7rem; font-weight: 850; }
  .cx-account-info-item strong { min-inline-size: 0; color: var(--cx-text); font-size: .88rem; font-weight: 950; overflow-wrap: anywhere; }
  .cx-account-branch-list { display: grid; gap: .6rem; }
  .cx-account-branch-item { display: flex; align-items: center; justify-content: space-between; gap: .7rem; min-inline-size: 0; padding: .78rem .85rem; border: 1px solid var(--cx-border); border-radius: 13px; background: color-mix(in srgb, var(--cx-bg) 44%, var(--cx-surface)); }
  .cx-account-branch-item[data-current="true"] { border-color: color-mix(in srgb, var(--cx-success, #14805e) 30%, var(--cx-border)); background: color-mix(in srgb, var(--cx-success-soft, #eaf8f1) 58%, var(--cx-surface)); }
  .cx-account-branch-item > span:first-child { min-inline-size: 0; display: grid; gap: .18rem; }
  .cx-account-branch-item strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .86rem; }
  .cx-account-branch-item small { color: var(--cx-muted); font-size: .68rem; font-weight: 800; }
  .cx-account-permission-summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .65rem; }
  .cx-account-permission-summary-item { min-inline-size: 0; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: .6rem; align-items: center; padding: .8rem .85rem; border: 1px solid color-mix(in srgb, var(--cx-brand) 9%, var(--cx-border)); border-radius: 13px; background: color-mix(in srgb, var(--cx-brand-soft) 18%, var(--cx-surface)); }
  .cx-account-permission-summary-icon { inline-size: 30px; block-size: 30px; display: grid; place-items: center; border-radius: 10px; color: var(--cx-brand); background: color-mix(in srgb, var(--cx-brand-soft) 76%, var(--cx-surface)); font-size: .74rem; font-weight: 1000; }
  .cx-account-permission-summary-item > span:last-child { min-inline-size: 0; display: grid; gap: .14rem; }
  .cx-account-permission-summary-item strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .78rem; }
  .cx-account-permission-summary-item small { color: var(--cx-muted); font-size: .65rem; font-weight: 780; }
  .cx-account-inline-notice { margin-block-start: .72rem; padding: .7rem .8rem; border-radius: 11px; background: color-mix(in srgb, var(--cx-warning-soft, #fff6dc) 72%, var(--cx-surface)); color: var(--cx-warning-strong, #8a5a00); font-size: .74rem; font-weight: 850; }
  .cx-account-security-grid { display: grid; grid-template-columns: minmax(340px, .9fr) minmax(0, 1.1fr); gap: 1rem; align-items: start; min-inline-size: 0; }
  .cx-account-session-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .7rem; }
  .cx-account-session-grid .cx-account-info-item:last-child:nth-child(odd) { grid-column: 1 / -1; }
  .cx-account-avatar {
    inline-size: 68px;
    block-size: 68px;
    border-radius: 24px;
    display: grid;
    place-items: center;
    color: #fff;
    font-weight: 950;
    font-size: 1.35rem;
    background: linear-gradient(135deg, var(--cx-brand), var(--cx-accent));
    box-shadow: 0 14px 28px rgba(132,47,214,.2);
  }
  .cx-account-interface-preference { overflow: hidden; }
  .cx-account-interface-preference .cx-card-header > div { min-width: 0; }
  .cx-account-interface-preference .cx-card-header h2 { margin: 0 0 .2rem; }
  .cx-account-interface-preference .cx-card-header p { margin: 0; }
  .cx-account-interface-body { display: grid; gap: 1rem; }
  .cx-account-interface-group { display: grid; gap: .62rem; }
  .cx-account-interface-group + .cx-account-interface-group {
    padding-top: .9rem;
    border-top: 1px solid var(--cx-border);
  }
  .cx-account-interface-group-head { display: flex; align-items: end; justify-content: space-between; gap: .8rem; }
  .cx-account-interface-group-head h3 { margin: 0; font-size: .98rem; }
  .cx-account-interface-group-head span { color: var(--cx-muted); font-size: .76rem; font-weight: 750; }
  .cx-account-interface-options {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .78rem;
  }
  .cx-account-interface-option {
    position: relative;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: .78rem;
    min-height: 92px;
    padding: .9rem 1rem;
    border: 1px solid var(--cx-border);
    border-radius: var(--cx-radius-lg);
    background: color-mix(in srgb, var(--cx-surface) 94%, var(--cx-bg));
    cursor: pointer;
    transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease, background .18s ease;
  }
  .cx-account-interface-option:hover { border-color: color-mix(in srgb, var(--cx-brand) 42%, var(--cx-border)); transform: translateY(-1px); }
  .cx-account-interface-option[data-selected="true"] {
    border-color: color-mix(in srgb, var(--cx-brand) 62%, var(--cx-border));
    background: linear-gradient(135deg, color-mix(in srgb, var(--cx-brand-soft) 74%, var(--cx-surface)), var(--cx-surface));
    box-shadow: 0 10px 24px color-mix(in srgb, var(--cx-brand) 12%, transparent);
  }
  .cx-account-interface-option input { position: absolute; inline-size: 1px; block-size: 1px; opacity: 0; pointer-events: none; }
  .cx-account-interface-option:focus-within { outline: 3px solid color-mix(in srgb, var(--cx-brand) 24%, transparent); outline-offset: 2px; }
  .cx-account-interface-option__icon {
    inline-size: 42px;
    block-size: 42px;
    border-radius: 14px;
    display: grid;
    place-items: center;
    color: var(--cx-brand);
    background: color-mix(in srgb, var(--cx-brand-soft) 78%, var(--cx-surface));
    font-size: 1.2rem;
    font-weight: 950;
  }
  .cx-account-interface-option__copy { display: grid; gap: .22rem; min-width: 0; }
  .cx-account-interface-option__copy strong { font-size: .98rem; }
  .cx-account-interface-option__copy small { color: var(--cx-muted); line-height: 1.55; }
  .cx-account-interface-preview {
    inline-size: 58px;
    block-size: 42px;
    position: relative;
    overflow: hidden;
    border: 1px solid color-mix(in srgb, var(--cx-brand) 18%, var(--cx-border));
    border-radius: 11px;
    background: var(--cx-surface);
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--cx-surface) 70%, transparent);
  }
  .cx-account-interface-preview i,
  .cx-account-interface-preview b,
  .cx-account-interface-preview em { position: absolute; display: block; border-radius: 3px; }
  .cx-account-interface-preview[data-preview="side"] i { inset-block: 4px; inset-inline-start: 4px; inline-size: 12px; background: color-mix(in srgb, var(--cx-brand) 72%, white); }
  .cx-account-interface-preview[data-preview="side"] b { inset-block-start: 5px; inset-inline: 20px 5px; block-size: 7px; background: color-mix(in srgb, var(--cx-brand-soft) 72%, var(--cx-surface)); }
  .cx-account-interface-preview[data-preview="side"] em { inset-block: 16px 5px; inset-inline: 20px 5px; background: color-mix(in srgb, var(--cx-border) 58%, transparent); }
  .cx-account-interface-preview[data-preview="top"] i { inset-block-start: 4px; inset-inline: 4px; block-size: 9px; background: color-mix(in srgb, var(--cx-brand) 72%, white); }
  .cx-account-interface-preview[data-preview="top"] b { inset-block-start: 17px; inset-inline: 4px; block-size: 5px; background: color-mix(in srgb, var(--cx-brand-soft) 76%, var(--cx-surface)); }
  .cx-account-interface-preview[data-preview="top"] em { inset-block: 26px 5px; inset-inline: 4px; background: color-mix(in srgb, var(--cx-border) 58%, transparent); }
  .cx-account-interface-save {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: .8rem;
    padding-top: .9rem;
    border-top: 1px solid var(--cx-border);
  }
  .cx-account-profile-main h2 { margin: 0; }
  .cx-account-profile-main p { margin: .25rem 0 0; color: var(--cx-muted); font-weight: 850; }
  .cx-account-profile-meta { display: grid; justify-items: end; gap: .25rem; color: var(--cx-muted); font-weight: 850; }
  .cx-mini-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    padding: .9rem;
    border: 1px solid var(--cx-border);
    border-radius: var(--cx-radius-lg);
    background: color-mix(in srgb, var(--cx-surface) 90%, transparent);
  }
  .cx-permission-groups { display: grid; gap: .8rem; }
  .cx-permission-group {
    display: grid;
    gap: .5rem;
    padding: .9rem;
    border: 1px solid var(--cx-border);
    border-radius: var(--cx-radius-lg);
    background: color-mix(in srgb, var(--cx-bg) 52%, var(--cx-surface));
  }
  .cx-permission-group h3 { margin: 0; font-size: 1rem; }
  @media (max-width: 1120px) {
    .cx-account-primary-grid, .cx-account-security-grid { grid-template-columns: minmax(0, 1fr); }
    .cx-account-permission-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  }
  @media (max-width: 760px) {
    .cx-account-sticky-head { position: static; padding-block: 0; background: transparent; }
    .cx-account-sticky-head::after { display: none; }
    .cx-account-profile-card { grid-template-columns: 1fr; text-align: center; }
    .cx-account-tabs .cx-local-tab { min-inline-size: 0; }
    .cx-account-info-grid, .cx-account-session-grid, .cx-account-permission-summary { grid-template-columns: minmax(0, 1fr); }
    .cx-account-interface-options { grid-template-columns: 1fr; }
    .cx-account-interface-group-head { align-items: flex-start; flex-direction: column; gap: .25rem; }
    .cx-account-interface-save { align-items: stretch; flex-direction: column; }
    .cx-account-interface-save .cx-btn { width: 100%; }
    .cx-account-avatar { margin-inline: auto; }
    .cx-account-profile-meta { justify-items: center; }
    .cx-invoice-preview { grid-template-columns: 1fr; }
    .cx-save-row { justify-content: stretch; }
    .cx-save-row .cx-btn { width: 100%; }
  }
}

@layer layout {
  .cx-default-branch-button {
    border: 1px solid color-mix(in srgb, var(--cx-brand) 24%, var(--cx-border));
    background: linear-gradient(135deg, color-mix(in srgb, var(--cx-brand-soft) 76%, transparent), var(--cx-surface));
    color: var(--cx-ink);
    border-radius: 999px;
    padding: .48rem .78rem;
    display: inline-flex;
    align-items: center;
    gap: .48rem;
    cursor: pointer;
    box-shadow: 0 10px 24px color-mix(in srgb, var(--cx-brand) 8%, transparent);
    transition: transform var(--cx-transition), border-color var(--cx-transition), box-shadow var(--cx-transition);
  }
  .cx-default-branch-button:hover {
    transform: translateY(-1px);
    border-color: color-mix(in srgb, var(--cx-brand) 48%, var(--cx-border));
    box-shadow: 0 14px 30px color-mix(in srgb, var(--cx-brand) 12%, transparent);
  }
  .cx-default-branch-button span {
    color: var(--cx-muted);
    font-size: .78rem;
    font-weight: 800;
  }
  .cx-default-branch-button strong { font-weight: 950; }

  .cx-branch-scope-backdrop {
    position: fixed;
    inset: 0;
    z-index: var(--cx-z-modal, 1100);
    display: grid;
    place-items: center;
    padding: 1rem;
    background: color-mix(in srgb, var(--cx-bg) 70%, rgba(0,0,0,.45));
    backdrop-filter: blur(10px);
  }
  .cx-branch-scope-modal {
    width: min(720px, 100%);
    max-height: min(78dvh, 720px);
    overflow: auto;
    background: var(--cx-surface);
    border: 1px solid var(--cx-border);
    border-radius: 1.35rem;
    box-shadow: var(--cx-shadow-lg);
    padding: 1rem;
  }
  .cx-branch-scope-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    padding: .35rem .35rem 1rem;
    border-bottom: 1px solid var(--cx-border);
    margin-bottom: .75rem;
  }
  .cx-branch-scope-head h2 { margin: 0 0 .25rem; }
  .cx-branch-scope-head p { margin: 0; color: var(--cx-muted); }
  .cx-branch-scope-list { display: grid; gap: .55rem; }
  .cx-branch-scope-row {
    width: 100%;
    border: 1px solid var(--cx-border);
    border-radius: 1rem;
    background: color-mix(in srgb, var(--cx-surface) 88%, var(--cx-brand-soft));
    color: var(--cx-ink);
    padding: .78rem .9rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    text-align: start;
    cursor: pointer;
    transition: background var(--cx-transition), transform var(--cx-transition), border-color var(--cx-transition);
  }
  .cx-branch-scope-row:hover:not(:disabled) {
    transform: translateY(-1px);
    border-color: color-mix(in srgb, var(--cx-brand) 35%, var(--cx-border));
    background: color-mix(in srgb, var(--cx-brand-soft) 82%, var(--cx-surface));
  }
  .cx-branch-scope-row[aria-current="true"] {
    border-color: color-mix(in srgb, var(--cx-brand) 55%, var(--cx-border));
    background: linear-gradient(135deg, color-mix(in srgb, var(--cx-brand-soft) 86%, transparent), var(--cx-surface));
  }
  .cx-branch-scope-row:disabled { opacity: .58; cursor: not-allowed; }
  .cx-branch-scope-row small { display:block; color: var(--cx-muted); margin-top: .18rem; }
}

/* Phase 37T: Scope filter default-branch source badge */
.cx-scope-source-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  background: rgba(124, 58, 237, 0.10);
  color: #5b21b6;
  font-size: 0.72rem;
  font-style: normal;
  font-weight: 700;
  white-space: nowrap;
}
[data-theme="dark"] .cx-scope-source-pill { background: rgba(196, 181, 253, 0.14); color: #ddd6fe; }

/* B3.4 — tenant billing notice banner */
.cx-tenant-billing-notice {
  margin: 1rem 1.25rem 0;
  border: 1px solid rgba(245, 158, 11, .34);
  border-radius: 1.15rem;
  background: linear-gradient(135deg, rgba(255,251,235,.98), rgba(254,243,199,.92));
  color: #7c2d12;
  padding: .95rem 1rem;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  box-shadow: 0 12px 30px rgba(245, 158, 11, .12);
}
.cx-tenant-billing-notice strong { display:block; font-weight: 900; margin-bottom: .2rem; }
.cx-tenant-billing-notice p { margin: 0; line-height: 1.5; font-weight: 700; }
.cx-tenant-billing-notice [data-dismiss-billing-notice] { min-width: 2.25rem; }
[data-theme="dark"] .cx-tenant-billing-notice {
  background: linear-gradient(135deg, rgba(120, 53, 15, .42), rgba(146, 64, 14, .28));
  color: #fde68a;
  border-color: rgba(251, 191, 36, .38);
}

@layer layout {
  .cx-branch-scope-backdrop{overflow:auto;overscroll-behavior:contain;padding:max(.5rem,env(safe-area-inset-top)) max(.5rem,env(safe-area-inset-right)) max(.5rem,env(safe-area-inset-bottom)) max(.5rem,env(safe-area-inset-left))}
  .cx-branch-scope-modal{max-height:calc(100dvh - 1rem);overscroll-behavior:contain;scrollbar-gutter:stable}
}


/* 2026-09 Shell viewport/strip contract — stable on browser chrome changes and common zoom levels. */
@layer components{.cx-shell,.cx-main,.cx-sidebar{min-height:0}.cx-shell{height:var(--cx-viewport-block,100dvh);min-height:var(--cx-viewport-block,100dvh)}.cx-sidebar{height:var(--cx-viewport-block,100dvh);max-height:var(--cx-viewport-block,100dvh)}.cx-main{height:var(--cx-viewport-block,100dvh);max-height:var(--cx-viewport-block,100dvh)}.cx-content{min-height:0;max-width:100%;overflow:auto;overscroll-behavior:contain;scrollbar-gutter:stable}.cx-local-tabs,.cx-settings-tabs,.cx-modern-tabs{max-width:100%;overflow-x:auto;overflow-y:hidden;overscroll-behavior-inline:contain;-webkit-overflow-scrolling:touch;scrollbar-gutter:stable}.cx-local-tab,.cx-settings-tab{flex:0 0 auto}}


.cx-recovery-bell{position:relative;border:1px solid var(--cx-border);background:var(--cx-surface);border-radius:12px;min-width:42px;height:40px;cursor:pointer;font-size:19px}.cx-recovery-bell.has-alerts{box-shadow:0 0 0 2px rgba(220,53,69,.12)}.cx-recovery-bell [data-order-recovery-count]{position:absolute;inset-inline-start:-6px;top:-7px;min-width:20px;height:20px;padding:0 5px;border-radius:999px;background:#b42318;color:#fff;font:700 11px/20px system-ui;text-align:center}.cx-recovery-overlay{position:fixed;inset:0;z-index:99990;background:rgba(10,15,25,.62);display:flex;justify-content:center;overflow:auto;align-items:center;padding:max(8px,env(safe-area-inset-top)) 10px}.cx-recovery-dialog{background:var(--cx-surface,#fff);border:1px solid var(--cx-border,#ddd);border-radius:18px;box-shadow:0 24px 80px rgba(0,0,0,.25);direction:rtl;width:fit-content;min-width:min(400px,calc(100vw - 20px));max-width:min(1100px,calc(100vw - 20px));max-height:calc(100dvh - 20px);overflow:auto;padding:12px 16px}.cx-recovery-dialog>header{display:flex;justify-content:space-between;gap:16px;align-items:flex-start;border-bottom:1px solid var(--cx-border,#ddd);padding-bottom:12px}.cx-recovery-dialog h2{margin:0 0 6px}.cx-recovery-summary{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:4px 18px;margin:10px 0}.cx-recovery-summary>div,.cx-recovery-state,.cx-recovery-problem{border-block-end:1px solid var(--cx-border-soft,var(--cx-border));padding:6px 0}.cx-recovery-summary span,.cx-recovery-state span{display:block;font-size:12px;opacity:.7}.cx-recovery-states{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:4px 18px}.cx-recovery-state strong{display:block;margin:4px 0}.cx-recovery-actions{display:flex;gap:8px;flex-wrap:wrap;margin-top:16px}.cx-recovery-discard-box{margin-top:12px;border:1px solid #f0b4b4;border-radius:12px;padding:12px}.cx-recovery-discard-box textarea{width:100%;margin-top:6px}.cx-recovery-issues{display:grid;gap:8px;margin-top:14px}.cx-recovery-issue{display:flex;justify-content:space-between;gap:12px;text-align:inherit;padding:12px;border:1px solid var(--cx-border,#ddd);background:transparent;border-radius:12px;cursor:pointer}.cx-recovery-issue div{display:flex;flex-direction:column;gap:3px}.cx-recovery-loading,.cx-empty{padding:36px;text-align:center}@media(max-width:760px){.cx-recovery-summary,.cx-recovery-states{grid-template-columns:1fr 1fr;gap:4px 18px}}@media(max-width:500px){.cx-recovery-summary,.cx-recovery-states{grid-template-columns:1fr;gap:4px 18px}}
.cx-recovery-group{display:grid;gap:8px}.cx-recovery-group+h3,.cx-recovery-group+section{margin-top:10px}.cx-recovery-group>h3{display:flex;align-items:center;gap:8px;margin:8px 0 0;font-size:14px}.cx-recovery-group>h3 span{display:inline-grid;place-items:center;min-width:22px;height:22px;padding:0 6px;border-radius:999px;background:var(--cx-surface-muted,#f2f4f7);font-size:12px}.cx-recovery-tech{margin-top:14px;border-top:1px dashed var(--cx-border,#ddd);padding-top:10px}.cx-recovery-tech summary{cursor:pointer;font-size:12px;opacity:.72}.cx-recovery-tech>div{margin-top:8px;font-size:12px;opacity:.8;overflow-wrap:anywhere}.cx-recovery-issue>div:last-child{max-width:48%;align-items:flex-end}.cx-recovery-issue>div:last-child span{font-size:12px;line-height:1.55;color:var(--cx-text-muted,#667085)}

/* Installed app / global Call Center notification badge. */
.cx-nav-live-badge{
  min-width:1.45rem;
  height:1.45rem;
  padding:0 .38rem;
  border-radius:999px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  flex:0 0 auto;
  background:var(--cx-danger,#b42318);
  color:#fff;
  font-size:.72rem;
  font-weight:950;
  line-height:1;
  box-shadow:0 0 0 2px color-mix(in srgb,var(--cx-danger,#b42318) 16%,transparent);
}
.cx-nav-live-badge[hidden]{display:none!important;}

/* Costix tenant shell — user-selectable top navigation.
   Same route/permission model as the sidebar; only one navigation renderer is active at a time. */
@layer layout {
  .cx-topnav-brand,
  .cx-topnav-mobile-toggle,
  .cx-topnav,
  .cx-topnav-mobile-backdrop { display: none; }

  .cx-shell[data-ui-skin="backoffice"][data-shell-mode="tenant_app"][data-navigation-mode="side"] .cx-default-branch-company { display: none; }
  .cx-shell[data-ui-skin="backoffice"][data-shell-mode="tenant_app"][data-navigation-mode="side"] .cx-default-branch-button small[data-default-branch-label] {
    display: block;
    max-inline-size: 112px;
    color: #43374e;
    font-size: .72rem;
    font-weight: 850;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .cx-shell[data-ui-skin="backoffice"]:is([data-shell-mode="tenant_app"],[data-shell-mode="super_admin"])[data-navigation-mode="top"] {
    --cx-topbar-height: 74px;
    grid-template-columns: minmax(0, 1fr);
  }
  .cx-shell[data-ui-skin="backoffice"]:is([data-shell-mode="tenant_app"],[data-shell-mode="super_admin"])[data-navigation-mode="top"] .cx-sidebar,
  .cx-shell[data-ui-skin="backoffice"]:is([data-shell-mode="tenant_app"],[data-shell-mode="super_admin"])[data-navigation-mode="top"] .cx-sidebar-backdrop { display: none !important; }
  .cx-shell[data-ui-skin="backoffice"]:is([data-shell-mode="tenant_app"],[data-shell-mode="super_admin"])[data-navigation-mode="top"] .cx-main {
    grid-column: 1;
    inline-size: 100%;
  }
  .cx-shell[data-ui-skin="backoffice"]:is([data-shell-mode="tenant_app"],[data-shell-mode="super_admin"])[data-navigation-mode="top"] .cx-topbar {
    min-inline-size: 0;
    max-inline-size: 100%;
    min-height: var(--cx-topbar-height);
    height: var(--cx-topbar-height);
    display: flex;
    align-items: center;
    gap: clamp(.7rem, 1.2vw, 1.2rem);
    padding: 0 clamp(.9rem, 1.8vw, 1.8rem);
    background: color-mix(in srgb, var(--cx-surface) 95%, transparent);
    border-block-end: 1px solid color-mix(in srgb, var(--cx-brand) 10%, var(--cx-border));
    box-shadow: 0 5px 18px rgba(36,16,102,.045);
    backdrop-filter: blur(15px);
  }
  .cx-shell[data-ui-skin="backoffice"]:is([data-shell-mode="tenant_app"],[data-shell-mode="super_admin"])[data-navigation-mode="top"] .cx-topbar-start {
    flex: 0 0 auto;
    gap: .55rem;
  }
  .cx-shell[data-ui-skin="backoffice"]:is([data-shell-mode="tenant_app"],[data-shell-mode="super_admin"])[data-navigation-mode="top"] .cx-sidebar-toggle,
  .cx-shell[data-ui-skin="backoffice"]:is([data-shell-mode="tenant_app"],[data-shell-mode="super_admin"])[data-navigation-mode="top"] .cx-topbar-title-block { display: none; }
  .cx-shell[data-ui-skin="backoffice"]:is([data-shell-mode="tenant_app"],[data-shell-mode="super_admin"])[data-navigation-mode="top"] .cx-topnav-brand {
    flex: 0 0 auto;
    min-inline-size: 0;
    display: flex;
    align-items: center;
    gap: .58rem;
    color: #2d2340;
    text-decoration: none;
    white-space: nowrap;
  }
  .cx-shell[data-ui-skin="backoffice"]:is([data-shell-mode="tenant_app"],[data-shell-mode="super_admin"])[data-navigation-mode="top"] .cx-topnav-brand-mark {
    inline-size: 50px;
    block-size: 50px;
    flex: 0 0 50px;
    display: grid;
    place-items: center;
    overflow: visible;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
  }
  .cx-shell[data-ui-skin="backoffice"]:is([data-shell-mode="tenant_app"],[data-shell-mode="super_admin"])[data-navigation-mode="top"] .cx-topnav-brand-mark img {
    inline-size: 48px;
    block-size: 48px;
    object-fit: contain;
    object-position: center;
    filter: drop-shadow(0 3px 6px rgba(49,24,88,.18));
  }
  .cx-shell[data-ui-skin="backoffice"]:is([data-shell-mode="tenant_app"],[data-shell-mode="super_admin"])[data-navigation-mode="top"] .cx-topnav-brand-copy { display: grid; gap: .08rem; }
  .cx-shell[data-ui-skin="backoffice"]:is([data-shell-mode="tenant_app"],[data-shell-mode="super_admin"])[data-navigation-mode="top"] .cx-topnav-brand strong {
    color: #2b2140;
    font-size: 1.05rem;
    font-weight: 950;
    line-height: 1.05;
  }
  .cx-shell[data-ui-skin="backoffice"]:is([data-shell-mode="tenant_app"],[data-shell-mode="super_admin"])[data-navigation-mode="top"] .cx-topnav-brand small {
    color: #92889e;
    font-size: .58rem;
    font-weight: 750;
    letter-spacing: .02em;
  }

  .cx-shell[data-ui-skin="backoffice"]:is([data-shell-mode="tenant_app"],[data-shell-mode="super_admin"])[data-navigation-mode="top"] .cx-topnav {
    min-width: 0;
    flex: 1 1 auto;
    display: flex;
    align-items: center;
    gap: .12rem;
    overflow: visible;
  }
  .cx-topnav-group { flex: 0 1 auto; min-inline-size: 0; display: flex; }
  .cx-topnav-trigger,
  .cx-topnav-direct {
    min-height: 40px;
    min-inline-size: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .42rem;
    padding: 0 .72rem;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: #5d5669;
    font: inherit;
    font-size: .76rem;
    font-weight: 850;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
    transition: color 150ms ease, background 150ms ease, transform 150ms ease;
  }
  .cx-topnav-trigger { flex: 0 1 auto; inline-size: auto; max-inline-size: 100%; }
  .cx-topnav-trigger-icon,
  .cx-topnav-direct-icon {
    inline-size: 18px;
    block-size: 18px;
    flex: 0 0 18px;
    display: inline-grid;
    place-items: center;
    color: currentColor;
  }
  .cx-topnav-trigger-icon .cx-nav-icon-modern,
  .cx-topnav-direct-icon .cx-nav-icon-modern { display: inline-grid; }
  .cx-topnav-trigger-icon .cx-nav-icon-legacy,
  .cx-topnav-direct-icon .cx-nav-icon-legacy { display: none; }
  .cx-topnav-trigger-icon .cx-nav-svg,
  .cx-topnav-direct-icon .cx-nav-svg { inline-size: 17px; block-size: 17px; }
  .cx-topnav-trigger-label { min-inline-size: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .cx-topnav-direct > span:last-child { min-inline-size: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .cx-topnav-direct { flex: 0 1 auto; min-inline-size: 0; }
  .cx-topnav-trigger:hover,
  .cx-topnav-trigger[aria-expanded="true"],
  .cx-topnav-group[data-active-group] > .cx-topnav-trigger,
  .cx-topnav-direct:hover,
  .cx-topnav-direct.is-active,
  .cx-topnav-direct[aria-current="page"] {
    color: #642caf;
    background: color-mix(in srgb, var(--cx-brand-soft) 74%, var(--cx-surface));
  }
  .cx-topnav-trigger:focus-visible,
  .cx-topnav-direct:focus-visible,
  .cx-topnav-menu-link:focus-visible {
    outline: 2px solid color-mix(in srgb, var(--cx-brand) 55%, transparent);
    outline-offset: 2px;
  }
  .cx-topnav-direct-icon .cx-nav-svg { inline-size: 15px; block-size: 15px; }
  .cx-topnav-trigger-caret { display: inline-grid; place-items: center; color: #a39aaa; transition: transform 160ms ease; }
  .cx-topnav-trigger-caret .cx-nav-chevron-legacy { display: none; }
  .cx-topnav-trigger-caret .cx-nav-chevron-modern { display: inline-grid; }
  .cx-topnav-trigger-caret .cx-nav-chevron-svg { inline-size: 12px; block-size: 12px; }
  .cx-topnav-trigger[aria-expanded="true"] .cx-topnav-trigger-caret { transform: rotate(180deg); color: #6b32ac; }

  .cx-topnav-dropdown {
    min-inline-size: 292px;
    max-inline-size: min(360px, calc(100vw - 24px));
    padding: .55rem;
    border: 1px solid color-mix(in srgb, var(--cx-brand) 10%, var(--cx-border));
    border-radius: 17px;
    background: var(--cx-surface);
    box-shadow: 0 24px 60px rgba(37,23,66,.16);
    color: var(--cx-text);
    z-index: 10020;
  }
  .cx-topnav-dropdown[hidden] { display: none !important; }
  .cx-topnav-dropdown[data-portaled="true"] { position: fixed; display: block; }
  .cx-topnav-dropdown-label {
    padding: .62rem .72rem .45rem;
    color: var(--cx-muted);
    font-size: .66rem;
    font-weight: 900;
  }
  .cx-topnav-dropdown-items { display: grid; gap: .18rem; }
  .cx-topnav-menu-divider {
    block-size: 1px;
    margin: .38rem .38rem .16rem;
    background: color-mix(in srgb, var(--cx-brand) 8%, var(--cx-border));
  }
  .cx-topnav-menu-link {
    min-height: 46px;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: .7rem;
    padding: .55rem .65rem;
    border-radius: 11px;
    color: #3f374a;
    text-decoration: none;
    transition: background 140ms ease, color 140ms ease, transform 140ms ease;
  }
  .cx-topnav-menu-link:hover,
  .cx-topnav-menu-link.is-active,
  .cx-topnav-menu-link[aria-current="page"] {
    background: color-mix(in srgb, var(--cx-brand-soft) 72%, var(--cx-surface));
    color: #642caf;
  }
  .cx-topnav-menu-link:hover { transform: translate3d(-1px,0,0); }
  .cx-topnav-menu-icon {
    inline-size: 30px;
    block-size: 30px;
    display: grid;
    place-items: center;
    border-radius: 9px;
    color: #7652a0;
    background: color-mix(in srgb, var(--cx-brand-soft) 62%, var(--cx-surface));
  }
  .cx-topnav-menu-icon .cx-nav-icon-legacy { display: none; }
  .cx-topnav-menu-icon .cx-nav-icon-modern { display: inline-grid; }
  .cx-topnav-menu-icon .cx-nav-svg { inline-size: 16px; block-size: 16px; }
  .cx-topnav-menu-copy { min-width: 0; display: grid; }
  .cx-topnav-menu-copy strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .79rem; }

  .cx-shell[data-ui-skin="backoffice"]:is([data-shell-mode="tenant_app"],[data-shell-mode="super_admin"])[data-navigation-mode="top"] .cx-topbar-actions {
    flex: 0 1 auto;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: .42rem;
  }
  .cx-shell[data-ui-skin="backoffice"]:is([data-shell-mode="tenant_app"],[data-shell-mode="super_admin"])[data-navigation-mode="top"] .cx-shell-search-anchor {
    inline-size: 40px;
    min-inline-size: 40px;
    max-inline-size: 40px;
    flex: 0 0 40px;
  }
  .cx-shell[data-ui-skin="backoffice"]:is([data-shell-mode="tenant_app"],[data-shell-mode="super_admin"])[data-navigation-mode="top"] .cx-shell-search-trigger {
    inline-size: 40px;
    min-inline-size: 40px;
    block-size: 40px;
    padding: 0;
    display: grid;
    place-items: center;
  }
  .cx-shell[data-ui-skin="backoffice"]:is([data-shell-mode="tenant_app"],[data-shell-mode="super_admin"])[data-navigation-mode="top"] .cx-shell-search-trigger > span { display: none; }
  .cx-shell[data-ui-skin="backoffice"]:is([data-shell-mode="tenant_app"],[data-shell-mode="super_admin"])[data-navigation-mode="top"] .cx-default-branch-button {
    min-height: 40px;
    max-inline-size: 180px;
    padding-inline: .62rem;
  }
  .cx-shell[data-ui-skin="backoffice"]:is([data-shell-mode="tenant_app"],[data-shell-mode="super_admin"])[data-navigation-mode="top"] .cx-default-branch-copy {
    display: grid;
    gap: .02rem;
    min-width: 0;
    text-align: start;
  }
  .cx-shell[data-ui-skin="backoffice"]:is([data-shell-mode="tenant_app"],[data-shell-mode="super_admin"])[data-navigation-mode="top"] .cx-default-branch-company {
    display: block;
    max-inline-size: 112px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #43374e;
    font-size: .7rem;
    font-weight: 900;
  }
  .cx-shell[data-ui-skin="backoffice"]:is([data-shell-mode="tenant_app"],[data-shell-mode="super_admin"])[data-navigation-mode="top"] .cx-default-branch-button small[data-default-branch-label] {
    display: block;
    max-inline-size: 112px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #9a8fa5;
    font-size: .58rem;
    font-weight: 760;
  }

  .cx-topnav-mobile-toggle {
    inline-size: 40px;
    block-size: 40px;
    border: 1px solid color-mix(in srgb, var(--cx-brand) 13%, var(--cx-border));
    border-radius: 11px;
    background: var(--cx-surface);
    color: var(--cx-brand);
    place-items: center;
    cursor: pointer;
  }
  .cx-topnav-mobile-toggle svg { inline-size: 18px; block-size: 18px; }
  .cx-topnav-mobile-backdrop {
    position: fixed;
    inset: var(--cx-topbar-height, 74px) 0 0;
    z-index: 69;
    border: 0;
    background: rgba(28,18,47,.34);
    backdrop-filter: blur(2px);
  }

  @media (max-width: 1380px) {
    .cx-shell[data-ui-skin="backoffice"]:is([data-shell-mode="tenant_app"],[data-shell-mode="super_admin"])[data-navigation-mode="top"] .cx-topbar { gap: .5rem; padding-inline: .8rem; }
    .cx-shell[data-ui-skin="backoffice"]:is([data-shell-mode="tenant_app"],[data-shell-mode="super_admin"])[data-navigation-mode="top"] .cx-topnav-brand { gap: .48rem; }
    .cx-shell[data-ui-skin="backoffice"]:is([data-shell-mode="tenant_app"],[data-shell-mode="super_admin"])[data-navigation-mode="top"] .cx-topnav-brand-mark { inline-size: 46px; block-size: 46px; flex-basis: 46px; }
    .cx-shell[data-ui-skin="backoffice"]:is([data-shell-mode="tenant_app"],[data-shell-mode="super_admin"])[data-navigation-mode="top"] .cx-topnav-brand-mark img { inline-size: 44px; block-size: 44px; }
    .cx-topnav-trigger, .cx-topnav-direct { padding-inline: .52rem; font-size: .7rem; }
    .cx-shell[data-ui-skin="backoffice"]:is([data-shell-mode="tenant_app"],[data-shell-mode="super_admin"])[data-navigation-mode="top"] .cx-default-branch-button { max-inline-size: 155px; }
  }

  @media (max-width: 1180px) {
    .cx-shell[data-ui-skin="backoffice"]:is([data-shell-mode="tenant_app"],[data-shell-mode="super_admin"])[data-navigation-mode="top"] { --cx-topbar-height: 66px; }
    .cx-shell[data-ui-skin="backoffice"]:is([data-shell-mode="tenant_app"],[data-shell-mode="super_admin"])[data-navigation-mode="top"] .cx-topbar {
      padding-inline: .65rem;
      gap: .42rem;
      z-index: 80;
    }
    .cx-shell[data-ui-skin="backoffice"]:is([data-shell-mode="tenant_app"],[data-shell-mode="super_admin"])[data-navigation-mode="top"] .cx-topnav-brand { min-inline-size: 0; gap: .42rem; }
    .cx-shell[data-ui-skin="backoffice"]:is([data-shell-mode="tenant_app"],[data-shell-mode="super_admin"])[data-navigation-mode="top"] .cx-topnav-brand-mark { inline-size: 42px; block-size: 42px; flex-basis: 42px; }
    .cx-shell[data-ui-skin="backoffice"]:is([data-shell-mode="tenant_app"],[data-shell-mode="super_admin"])[data-navigation-mode="top"] .cx-topnav-brand-mark img { inline-size: 40px; block-size: 40px; }
    .cx-shell[data-ui-skin="backoffice"]:is([data-shell-mode="tenant_app"],[data-shell-mode="super_admin"])[data-navigation-mode="top"] .cx-topnav-brand strong { font-size: .94rem; }
    .cx-shell[data-ui-skin="backoffice"]:is([data-shell-mode="tenant_app"],[data-shell-mode="super_admin"])[data-navigation-mode="top"] .cx-topnav-brand small { font-size: .52rem; }
    .cx-shell[data-ui-skin="backoffice"]:is([data-shell-mode="tenant_app"],[data-shell-mode="super_admin"])[data-navigation-mode="top"] .cx-topnav-mobile-toggle { display: grid; }
    .cx-shell[data-ui-skin="backoffice"]:is([data-shell-mode="tenant_app"],[data-shell-mode="super_admin"])[data-navigation-mode="top"] .cx-topnav {
      position: fixed;
      inset-block: var(--cx-topbar-height) 0;
      inset-inline-end: 0;
      z-index: 80;
      inline-size: min(380px, 92vw);
      padding: .85rem;
      display: none;
      flex-direction: column;
      align-items: stretch;
      gap: .18rem;
      overflow-y: auto;
      overscroll-behavior: contain;
      background: var(--cx-surface);
      border-inline-start: 1px solid var(--cx-border);
      box-shadow: -20px 0 50px rgba(37,23,66,.16);
    }
    .cx-shell[data-ui-skin="backoffice"]:is([data-shell-mode="tenant_app"],[data-shell-mode="super_admin"])[data-navigation-mode="top"][data-topnav-mobile-open="true"] .cx-topnav { display: flex; }
    .cx-shell[data-ui-skin="backoffice"]:is([data-shell-mode="tenant_app"],[data-shell-mode="super_admin"])[data-navigation-mode="top"][data-topnav-mobile-open="true"] .cx-topnav-mobile-backdrop { display: block; }
    .cx-shell[data-ui-skin="backoffice"]:is([data-shell-mode="tenant_app"],[data-shell-mode="super_admin"])[data-navigation-mode="top"][data-topnav-mobile-open="true"] .cx-content { overflow: hidden; }
    .cx-topnav-group { inline-size: 100%; display: block; }
    .cx-topnav-trigger,
    .cx-topnav-direct { inline-size: 100%; min-height: 46px; justify-content: space-between; padding-inline: .75rem; font-size: .8rem; }
    .cx-topnav-direct-icon { margin-inline-end: auto; }
    .cx-topnav-dropdown:not([data-portaled="true"]) {
      min-inline-size: 0;
      max-inline-size: none;
      inline-size: 100%;
      margin: .18rem 0 .45rem;
      padding: .35rem;
      border: 0;
      border-radius: 12px;
      background: color-mix(in srgb, var(--cx-bg) 58%, var(--cx-surface));
      box-shadow: none;
    }
    .cx-topnav-dropdown-label { padding-block-start: .45rem; }
    .cx-topnav-menu-link { min-height: 44px; }
  }

  @media (max-width: 720px) {
    .cx-shell[data-ui-skin="backoffice"]:is([data-shell-mode="tenant_app"],[data-shell-mode="super_admin"])[data-navigation-mode="top"] .cx-topnav-brand-copy { display: none; }
    .cx-shell[data-ui-skin="backoffice"]:is([data-shell-mode="tenant_app"],[data-shell-mode="super_admin"])[data-navigation-mode="top"] .cx-topbar-actions { margin-inline-start: auto; gap: .28rem; }
    .cx-shell[data-ui-skin="backoffice"]:is([data-shell-mode="tenant_app"],[data-shell-mode="super_admin"])[data-navigation-mode="top"] .cx-default-branch-button { max-inline-size: 122px; }
    .cx-shell[data-ui-skin="backoffice"]:is([data-shell-mode="tenant_app"],[data-shell-mode="super_admin"])[data-navigation-mode="top"] .cx-default-branch-company { max-inline-size: 76px; }
    .cx-shell[data-ui-skin="backoffice"]:is([data-shell-mode="tenant_app"],[data-shell-mode="super_admin"])[data-navigation-mode="top"] .cx-default-branch-button small[data-default-branch-label] { max-inline-size: 76px; }
  }

  @media (max-width: 560px) {
    .cx-shell[data-ui-skin="backoffice"]:is([data-shell-mode="tenant_app"],[data-shell-mode="super_admin"])[data-navigation-mode="top"] .cx-default-branch-button { inline-size: 40px; min-inline-size: 40px; padding: 0; }
    .cx-shell[data-ui-skin="backoffice"]:is([data-shell-mode="tenant_app"],[data-shell-mode="super_admin"])[data-navigation-mode="top"] .cx-default-branch-copy,
    .cx-shell[data-ui-skin="backoffice"]:is([data-shell-mode="tenant_app"],[data-shell-mode="super_admin"])[data-navigation-mode="top"] .cx-default-branch-button > svg:last-child { display: none; }
  }
}

@layer components {
  [data-theme="dark"] .cx-topnav-dropdown { background: #18131f; border-color: rgba(222,204,239,.13); box-shadow: 0 24px 60px rgba(0,0,0,.34); }
  [data-theme="dark"] .cx-topnav-menu-link { color: #ddd3e8; }
  [data-theme="dark"] .cx-topnav-menu-link:hover,
  [data-theme="dark"] .cx-topnav-menu-link.is-active,
  [data-theme="dark"] .cx-topnav-menu-link[aria-current="page"] { color: #f1e7ff; background: rgba(138,76,202,.18); }
  [data-theme="dark"] .cx-shell[data-ui-skin="backoffice"]:is([data-shell-mode="tenant_app"],[data-shell-mode="super_admin"])[data-navigation-mode="top"] .cx-topbar { background: rgba(24,19,31,.95); border-color: rgba(222,204,239,.1); }
  [data-theme="dark"] .cx-shell[data-ui-skin="backoffice"]:is([data-shell-mode="tenant_app"],[data-shell-mode="super_admin"])[data-navigation-mode="top"] .cx-topnav-brand strong { color: #f0e9f7; }
  [data-theme="dark"] .cx-shell[data-ui-skin="backoffice"]:is([data-shell-mode="tenant_app"],[data-shell-mode="super_admin"])[data-navigation-mode="top"] .cx-topnav-brand small { color: #a89ab6; }
  [data-theme="dark"] .cx-topnav-trigger,
  [data-theme="dark"] .cx-topnav-direct { color: #c8bdd3; }
  [data-theme="dark"] .cx-topnav-trigger:hover,
  [data-theme="dark"] .cx-topnav-trigger[aria-expanded="true"],
  [data-theme="dark"] .cx-topnav-group[data-active-group] > .cx-topnav-trigger,
  [data-theme="dark"] .cx-topnav-direct.is-active,
  [data-theme="dark"] .cx-topnav-direct[aria-current="page"] { color: #eadcff; background: rgba(138,76,202,.18); }
  [data-theme="dark"] .cx-shell[data-ui-skin="backoffice"]:is([data-shell-mode="tenant_app"],[data-shell-mode="super_admin"])[data-navigation-mode="top"] .cx-default-branch-company { color: #e9def2; }
  [data-theme="dark"] .cx-shell[data-ui-skin="backoffice"]:is([data-shell-mode="tenant_app"],[data-shell-mode="super_admin"])[data-navigation-mode="top"] .cx-topnav { background: #18131f; }
}


/* RR137 — Super Admin reuses the canonical top-navigation shell. */
.cx-shell[data-ui-skin="backoffice"][data-shell-mode="super_admin"][data-navigation-mode="top"] .cx-topbar-account--admin { margin-inline-start:auto; }
.cx-shell[data-ui-skin="backoffice"][data-shell-mode="super_admin"][data-navigation-mode="top"] .cx-admin-open-costix { white-space:nowrap; min-height:40px; }
@media (max-width:720px) {
  .cx-shell[data-ui-skin="backoffice"][data-shell-mode="super_admin"][data-navigation-mode="top"] .cx-admin-open-costix { display:none; }
}
