/* 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-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-footer-link:hover,
body.dashboard-client-flat-theme .nav-dot:hover:not(.active) {
  background: transparent !important;
  border-color: transparent !important;
  box-shadow: none !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;
}

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

body.dashboard-client-flat-theme:not(.leads-page) .lead-table tbody tr:nth-child(2n) .lead-avatar,
body[data-company-theme]:not(.leads-page) > .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:not(.leads-page) .lead-table tbody tr:nth-child(3n) .lead-avatar,
body[data-company-theme]:not(.leads-page) > .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:not(.leads-page) .lead-table tbody tr:nth-child(4n) .lead-avatar,
body[data-company-theme]:not(.leads-page) > .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 kept here during sidebar migration. */
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-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 .nav-icon-image {
  width: 24px !important;
  max-width: 24px !important;
  height: 24px !important;
  max-height: 24px !important;
  object-fit: contain !important;
}

.sidebar-usage-card {
  display: grid;
  gap: 10px;
  margin-top: 10px;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  background: #151515;
  color: #f8fafc;
  box-shadow: 0 16px 34px rgba(15, 23, 42, 0.18);
}

.sidebar-usage-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.sidebar-usage-head strong {
  min-width: 0;
  color: inherit;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: 0;
}

.sidebar-usage-head button {
  width: 22px;
  height: 22px;
  display: inline-grid;
  place-items: center;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: rgba(248, 250, 252, 0.55);
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
}

.sidebar-usage-head button:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}

.sidebar-usage-card p {
  margin: 0;
  color: rgba(248, 250, 252, 0.68);
  font-size: 12px;
  font-weight: 400;
  line-height: 1.35;
}

.sidebar-usage-card .sidebar-usage-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  color: rgba(248, 250, 252, 0.82);
  font-size: 11px;
}

.sidebar-usage-track {
  height: 5px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
}

.sidebar-usage-track span {
  display: block;
  width: 8%;
  min-width: 12px;
  height: 100%;
  border-radius: inherit;
  background: #fff;
}

.sidebar-usage-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 8px;
}

.sidebar-usage-actions a {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  background: transparent;
  color: rgba(248, 250, 252, 0.9);
  font-size: 12px;
  font-weight: 500;
  line-height: 1;
  text-decoration: none;
}

.sidebar-usage-actions a.is-primary {
  border-color: #fff;
  background: #fff;
  color: #1f2937;
}

.sidebar.is-sidebar-collapsed .sidebar-usage-card {
  display: none;
}

/* 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;
  }
}
