/* V50: sidebar logo breathing room and AI Assistant topbar polish only */

/* Desktop / laptop sidebar rail */
@media (min-width: 761px) {
  #sidebar .sidebar-logo,
  body.sidebar-collapsed #sidebar .sidebar-logo {
    width: 100% !important;
    height: 60px !important;
    min-height: 60px !important;
    max-height: 60px !important;
    padding: 11px 14px !important;
    margin: 0 !important;
    box-sizing: border-box !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    overflow: hidden !important;
  }

  #sidebar .sidebar-logo-img,
  body.sidebar-collapsed #sidebar .sidebar-logo-img {
    position: static !important;
    display: block !important;
    width: 56px !important;
    height: auto !important;
    max-width: 56px !important;
    max-height: 29px !important;
    margin: 0 auto !important;
    padding: 0 !important;
    object-fit: contain !important;
    object-position: center center !important;
    transform: none !important;
    clip-path: none !important;
  }

  /* When the rail expands, retain comfortable padding and keep the logo left aligned. */
  #sidebar:hover .sidebar-logo,
  body.sidebar-collapsed #sidebar:hover .sidebar-logo,
  #sidebar:focus-within .sidebar-logo {
    padding: 10px 18px !important;
    justify-content: flex-start !important;
  }

  #sidebar:hover .sidebar-logo-img,
  body.sidebar-collapsed #sidebar:hover .sidebar-logo-img,
  #sidebar:focus-within .sidebar-logo-img {
    width: 116px !important;
    height: auto !important;
    max-width: 116px !important;
    max-height: 36px !important;
    margin: 0 !important;
    object-fit: contain !important;
    object-position: left center !important;
  }
}

/* Mobile sidebar */
@media (max-width: 760px) {
  #sidebar .sidebar-logo {
    height: 58px !important;
    min-height: 58px !important;
    max-height: 58px !important;
    padding: 10px 16px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
  }

  #sidebar .sidebar-logo-img {
    width: 108px !important;
    height: auto !important;
    max-width: 108px !important;
    max-height: 35px !important;
    margin: 0 !important;
    object-fit: contain !important;
    object-position: left center !important;
  }
}

/* AI Assistant button: readable, balanced, and consistent with other topbar actions. */
#topbar .hub-assistant-chip {
  position: relative !important;
  height: 42px !important;
  min-height: 42px !important;
  min-width: 112px !important;
  width: auto !important;
  padding: 0 14px !important;
  margin: 0 !important;
  border: 1px solid #ffd0c3 !important;
  border-radius: 13px !important;
  background: #fff7f4 !important;
  color: #1e293b !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 8px !important;
  box-sizing: border-box !important;
  cursor: pointer !important;
  opacity: 1 !important;
  visibility: visible !important;
  box-shadow: 0 5px 14px rgba(255, 92, 53, .08) !important;
  font-family: 'DM Sans', 'Inter', Arial, sans-serif !important;
  font-size: 12.5px !important;
  font-weight: 800 !important;
  line-height: 1 !important;
  white-space: nowrap !important;
}

#topbar .hub-assistant-chip span,
#topbar .hub-assistant-chip span:last-child {
  display: inline-flex !important;
  align-items: center !important;
  color: #1e293b !important;
  opacity: 1 !important;
  visibility: visible !important;
  font-size: 12.5px !important;
  font-weight: 800 !important;
  line-height: 1 !important;
}

#topbar .hub-assistant-chip .hub-assistant-icon,
#topbar .hub-assistant-chip span:first-child {
  width: 24px !important;
  height: 24px !important;
  flex: 0 0 24px !important;
  border-radius: 8px !important;
  background: #ff5c35 !important;
  color: #ffffff !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  font-size: 12px !important;
  font-weight: 900 !important;
  line-height: 1 !important;
}

#topbar .hub-assistant-chip:hover,
#topbar .hub-assistant-chip:focus-visible {
  background: #fff0eb !important;
  border-color: #ff9f86 !important;
  color: #0f172a !important;
  outline: none !important;
  box-shadow: 0 7px 18px rgba(255, 92, 53, .15) !important;
  transform: translateY(-1px) !important;
}

body.crm-night-mode #topbar .hub-assistant-chip {
  background: #332721 !important;
  border-color: #714535 !important;
  color: #f8fafc !important;
}
body.crm-night-mode #topbar .hub-assistant-chip span:last-child { color: #f8fafc !important; }

/* Keep the button compact on medium screens without making the label invisible. */
@media (max-width: 1180px) {
  #topbar .hub-assistant-chip {
    min-width: 42px !important;
    width: 42px !important;
    padding: 0 !important;
  }
  #topbar .hub-assistant-chip span:last-child { display: none !important; }
}
