:where(.lf-sidebar:not(.sidebar)) {
  position: sticky;
  top: var(--lf-space-5);
  height: calc(100vh - 40px);
  display: flex;
  flex-direction: column;
  gap: var(--lf-space-3);
  overflow-y: auto;
  border: 1px solid var(--lf-color-border);
  border-radius: var(--lf-radius-xl);
  background: var(--lf-color-surface);
  color: var(--lf-color-text);
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.04);
}

/* Dashboard/sidebar legacy owns these dimensions during migration. */
:where(.sidebar .logo-link, .sidebar .logo-mark, .sidebar-company-logo-card, .sidebar-scope-logo) {
  flex-shrink: 0;
}

:where(.lf-sidebar-link:not(.nav-dot)) {
  min-height: 40px;
  display: flex;
  align-items: center;
  gap: var(--lf-space-3);
  border-radius: var(--lf-radius-md);
  color: var(--lf-color-muted);
  text-decoration: none;
  transition:
    color var(--lf-transition-fast),
    background var(--lf-transition-fast),
    transform var(--lf-transition-fast);
}

:where(.lf-sidebar-link:not(.nav-dot):hover, .lf-sidebar-link:not(.nav-dot).is-active) {
  background: var(--lf-color-primary-soft);
  color: var(--lf-color-primary);
}

:where(.lf-sidebar-link:not(.nav-dot):hover) {
  transform: translateX(2px);
}

:where(.lf-sidebar-link:not(.nav-dot).active) {
  background: var(--lf-color-primary-soft);
  color: var(--lf-color-primary);
}

@media (max-width: 980px) {
  :where(.lf-sidebar:not(.sidebar)) {
    position: relative;
    top: auto;
    height: auto;
  }
}

/* Unified app sidebar unified styles moved from global-design-system.css. */
body.dashboard-client-flat-theme .sidebar {
  background: transparent !important;
  background-color: transparent !important;
  border-color: transparent !important;
  box-shadow: none !important;
  transition: width 0.85s cubic-bezier(0.22, 1, 0.36, 1), min-width 0.85s cubic-bezier(0.22, 1, 0.36, 1), padding 0.85s cubic-bezier(0.22, 1, 0.36, 1) !important;
}

body.dashboard-client-flat-theme .sidebar-brand {
  position: relative !important;
  background: transparent !important;
  background-color: transparent !important;
  border-bottom: 1px solid transparent !important;
  box-shadow: none !important;
}

body.dashboard-client-flat-theme .sidebar-brand:has(.logo-link.has-image),
body[data-company-theme] > .shell .sidebar-brand:has(.logo-link.has-image) {
  align-items: center !important;
  flex-direction: column !important;
  gap: 8px !important;
  min-height: 0 !important;
  padding: 8px 6px 12px !important;
  text-align: center !important;
}

body.dashboard-client-flat-theme .sidebar-brand .logo-link.has-image,
body[data-company-theme] > .shell .sidebar-brand .logo-link.has-image {
  width: 54px !important;
  height: 54px !important;
  min-width: 54px !important;
  padding: 0 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  border-radius: 14px !important;
  background: transparent !important;
  box-shadow: none !important;
  overflow: hidden !important;
}

body.dashboard-client-flat-theme .sidebar-brand .logo-link,
body.dashboard-client-flat-theme .sidebar-brand .logo-link.has-image,
body.dashboard-client-flat-theme .sidebar-brand .logo-link--company.has-image,
body[data-company-theme] > .shell .sidebar-brand .logo-link,
body[data-company-theme] > .shell .sidebar-brand .logo-link.has-image,
body[data-company-theme] > .shell .sidebar-brand .logo-link--company.has-image {
  background: transparent !important;
  border-color: transparent !important;
  box-shadow: none !important;
  overflow: hidden !important;
}

body.dashboard-client-flat-theme .sidebar-brand .logo-link::before,
body.dashboard-client-flat-theme .sidebar-brand .logo-link::after,
body[data-company-theme] > .shell .sidebar-brand .logo-link::before,
body[data-company-theme] > .shell .sidebar-brand .logo-link::after {
  display: none !important;
  background: transparent !important;
  box-shadow: none !important;
}

body.dashboard-client-flat-theme .sidebar-brand .logo-link.has-image .logo-mark,
body[data-company-theme] > .shell .sidebar-brand .logo-link.has-image .logo-mark {
  width: 100% !important;
  height: 100% !important;
  max-width: 100% !important;
  max-height: 100% !important;
  object-fit: contain !important;
  background: transparent !important;
  padding: 0 !important;
  border-radius: 12px !important;
  overflow: hidden !important;
}

body.dashboard-client-flat-theme .sidebar-brand:has(.logo-link.has-image) .sidebar-brand-copy,
body[data-company-theme] > .shell .sidebar-brand:has(.logo-link.has-image) .sidebar-brand-copy {
  justify-items: center !important;
  gap: 0 !important;
  width: 100% !important;
}

body.dashboard-client-flat-theme .sidebar-brand:has(.logo-link.has-image) .sidebar-brand-copy strong,
body[data-company-theme] > .shell .sidebar-brand:has(.logo-link.has-image) .sidebar-brand-copy strong {
  font-size: 14px !important;
  line-height: 1.2 !important;
  text-align: center !important;
}

body.dashboard-client-flat-theme .sidebar-company-logo-card,
body[data-company-theme] > .shell .sidebar-company-logo-card {
  width: 100% !important;
  min-height: 78px !important;
  display: grid !important;
  place-items: center !important;
  padding: 4px 8px 6px !important;
  border: 1px solid rgba(148, 163, 184, 0.18) !important;
  border-radius: 14px !important;
  background: transparent !important;
  box-shadow: none !important;
}

body.dashboard-client-flat-theme .sidebar-scope-card,
body[data-company-theme] > .shell .sidebar-scope-card {
  align-items: center !important;
  justify-items: center !important;
  gap: 4px !important;
  padding: 6px 8px 10px !important;
  border-color: transparent !important;
  background: transparent !important;
  text-align: center !important;
}

body.dashboard-client-flat-theme .sidebar-scope-logo,
body[data-company-theme] > .shell .sidebar-scope-logo {
  width: min(100%, 168px) !important;
  max-width: 168px !important;
  height: 64px !important;
  display: block !important;
  object-fit: contain !important;
  object-position: center center !important;
  border-radius: 10px !important;
  background: transparent !important;
}

body.dashboard-client-flat-theme .sidebar-scope-copy,
body[data-company-theme] > .shell .sidebar-scope-copy {
  min-width: 0 !important;
  display: grid !important;
  gap: 3px !important;
}

body.dashboard-client-flat-theme .sidebar-scope-copy span,
body[data-company-theme] > .shell .sidebar-scope-copy span {
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: normal !important;
  line-height: 1.25 !important;
}

body.dashboard-client-flat-theme .sidebar-brand:has(.logo-link--app.has-image),
body.dashboard-client-flat-theme[data-company-theme] > .shell .sidebar-brand:has(.logo-link--app.has-image) {
  align-items: center !important;
  flex-direction: column !important;
  justify-content: center !important;
  gap: 8px !important;
  padding: 12px 10px 14px !important;
  text-align: center !important;
}

body.dashboard-client-flat-theme .sidebar-brand .logo-link--app.has-image,
body.dashboard-client-flat-theme[data-company-theme] > .shell .sidebar-brand .logo-link--app.has-image {
  width: 66px !important;
  height: 66px !important;
  min-width: 66px !important;
  max-width: 66px !important;
  padding: 0 !important;
  border-radius: 0 !important;
  overflow: visible !important;
}

body.dashboard-client-flat-theme .sidebar-brand .logo-link--app.has-image .logo-mark,
body.dashboard-client-flat-theme[data-company-theme] > .shell .sidebar-brand .logo-link--app.has-image .logo-mark {
  width: 66px !important;
  height: 66px !important;
  max-width: 66px !important;
  max-height: 66px !important;
  object-fit: contain !important;
  object-position: center center !important;
  border-radius: 0 !important;
  overflow: visible !important;
}

body.dashboard-client-flat-theme .sidebar-brand:has(.logo-link--app.has-image) .sidebar-brand-copy,
body.dashboard-client-flat-theme[data-company-theme] > .shell .sidebar-brand:has(.logo-link--app.has-image) .sidebar-brand-copy {
  justify-items: center !important;
  width: 100% !important;
  min-width: 0 !important;
}

body.dashboard-client-flat-theme .sidebar-brand:has(.logo-link--app.has-image) .sidebar-brand-copy strong,
body.dashboard-client-flat-theme[data-company-theme] > .shell .sidebar-brand:has(.logo-link--app.has-image) .sidebar-brand-copy strong {
  max-width: 100% !important;
  font-size: 18px !important;
  line-height: 1.08 !important;
  text-align: center !important;
  overflow: visible !important;
  text-overflow: clip !important;
  white-space: normal !important;
}

body.dashboard-client-flat-theme .sidebar-menu-toggle,
body[data-company-theme] > .shell .sidebar-menu-toggle {
  position: static !important;
  width: 30px !important;
  height: 30px !important;
  flex: 0 0 30px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  border: 1px solid rgba(148, 163, 184, 0.22) !important;
  border-radius: 10px !important;
  background: transparent !important;
  color: #64748b !important;
  box-shadow: none !important;
  cursor: pointer !important;
  transition: color 0.45s ease, border-color 0.45s ease, background 0.45s ease, transform 0.75s cubic-bezier(0.22, 1, 0.36, 1) !important;
}

body.dashboard-client-flat-theme .sidebar-menu-toggle svg,
body[data-company-theme] > .shell .sidebar-menu-toggle svg {
  width: 18px !important;
  height: 18px !important;
  display: block !important;
  transition: transform 0.75s cubic-bezier(0.22, 1, 0.36, 1) !important;
}

body.dashboard-client-flat-theme .sidebar-menu-toggle:hover,
body[data-company-theme] > .shell .sidebar-menu-toggle:hover,
body.dashboard-client-flat-theme .sidebar-menu-toggle[aria-expanded="false"],
body[data-company-theme] > .shell .sidebar-menu-toggle[aria-expanded="false"] {
  color: #2563eb !important;
  border-color: rgba(37, 99, 235, 0.24) !important;
  background: rgba(37, 99, 235, 0.06) !important;
}

body.dashboard-client-flat-theme .sidebar.is-sidebar-collapsed .sidebar-menu-toggle svg,
body[data-company-theme] > .shell .sidebar.is-sidebar-collapsed .sidebar-menu-toggle svg {
  transform: rotate(180deg) !important;
}

body.dashboard-client-flat-theme .sidebar-menu-panel,
body[data-company-theme] > .shell .sidebar-menu-panel {
  display: grid !important;
  grid-template-rows: auto 1fr !important;
  gap: 10px !important;
  opacity: 1 !important;
  overflow: visible !important;
  transition: opacity 0.65s ease !important;
}

body.dashboard-client-flat-theme .sidebar-section-title--toggle,
body[data-company-theme] > .shell .sidebar-section-title--toggle {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 8px !important;
}

body.dashboard-client-flat-theme .sidebar-section-title--toggle > span,
body[data-company-theme] > .shell .sidebar-section-title--toggle > span,
body.dashboard-client-flat-theme .sidebar-brand-copy,
body[data-company-theme] > .shell .sidebar-brand-copy,
body.dashboard-client-flat-theme .nav-label,
body[data-company-theme] > .shell .nav-label,
body.dashboard-client-flat-theme .sidebar-industry,
body[data-company-theme] > .shell .sidebar-industry,
body.dashboard-client-flat-theme .sidebar-section-title:not(.sidebar-section-title--toggle),
body[data-company-theme] > .shell .sidebar-section-title:not(.sidebar-section-title--toggle),
body.dashboard-client-flat-theme .sidebar-footer-link > span:nth-child(2),
body[data-company-theme] > .shell .sidebar-footer-link > span:nth-child(2),
body.dashboard-client-flat-theme .sidebar-footer-link span:last-child,
body[data-company-theme] > .shell .sidebar-footer-link span:last-child {
  transition: opacity 0.45s ease, transform 0.7s cubic-bezier(0.22, 1, 0.36, 1), width 0.7s cubic-bezier(0.22, 1, 0.36, 1) !important;
}

body.dashboard-client-flat-theme > .shell > aside.sidebar,
body.dashboard-client-flat-theme > .shell > .sidebar,
body[data-company-theme] > .shell > aside.sidebar,
body[data-company-theme] > .shell > .sidebar,
body.lf-clean-theme > .shell > aside.sidebar,
body.lf-clean-theme > .shell > .sidebar {
  width: var(--lf-sidebar-width) !important;
  min-width: var(--lf-sidebar-width) !important;
  max-width: var(--lf-sidebar-width) !important;
}

.shell > .sidebar,
.shell.is-sidebar-collapsed > .sidebar {
  width: var(--lf-sidebar-width, 220px) !important;
  min-width: var(--lf-sidebar-width, 220px) !important;
  max-width: var(--lf-sidebar-width, 220px) !important;
}

.shell.is-sidebar-collapsed {
  grid-template-columns: var(--lf-sidebar-width-collapsed, 68px) minmax(0, 1fr) !important;
}

.shell.is-sidebar-collapsed > .sidebar {
  width: var(--lf-sidebar-width-collapsed, 68px) !important;
  min-width: var(--lf-sidebar-width-collapsed, 68px) !important;
  max-width: var(--lf-sidebar-width-collapsed, 68px) !important;
}

@media (min-width: 901px) {
  body.dashboard-client-flat-theme > .shell,
  body[data-company-theme] > .shell:has(> .sidebar) {
    grid-template-columns: var(--lf-sidebar-width) minmax(0, 1fr) !important;
    transition: grid-template-columns 0.85s cubic-bezier(0.22, 1, 0.36, 1) !important;
  }

  body.dashboard-client-flat-theme > .shell.is-sidebar-collapsed,
  body[data-company-theme] > .shell:has(> .sidebar).is-sidebar-collapsed {
    grid-template-columns: var(--lf-sidebar-width-collapsed) minmax(0, 1fr) !important;
  }

  body.dashboard-client-flat-theme .sidebar.is-sidebar-collapsed,
  body[data-company-theme] > .shell .sidebar.is-sidebar-collapsed {
    width: var(--lf-sidebar-width-collapsed) !important;
    min-width: var(--lf-sidebar-width-collapsed) !important;
    max-width: var(--lf-sidebar-width-collapsed) !important;
    padding-left: 12px !important;
    padding-right: 12px !important;
  }

  body.dashboard-client-flat-theme .sidebar.is-sidebar-collapsed .sidebar-brand,
  body[data-company-theme] > .shell .sidebar.is-sidebar-collapsed .sidebar-brand {
    padding: 6px 0 12px !important;
  }

  body.dashboard-client-flat-theme .sidebar.is-sidebar-collapsed .sidebar-brand .logo-link.has-image,
  body[data-company-theme] > .shell .sidebar.is-sidebar-collapsed .sidebar-brand .logo-link.has-image {
    width: 58px !important;
    height: 58px !important;
  }

  body.dashboard-client-flat-theme .sidebar.is-sidebar-collapsed .sidebar-brand-copy,
  body[data-company-theme] > .shell .sidebar.is-sidebar-collapsed .sidebar-brand-copy,
  body.dashboard-client-flat-theme .sidebar.is-sidebar-collapsed .nav-label,
  body[data-company-theme] > .shell .sidebar.is-sidebar-collapsed .nav-label,
  body.dashboard-client-flat-theme .sidebar.is-sidebar-collapsed .sidebar-industry,
  body[data-company-theme] > .shell .sidebar.is-sidebar-collapsed .sidebar-industry,
  body.dashboard-client-flat-theme .sidebar.is-sidebar-collapsed .sidebar-section-title:not(.sidebar-section-title--toggle),
  body[data-company-theme] > .shell .sidebar.is-sidebar-collapsed .sidebar-section-title:not(.sidebar-section-title--toggle),
  body.dashboard-client-flat-theme .sidebar.is-sidebar-collapsed .sidebar-section-title--toggle > span,
  body[data-company-theme] > .shell .sidebar.is-sidebar-collapsed .sidebar-section-title--toggle > span,
  body.dashboard-client-flat-theme .sidebar.is-sidebar-collapsed .sidebar-footer-link > span:nth-child(2),
  body[data-company-theme] > .shell .sidebar.is-sidebar-collapsed .sidebar-footer-link > span:nth-child(2),
  body.dashboard-client-flat-theme .sidebar.is-sidebar-collapsed .sidebar-footer-link span:last-child,
  body[data-company-theme] > .shell .sidebar.is-sidebar-collapsed .sidebar-footer-link span:last-child {
    width: 0 !important;
    max-width: 0 !important;
    opacity: 0 !important;
    transform: translateX(-10px) !important;
    overflow: hidden !important;
    white-space: nowrap !important;
    pointer-events: none !important;
  }

  body.dashboard-client-flat-theme .sidebar.is-sidebar-collapsed .sidebar-section-title--toggle,
  body[data-company-theme] > .shell .sidebar.is-sidebar-collapsed .sidebar-section-title--toggle {
    justify-content: center !important;
    padding-inline: 0 !important;
  }

  body.dashboard-client-flat-theme .sidebar.is-sidebar-collapsed .nav-dot,
  body[data-company-theme] > .shell .sidebar.is-sidebar-collapsed .nav-dot,
  body.dashboard-client-flat-theme .sidebar.is-sidebar-collapsed .sidebar-footer-link,
  body[data-company-theme] > .shell .sidebar.is-sidebar-collapsed .sidebar-footer-link {
    width: 56px !important;
    min-width: 56px !important;
    height: 50px !important;
    padding: 0 !important;
    justify-content: center !important;
    grid-template-columns: 1fr !important;
    background: transparent !important;
    border-color: transparent !important;
    box-shadow: none !important;
  }

  body.dashboard-client-flat-theme .sidebar.is-sidebar-collapsed .nav-icon,
  body[data-company-theme] > .shell .sidebar.is-sidebar-collapsed .nav-icon,
  body.dashboard-client-flat-theme .sidebar.is-sidebar-collapsed .sidebar-footer-icon,
  body[data-company-theme] > .shell .sidebar.is-sidebar-collapsed .sidebar-footer-icon {
    margin: 0 auto !important;
  }

  body.dashboard-client-flat-theme .sidebar.is-sidebar-collapsed .sidebar-footer-card,
  body[data-company-theme] > .shell .sidebar.is-sidebar-collapsed .sidebar-footer-card {
    padding: 4px 0 !important;
    border-color: transparent !important;
  }

  body.dashboard-client-flat-theme .sidebar.is-sidebar-collapsed .sidebar-help-menu,
  body[data-company-theme] > .shell .sidebar.is-sidebar-collapsed .sidebar-help-menu {
    display: none !important;
  }
}

body.dashboard-client-flat-theme .sidebar-footer-card,
body[data-company-theme] > .shell .sidebar-footer-card {
  position: relative !important;
  z-index: 12000 !important;
  display: grid !important;
  gap: 4px !important;
  padding: 6px !important;
  border: 1px solid rgba(148, 163, 184, 0.18) !important;
  border-radius: 16px !important;
  background: transparent !important;
  box-shadow: none !important;
}

body.dashboard-client-flat-theme .sidebar-footer-link {
  background: transparent !important;
  border-color: transparent !important;
  box-shadow: none !important;
}

body.dashboard-client-flat-theme .sidebar-footer-link,
body[data-company-theme] > .shell .sidebar-footer-link {
  width: 100% !important;
  appearance: none !important;
  display: grid !important;
  grid-template-columns: 30px minmax(0, 1fr) auto !important;
  align-items: center !important;
  gap: 10px !important;
  min-height: 44px !important;
  padding: 5px 8px !important;
  border: 0 !important;
  border-radius: 12px !important;
  font: inherit !important;
  text-align: left !important;
  color: #475569 !important;
  text-decoration: none !important;
  cursor: pointer !important;
}

body.dashboard-client-flat-theme .sidebar-footer-link:hover,
body.dashboard-client-flat-theme .nav-dot:hover:not(.active) {
  background: transparent !important;
  border-color: transparent !important;
  box-shadow: none !important;
}

body.dashboard-client-flat-theme .sidebar-help-chevron,
body[data-company-theme] > .shell .sidebar-help-chevron {
  width: 18px !important;
  height: 18px !important;
  color: #94a3b8 !important;
  transition: transform 0.45s ease, color 0.45s ease !important;
}

body.dashboard-client-flat-theme .sidebar-help-trigger[aria-expanded="true"] .sidebar-help-chevron,
body[data-company-theme] > .shell .sidebar-help-trigger[aria-expanded="true"] .sidebar-help-chevron {
  transform: rotate(-90deg) !important;
  color: var(--primary-color, #2563eb) !important;
}

body.dashboard-client-flat-theme .sidebar-help-menu,
body[data-company-theme] > .shell .sidebar-help-menu {
  position: absolute !important;
  left: 6px !important;
  right: 6px !important;
  bottom: calc(100% + 8px) !important;
  z-index: 12050 !important;
  width: auto !important;
  display: grid !important;
  gap: 6px !important;
  padding: 10px !important;
  border: 1px solid rgba(148, 163, 184, 0.32) !important;
  border-radius: 16px !important;
  background: rgba(248, 250, 252, 0.96) !important;
  backdrop-filter: blur(18px) saturate(1.2) !important;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.2) !important;
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
  transform: translateY(8px) scale(0.98) !important;
  transform-origin: center bottom !important;
  transition: opacity 0.36s ease, visibility 0.36s ease, transform 0.5s cubic-bezier(0.22, 1, 0.36, 1) !important;
}

body.dashboard-client-flat-theme .sidebar-help-menu::before,
body[data-company-theme] > .shell .sidebar-help-menu::before {
  content: "" !important;
  position: absolute !important;
  left: 28px !important;
  bottom: -7px !important;
  width: 14px !important;
  height: 14px !important;
  border-right: 1px solid rgba(148, 163, 184, 0.32) !important;
  border-bottom: 1px solid rgba(148, 163, 184, 0.32) !important;
  background: rgba(248, 250, 252, 0.96) !important;
  transform: rotate(45deg) !important;
  box-shadow: 8px 8px 18px rgba(15, 23, 42, 0.06) !important;
}

body.dashboard-client-flat-theme .sidebar-help-menu.is-open,
body[data-company-theme] > .shell .sidebar-help-menu.is-open {
  opacity: 1 !important;
  visibility: visible !important;
  pointer-events: auto !important;
  transform: translateY(0) scale(1) !important;
}

body.dashboard-client-flat-theme .sidebar-help-menu a,
body[data-company-theme] > .shell .sidebar-help-menu a {
  position: relative !important;
  z-index: 1 !important;
  display: grid !important;
  grid-template-columns: 26px minmax(0, 1fr) !important;
  align-items: center !important;
  gap: 9px !important;
  min-height: 38px !important;
  padding: 5px 10px 5px 12px !important;
  border-radius: 12px !important;
  color: #334155 !important;
  font-size: 12px !important;
  font-weight: 750 !important;
  text-decoration: none !important;
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
}

body.dashboard-client-flat-theme .sidebar-help-menu a:hover,
body[data-company-theme] > .shell .sidebar-help-menu a:hover {
  color: var(--primary-color, #2563eb) !important;
  background: transparent !important;
}

body.dashboard-client-flat-theme .sidebar-help-menu-icon,
body[data-company-theme] > .shell .sidebar-help-menu-icon {
  width: 24px !important;
  height: 24px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  color: var(--primary-color, #2563eb) !important;
}

body.dashboard-client-flat-theme .sidebar-help-menu-icon svg,
body[data-company-theme] > .shell .sidebar-help-menu-icon svg {
  width: 20px !important;
  height: 20px !important;
}

/* Unified app sidebar final lock styles moved from global-design-system.css. */
/* Sidebar final lock: no white panel behind the shared app menu. */
body.lf-clean-theme > .shell > aside.sidebar,
body.lf-clean-theme > .shell > .sidebar,
body.dashboard-client-flat-theme > .shell > aside.sidebar,
body[data-company-theme] > .shell > aside.sidebar {
  position: relative !important;
  z-index: 12000 !important;
  background: transparent !important;
  background-color: transparent !important;
  background-image: none !important;
  border-color: transparent !important;
  box-shadow: none !important;
  overflow: visible !important;
}

body.lf-clean-theme > .shell > aside.sidebar::before,
body.lf-clean-theme > .shell > aside.sidebar::after,
body.dashboard-client-flat-theme > .shell > aside.sidebar::before,
body.dashboard-client-flat-theme > .shell > aside.sidebar::after,
body[data-company-theme] > .shell > aside.sidebar::before,
body[data-company-theme] > .shell > aside.sidebar::after {
  display: none !important;
  background: transparent !important;
  box-shadow: none !important;
}

body.lf-clean-theme > .shell > aside.sidebar :is(
  .sidebar-brand,
  .sidebar-nav-shell,
  .sidebar-menu-panel,
  .sidebar-footer-actions,
  .sidebar-footer-card,
  .nav-group,
  .nav-group-children
),
body.dashboard-client-flat-theme > .shell > aside.sidebar :is(
  .sidebar-brand,
  .sidebar-nav-shell,
  .sidebar-menu-panel,
  .sidebar-footer-actions,
  .sidebar-footer-card,
  .nav-group,
  .nav-group-children
) {
  background: transparent !important;
  background-color: transparent !important;
  background-image: none !important;
  box-shadow: none !important;
}

/* Migrated from global-design-system.css: themed internal menu state and icon palette. */
/* Menu interno: estado activo hereda el tema del tenant. */
body[data-company-theme] > .shell .sidebar .nav-dot,
body[data-company-theme] > .shell .sidebar .nav-dot.active,
body[data-company-theme] > .shell .sidebar .nav-dot.is-active,
body[data-company-theme] > .shell .sidebar .sidebar-footer-link {
  background: transparent !important;
  border-color: transparent !important;
  box-shadow: none !important;
}

body[data-company-theme] > .shell .sidebar .nav-dot.active,
body[data-company-theme] > .shell .sidebar .nav-dot.is-active {
  color: var(--primary-color, #2563eb) !important;
  background: transparent !important;
  border-color: transparent !important;
  box-shadow: none !important;
}

body[data-company-theme] > .shell .sidebar .nav-dot.active .nav-label,
body[data-company-theme] > .shell .sidebar .nav-dot.is-active .nav-label,
body[data-company-theme] > .shell .sidebar .nav-dot.active .nav-icon,
body[data-company-theme] > .shell .sidebar .nav-dot.is-active .nav-icon,
body[data-company-theme] > .shell .sidebar .nav-dot.active svg,
body[data-company-theme] > .shell .sidebar .nav-dot.is-active svg {
  color: var(--primary-color, #2563eb) !important;
}

body[data-company-theme] > .shell .sidebar .nav-dot:hover:not(.active) {
  color: var(--primary-color, #2563eb) !important;
  background: transparent !important;
  border-color: transparent !important;
  box-shadow: none !important;
}

/* Menu interno: paleta por icono, compartida por todas las paginas. */
body[data-company-theme] > .shell .sidebar .nav-icon,
body[data-company-theme] > .shell .sidebar .sidebar-footer-icon {
  width: 30px !important;
  height: 30px !important;
  min-width: 30px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  background: transparent !important;
  box-shadow: none !important;
}

body[data-company-theme] > .shell .sidebar .nav-dot[data-nav-key] .nav-icon,
body[data-company-theme] > .shell .sidebar .nav-dot[data-nav-key] .nav-icon svg,
body[data-company-theme] > .shell .sidebar .nav-dot[data-nav-key] .nav-icon i {
  color: var(--lf-nav-icon-color, #64748b) !important;
}

body[data-company-theme] > .shell .sidebar .nav-icon svg,
body[data-company-theme] > .shell .sidebar .nav-icon i,
body[data-company-theme] > .shell .sidebar .sidebar-footer-icon svg {
  width: 22px !important;
  height: 22px !important;
  stroke-width: 2.1 !important;
}

body[data-company-theme] > .shell .sidebar .nav-dot[data-nav-key="analytics"] {
  --lf-nav-icon-color: #2563eb;
}

body[data-company-theme] > .shell .sidebar .nav-dot[data-nav-key="leads"] {
  --lf-nav-icon-color: #7c3aed;
}

body[data-company-theme] > .shell .sidebar .nav-dot[data-nav-key="clients"],
body[data-company-theme] > .shell .sidebar .nav-dot[data-nav-key="agents"],
body[data-company-theme] > .shell .sidebar .nav-dot[data-nav-key="team"],
body[data-company-theme] > .shell .sidebar .nav-dot[data-nav-key="operations-team"] {
  --lf-nav-icon-color: #0891b2;
}

body[data-company-theme] > .shell .sidebar .nav-dot[data-nav-key="whatsapp"] {
  --lf-nav-icon-color: #16a34a;
}

body[data-company-theme] > .shell .sidebar .nav-dot[data-nav-key="campaigns"] {
  --lf-nav-icon-color: #f97316;
}

body[data-company-theme] > .shell .sidebar .nav-dot[data-nav-key="social"] {
  --lf-nav-icon-color: #db2777;
}

body[data-company-theme] > .shell .sidebar .nav-dot[data-nav-key="commercial_ai_assistant"] {
  --lf-nav-icon-color: #7c3aed;
}

body[data-company-theme] > .shell .sidebar .nav-dot[data-nav-key="billing"] {
  --lf-nav-icon-color: #4f46e5;
}

body[data-company-theme] > .shell .sidebar .nav-dot[data-nav-key="modules-admin"] {
  --lf-nav-icon-color: #0d9488;
}

body[data-company-theme] > .shell .sidebar .nav-dot[data-nav-key="help"] {
  --lf-nav-icon-color: #d97706;
}

body[data-company-theme] > .shell .sidebar .nav-dot[data-nav-key="support_tickets"],
body[data-company-theme] > .shell .sidebar .nav-dot[data-nav-key="support_tickets"] .nav-label {
  font-weight: 650 !important;
}

body[data-company-theme] > .shell .sidebar .nav-dot[data-nav-key="support_tickets"].active .nav-label,
body[data-company-theme] > .shell .sidebar .nav-dot[data-nav-key="support_tickets"].is-active .nav-label {
  font-weight: 750 !important;
}

body[data-company-theme] > .shell .sidebar .nav-dot[data-nav-key="settings"],
body[data-company-theme] > .shell .sidebar .nav-dot[data-nav-key^="settings-"] {
  --lf-nav-icon-color: #475569;
}

body[data-company-theme] > .shell .sidebar .nav-dot.active .nav-icon,
body[data-company-theme] > .shell .sidebar .nav-dot.is-active .nav-icon,
body[data-company-theme] > .shell .sidebar .nav-dot.active .nav-icon svg,
body[data-company-theme] > .shell .sidebar .nav-dot.is-active .nav-icon svg,
body[data-company-theme] > .shell .sidebar .nav-dot.active .nav-icon i,
body[data-company-theme] > .shell .sidebar .nav-dot.is-active .nav-icon i {
  color: var(--primary-color, var(--lf-nav-icon-color, #2563eb)) !important;
}

body.dashboard-client-flat-theme .lead-table tbody tr .lead-avatar,
body[data-company-theme] > .shell .lead-table tbody tr .lead-avatar {
  background: rgba(37, 99, 235, 0.16) !important;
  color: #2563eb !important;
}

body.dashboard-client-flat-theme .lead-table tbody tr:nth-child(2n) .lead-avatar,
body[data-company-theme] > .shell .lead-table tbody tr:nth-child(2n) .lead-avatar {
  background: rgba(124, 58, 237, 0.16) !important;
  color: #7c3aed !important;
}

body.dashboard-client-flat-theme .lead-table tbody tr:nth-child(3n) .lead-avatar,
body[data-company-theme] > .shell .lead-table tbody tr:nth-child(3n) .lead-avatar {
  background: rgba(8, 145, 178, 0.15) !important;
  color: #0891b2 !important;
}

body.dashboard-client-flat-theme .lead-table tbody tr:nth-child(4n) .lead-avatar,
body[data-company-theme] > .shell .lead-table tbody tr:nth-child(4n) .lead-avatar {
  background: rgba(22, 163, 74, 0.15) !important;
  color: #16a34a !important;
}

/* Dashboard flat-theme sidebar bridge moved from compat.css. */
body.dashboard-client-flat-theme > .shell > .sidebar {
  width: var(--lf-sidebar-width) !important;
  display: flex !important;
  flex-direction: column !important;
  gap: var(--lf-space-4) !important;
  padding: var(--lf-space-5) var(--lf-space-4) !important;
  border-right: 1px solid var(--lf-color-border) !important;
  background: var(--lf-color-surface) !important;
  color: var(--lf-color-text) !important;
  box-shadow: none !important;
}

body.dashboard-client-flat-theme > .shell > .sidebar :is(.sidebar-brand, .sidebar-menu-panel, .sidebar-nav-shell, .sidebar-footer-actions) {
  min-width: 0 !important;
}

body.dashboard-client-flat-theme > .shell > .sidebar .sidebar-brand {
  display: flex !important;
  align-items: center !important;
  gap: var(--lf-space-3) !important;
  padding: 0 var(--lf-space-2) var(--lf-space-3) !important;
  border-bottom: 1px solid var(--lf-color-border) !important;
}

body.dashboard-client-flat-theme > .shell > .sidebar:has(.logo-link--app.has-image) {
  padding-top: 10px !important;
}

body.dashboard-client-flat-theme > .shell > .sidebar .sidebar-brand:has(.logo-link--app.has-image) {
  align-items: center !important;
  flex-direction: row !important;
  justify-content: flex-start !important;
  gap: var(--lf-space-3) !important;
  padding: 0 var(--lf-space-2) var(--lf-space-3) !important;
  text-align: left !important;
}

body.dashboard-client-flat-theme > .shell > .sidebar .sidebar-brand .logo-link--app.has-image {
  width: 38px !important;
  min-width: 38px !important;
  height: 38px !important;
  transform: translateY(-1px) !important;
}

body.dashboard-client-flat-theme > .shell > .sidebar .sidebar-brand .logo-link--app.has-image .logo-mark {
  width: 38px !important;
  height: 38px !important;
  max-width: 38px !important;
  max-height: 38px !important;
  object-fit: contain !important;
}

body.dashboard-client-flat-theme > .shell > .sidebar .sidebar-brand:has(.logo-link--app.has-image) .sidebar-brand-copy {
  justify-items: start !important;
  width: auto !important;
}

body.dashboard-client-flat-theme > .shell > .sidebar .sidebar-brand:has(.logo-link--app.has-image) .sidebar-brand-copy strong {
  font-size: 18px !important;
  line-height: 1.05 !important;
  text-align: left !important;
}

body.dashboard-client-flat-theme > .shell > .sidebar .sidebar-brand-copy {
  display: grid !important;
  gap: 2px !important;
  min-width: 0 !important;
}

body.dashboard-client-flat-theme > .shell > .sidebar .sidebar-brand-copy strong {
  color: var(--lf-color-text) !important;
  font-size: 15px !important;
  line-height: var(--lf-line-tight) !important;
  font-weight: 900 !important;
  letter-spacing: 0 !important;
}

body.dashboard-client-flat-theme > .shell > .sidebar .sidebar-brand-copy span,
body.dashboard-client-flat-theme > .shell > .sidebar :is(.sidebar-industry, .sidebar-section-title) {
  color: var(--lf-color-muted) !important;
  font-size: var(--lf-font-size-xs) !important;
  font-weight: 900 !important;
  letter-spacing: 0.03em !important;
  text-transform: uppercase !important;
}

body.dashboard-client-flat-theme > .shell > .sidebar .sidebar-menu-panel {
  display: flex !important;
  min-height: 0 !important;
  flex: 1 1 auto !important;
  flex-direction: column !important;
  gap: var(--lf-space-3) !important;
}

body.dashboard-client-flat-theme > .shell > .sidebar .sidebar-nav-shell {
  display: grid !important;
  gap: var(--lf-space-2) !important;
}

body.dashboard-client-flat-theme > .shell > .sidebar :is(.nav-dot, .sidebar-footer-link) {
  min-height: 42px !important;
  display: grid !important;
  grid-template-columns: 34px minmax(0, 1fr) !important;
  align-items: center !important;
  gap: var(--lf-space-3) !important;
  padding: 4px var(--lf-space-3) !important;
  border: 1px solid transparent !important;
  border-radius: var(--lf-radius-md) !important;
  background: transparent !important;
  color: var(--lf-color-muted) !important;
  text-decoration: none !important;
  box-shadow: none !important;
  transform: none !important;
  transition:
    background var(--lf-transition-fast),
    border-color var(--lf-transition-fast),
    color var(--lf-transition-fast) !important;
}

body.dashboard-client-flat-theme > .shell > .sidebar :is(.nav-dot:hover, .sidebar-footer-link:hover) {
  border-color: var(--lf-color-border) !important;
  background: var(--lf-color-surface-muted) !important;
  color: var(--lf-color-text) !important;
}

body.dashboard-client-flat-theme > .shell > .sidebar .nav-dot.active,
body.dashboard-client-flat-theme > .shell > .sidebar .nav-dot.is-active {
  border-color: color-mix(in srgb, var(--lf-color-primary) 22%, transparent) !important;
  background: var(--lf-color-primary-soft) !important;
  color: var(--lf-color-primary) !important;
}

body.dashboard-client-flat-theme > .shell > .sidebar :is(.nav-icon, .sidebar-footer-icon) {
  width: 30px !important;
  height: 30px !important;
  display: inline-grid !important;
  place-items: center !important;
  border-radius: var(--lf-radius-md) !important;
  background: color-mix(in srgb, currentColor 9%, transparent) !important;
  color: inherit !important;
}

body.dashboard-client-flat-theme > .shell > .sidebar :is(.nav-icon svg, .nav-icon i, .sidebar-footer-icon svg) {
  width: 16px !important;
  height: 16px !important;
  color: inherit !important;
}

body.dashboard-client-flat-theme > .shell > .sidebar .nav-label {
  min-width: 0 !important;
  color: inherit !important;
  font-size: 13px !important;
  font-weight: 850 !important;
  letter-spacing: 0 !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}

body.dashboard-client-flat-theme > .shell > .sidebar .nav-dot-sub {
  min-height: 36px !important;
  margin-left: var(--lf-space-5) !important;
  grid-template-columns: 28px minmax(0, 1fr) !important;
  padding-left: var(--lf-space-2) !important;
}

body.dashboard-client-flat-theme > .shell > .sidebar .nav-dot-sub .nav-icon {
  width: 28px !important;
  height: 28px !important;
  border-radius: var(--lf-radius-sm) !important;
}

body.dashboard-client-flat-theme > .shell > .sidebar .nav-dot-sub .nav-label {
  font-size: 12px !important;
}

body.dashboard-client-flat-theme > .shell > .sidebar.is-sidebar-collapsed :is(.nav-dot, .sidebar-footer-link) {
  width: 42px !important;
  min-width: 42px !important;
  grid-template-columns: 34px !important;
  justify-content: center !important;
  padding: 4px !important;
}

body.dashboard-client-flat-theme > .shell > .sidebar.is-sidebar-collapsed .nav-dot-sub {
  margin-left: 0 !important;
}

body.dashboard-client-flat-theme > .shell > .sidebar.is-sidebar-collapsed .nav-label,
body.dashboard-client-flat-theme > .shell > .sidebar.is-sidebar-collapsed .sidebar-brand-copy,
body.dashboard-client-flat-theme > .shell > .sidebar.is-sidebar-collapsed .sidebar-industry,
body.dashboard-client-flat-theme > .shell > .sidebar.is-sidebar-collapsed .sidebar-section-title:not(.sidebar-section-title--toggle) {
  display: none !important;
}

body.dashboard-client-flat-theme > .shell > .sidebar .logo-mark {
  background: transparent !important;
}

body.dashboard-client-flat-theme > .shell > .sidebar .nav-icon-image {
  width: 24px !important;
  max-width: 24px !important;
  height: 24px !important;
  max-height: 24px !important;
  object-fit: contain !important;
}

/* Sidebar tenant logo and plan card rules live here, not in sidebar.html. */
body.dashboard-client-flat-theme .sidebar-company-logo-card,
body[data-company-theme] > .shell .sidebar-company-logo-card {
  min-height: 86px !important;
  padding: 2px 10px 6px !important;
  border-color: transparent !important;
  border-width: 0 !important;
}

body.dashboard-client-flat-theme .sidebar:has(.sidebar-company-logo-card),
body[data-company-theme] > .shell .sidebar:has(.sidebar-company-logo-card) {
  padding-top: 8px !important;
}

body.dashboard-client-flat-theme .sidebar-scope-logo,
body[data-company-theme] > .shell .sidebar-scope-logo {
  max-width: 154px !important;
  height: 72px !important;
  object-position: center top !important;
}

body.dashboard-client-flat-theme .sidebar-plan-card,
body[data-company-theme] > .shell .sidebar-plan-card {
  display: grid !important;
  gap: 10px !important;
  width: 100% !important;
  padding: 14px 16px !important;
  border: 1px solid rgba(124, 58, 237, 0.14) !important;
  border-radius: 14px !important;
  background: rgba(255, 255, 255, 0.72) !important;
  color: #0b102f !important;
  text-decoration: none !important;
  box-shadow: 0 10px 28px rgba(79, 70, 229, 0.08) !important;
}

body.dashboard-client-flat-theme .sidebar-plan-card:hover,
body[data-company-theme] > .shell .sidebar-plan-card:hover {
  transform: translateY(-1px) !important;
  border-color: rgba(124, 58, 237, 0.26) !important;
  background: rgba(255, 255, 255, 0.86) !important;
}

body.dashboard-client-flat-theme .sidebar-plan-head,
body[data-company-theme] > .shell .sidebar-plan-head,
body.dashboard-client-flat-theme .sidebar-plan-action,
body[data-company-theme] > .shell .sidebar-plan-action {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 10px !important;
}

body.dashboard-client-flat-theme .sidebar-plan-title,
body[data-company-theme] > .shell .sidebar-plan-title {
  font-size: 14px !important;
  font-weight: 950 !important;
  letter-spacing: 0 !important;
  color: #101332 !important;
}

body.dashboard-client-flat-theme .sidebar-plan-crown,
body[data-company-theme] > .shell .sidebar-plan-crown {
  width: 26px !important;
  height: 26px !important;
  display: grid !important;
  place-items: center !important;
  border-radius: 999px !important;
  background: rgba(109, 74, 255, 0.1) !important;
  color: #6d4aff !important;
  flex: 0 0 auto !important;
}

body.dashboard-client-flat-theme .sidebar-plan-crown svg,
body[data-company-theme] > .shell .sidebar-plan-crown svg {
  width: 15px !important;
  height: 15px !important;
}

body.dashboard-client-flat-theme .sidebar-plan-usage,
body[data-company-theme] > .shell .sidebar-plan-usage {
  margin: 0 !important;
  color: #64748b !important;
  font-size: 12px !important;
  font-weight: 850 !important;
  line-height: 1.2 !important;
}

body.dashboard-client-flat-theme .sidebar-plan-track,
body[data-company-theme] > .shell .sidebar-plan-track {
  height: 8px !important;
  overflow: hidden !important;
  border-radius: 999px !important;
  background: rgba(109, 74, 255, 0.12) !important;
}

body.dashboard-client-flat-theme .sidebar-plan-track span,
body[data-company-theme] > .shell .sidebar-plan-track span {
  display: block !important;
  width: 85% !important;
  height: 100% !important;
  border-radius: inherit !important;
  background: linear-gradient(90deg, #315bff, #6d4aff) !important;
}

body.dashboard-client-flat-theme .sidebar-plan-action,
body[data-company-theme] > .shell .sidebar-plan-action {
  justify-content: flex-end !important;
  color: #5b4bff !important;
  font-size: 12px !important;
  font-weight: 950 !important;
}

body.dashboard-client-flat-theme .sidebar-plan-action svg,
body[data-company-theme] > .shell .sidebar-plan-action svg {
  width: 14px !important;
  height: 14px !important;
}

@media (min-width: 901px) {
  body.dashboard-client-flat-theme .sidebar.is-sidebar-collapsed .sidebar-plan-card,
  body[data-company-theme] > .shell .sidebar.is-sidebar-collapsed .sidebar-plan-card {
    display: none !important;
  }
}

/* Authenticated sidebar viewport lock: the shared side menu must not scroll away with page content. */
@media (min-width: 901px) {
  body.lf-clean-theme > .shell > aside.sidebar,
  body.lf-clean-theme > .shell > .sidebar,
  body.dashboard-client-flat-theme > .shell > aside.sidebar,
  body.dashboard-client-flat-theme > .shell > .sidebar,
  body[data-company-theme] > .shell > aside.sidebar,
  body[data-company-theme] > .shell > .sidebar {
    position: sticky !important;
    top: 20px !important;
    align-self: start !important;
    height: calc(100vh - 40px) !important;
    max-height: calc(100vh - 40px) !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    overscroll-behavior: contain !important;
    scrollbar-width: thin !important;
  }

  body.dashboard-client-flat-theme > .shell > .sidebar .sidebar-menu-panel,
  body[data-company-theme] > .shell > .sidebar .sidebar-menu-panel {
    min-height: 0 !important;
    overflow: visible !important;
  }

  body.dashboard-client-flat-theme > .shell > .sidebar .sidebar-nav-shell,
  body[data-company-theme] > .shell > .sidebar .sidebar-nav-shell {
    min-height: 0 !important;
  }
}

@media (max-width: 900px) {
  body.lf-clean-theme > .shell > aside.sidebar,
  body.lf-clean-theme > .shell > .sidebar,
  body.dashboard-client-flat-theme > .shell > aside.sidebar,
  body.dashboard-client-flat-theme > .shell > .sidebar,
  body[data-company-theme] > .shell > aside.sidebar,
  body[data-company-theme] > .shell > .sidebar {
    position: relative !important;
    top: auto !important;
    height: auto !important;
    max-height: none !important;
    overflow: visible !important;
  }
}

/* Phase 2 structural sidebar ownership.
   Sidebar image sizing lives in external CSS, never inline in sidebar.html. */
body.lf-clean-theme > .shell > .sidebar .logo-mark,
body.dashboard-client-flat-theme > .shell > .sidebar .logo-mark,
body[data-company-theme] > .shell > .sidebar .logo-mark {
  background: transparent !important;
}

body.lf-clean-theme > .shell > .sidebar .nav-icon-image,
body.dashboard-client-flat-theme > .shell > .sidebar .nav-icon-image,
body[data-company-theme] > .shell > .sidebar .nav-icon-image {
  width: 24px !important;
  height: 24px !important;
  max-width: 24px !important;
  max-height: 24px !important;
  display: block !important;
  object-fit: contain !important;
}
