:root {
  --sidebar-expanded-width: 300px;
  --sidebar-collapsed-width: 80px;
}

.sidebar-wrapper {
  scrollbar-color: rgba(124, 138, 165, 0.24) transparent;
  scrollbar-width: thin;
  transition: left 0.3s ease, width 0.25s ease;
}

.sidebar-wrapper::-webkit-scrollbar {
  width: 8px;
}

.sidebar-wrapper::-webkit-scrollbar-track {
  background: transparent;
}

.sidebar-wrapper::-webkit-scrollbar-thumb {
  background-clip: content-box;
  background-color: rgba(124, 138, 165, 0.18);
  border: 3px solid transparent;
  border-radius: 999px;
  min-height: 36px;
}

.sidebar-wrapper:hover::-webkit-scrollbar-thumb,
.sidebar-wrapper:focus-within::-webkit-scrollbar-thumb {
  background-color: rgba(124, 138, 165, 0.32);
}

.sidebar-wrapper.ps > .ps__rail-y {
  background-color: transparent !important;
  opacity: 0;
  right: 2px !important;
  transition: opacity 0.18s ease, background-color 0.18s ease;
  width: 8px;
}

.sidebar-wrapper.ps--scrolling-y > .ps__rail-y,
.sidebar-wrapper.ps:hover > .ps__rail-y,
.sidebar-wrapper.ps:focus-within > .ps__rail-y,
.sidebar-wrapper.ps > .ps__rail-y.ps--clicking,
.sidebar-wrapper.ps > .ps__rail-y:focus,
.sidebar-wrapper.ps > .ps__rail-y:hover {
  background-color: transparent !important;
  opacity: 0.42;
}

.sidebar-wrapper.ps > .ps__rail-y > .ps__thumb-y {
  background-color: rgba(124, 138, 165, 0.24) !important;
  border-radius: 999px;
  right: 2px;
  width: 3px;
}

.sidebar-wrapper.ps--scrolling-y > .ps__rail-y > .ps__thumb-y,
.sidebar-wrapper.ps:hover > .ps__rail-y > .ps__thumb-y,
.sidebar-wrapper.ps:focus-within > .ps__rail-y > .ps__thumb-y,
.sidebar-wrapper.ps > .ps__rail-y.ps--clicking > .ps__thumb-y,
.sidebar-wrapper.ps > .ps__rail-y:focus > .ps__thumb-y,
.sidebar-wrapper.ps > .ps__rail-y:hover > .ps__thumb-y {
  background-color: rgba(124, 138, 165, 0.42) !important;
  width: 4px;
}

body.theme-dark .sidebar-wrapper {
  scrollbar-color: rgba(174, 182, 215, 0.22) transparent;
}

body.theme-dark .sidebar-wrapper::-webkit-scrollbar-thumb {
  background-color: rgba(174, 182, 215, 0.16);
}

body.theme-dark .sidebar-wrapper:hover::-webkit-scrollbar-thumb,
body.theme-dark .sidebar-wrapper:focus-within::-webkit-scrollbar-thumb {
  background-color: rgba(174, 182, 215, 0.3);
}

body.theme-dark .sidebar-wrapper.ps > .ps__rail-y > .ps__thumb-y {
  background-color: rgba(174, 182, 215, 0.22) !important;
}

body.theme-dark .sidebar-wrapper.ps--scrolling-y > .ps__rail-y > .ps__thumb-y,
body.theme-dark .sidebar-wrapper.ps:hover > .ps__rail-y > .ps__thumb-y,
body.theme-dark .sidebar-wrapper.ps:focus-within > .ps__rail-y > .ps__thumb-y,
body.theme-dark .sidebar-wrapper.ps > .ps__rail-y.ps--clicking > .ps__thumb-y,
body.theme-dark .sidebar-wrapper.ps > .ps__rail-y:focus > .ps__thumb-y,
body.theme-dark .sidebar-wrapper.ps > .ps__rail-y:hover > .ps__thumb-y {
  background-color: rgba(174, 182, 215, 0.38) !important;
}

.sidebar-topbar {
  align-items: center;
  display: flex;
  gap: 0.75rem;
  justify-content: space-between;
  min-height: 40px;
}

.sidebar-brand {
  min-width: 0;
}

.sidebar-brand img {
  max-width: 150px;
  object-fit: contain;
}

.sidebar-controls {
  align-items: center;
  display: flex;
  flex: 0 0 auto;
  gap: 0.375rem;
}

.sidebar-control-button {
  align-items: center;
  background: #f1f3f9;
  border: 1px solid #dce2f1;
  border-radius: 6px;
  color: #25396f;
  cursor: pointer;
  display: inline-flex;
  height: 32px;
  justify-content: center;
  padding: 0;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
  width: 32px;
}

.sidebar-control-button:hover {
  background: #e6e9f4;
  border-color: #c7cee1;
}

.sidebar-control-button:focus-visible,
.sidebar-profile-link:focus-visible,
.sidebar-notification-link:focus-visible,
.sidebar-wrapper .sidebar-link:focus-visible,
.sidebar-wrapper .btn-organizations:focus-visible {
  box-shadow: 0 0 0 3px rgba(67, 94, 190, 0.3);
  outline: 2px solid #435ebe;
  outline-offset: 2px;
}

.sidebar-control-button i {
  font-size: 1rem;
  line-height: 1;
}

body.theme-dark .sidebar-control-button {
  background: #252538;
  border-color: #3b3b52;
  color: #f2f4ff;
}

body.theme-dark .sidebar-control-button:hover {
  background: #303048;
  border-color: #51516b;
}

.box-profile {
  align-items: center;
  display: flex;
  gap: 0.5rem;
  min-height: 76px;
  position: relative;
}

.sidebar-master-badge {
  left: 1rem;
  position: absolute;
  top: -10px;
}

.sidebar-profile-link {
  align-items: center;
  color: inherit;
  display: flex;
  flex: 1 1 auto;
  gap: 0.625rem;
  min-width: 0;
  text-decoration: none;
}

.sidebar-profile-link:hover {
  color: inherit;
}

.box-profile .sidebar-profile-avatar {
  align-items: center;
  background: #435ebe;
  border: 1px solid #d7ddec;
  border-radius: 50%;
  display: inline-flex;
  flex: 0 0 42px;
  height: 42px;
  justify-content: center;
  margin: 0;
  overflow: hidden;
  position: relative;
  width: 42px;
}

.sidebar-profile-image {
  height: 100%;
  inset: 0;
  object-fit: cover;
  object-position: center;
  opacity: 0;
  position: absolute;
  transition: opacity 0.15s ease;
  width: 100%;
}

.sidebar-profile-image--loaded {
  opacity: 1;
}

.sidebar-profile-fallback {
  align-items: center;
  color: #fff;
  display: flex;
  font-size: 0.78rem;
  font-weight: 700;
  height: 100%;
  justify-content: center;
  letter-spacing: 0;
  line-height: 1;
  text-transform: uppercase;
  width: 100%;
}

.sidebar-profile-fallback i {
  font-size: 1.15rem;
  line-height: 1;
}

body.theme-dark .box-profile .sidebar-profile-avatar {
  background: #526ed1;
  border-color: #777d9c;
}

.box-info-user-logged {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-width: 0;
}

.sidebar-profile-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-profile-badges {
  display: flex;
  gap: 0.25rem;
  margin-top: 0.25rem;
  min-width: 0;
}

.sidebar-profile-badges .badge:first-child {
  max-width: 125px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-notification-link {
  align-items: center;
  color: #25396f;
  display: inline-flex;
  flex: 0 0 32px;
  height: 32px;
  justify-content: center;
  position: relative;
  text-decoration: none;
  width: 32px;
}

body.theme-dark .sidebar-notification-link {
  color: #c8cbe2;
}

.sidebar-notification-link .icon-notification {
  font-size: 1.25rem;
}

.sidebar-notification-link .badge-notification {
  border: 1px solid #fff;
  border-radius: 999px;
  font-size: 0.625rem;
  line-height: 1;
  min-width: 17px;
  padding: 0.2rem 0.3rem;
  position: absolute;
  right: -3px;
  top: -3px;
  z-index: 1;
}

.sidebar-item-organization .dropdown,
.sidebar-item-organization .btn-organizations {
  width: 100%;
}

.sidebar-item-organization .btn-organizations {
  align-items: center;
  display: flex;
  gap: 0.5rem;
  justify-content: flex-start;
  min-height: 40px;
  overflow: hidden;
  text-align: left;
}

body.theme-dark .sidebar-organization-toggle {
  background-color: #252538;
  border-color: #7f86a6;
  color: #f2f4ff;
}

body.theme-dark .sidebar-organization-toggle:hover,
body.theme-dark .sidebar-organization-toggle:focus,
body.theme-dark .sidebar-organization-toggle[aria-expanded="true"] {
  background-color: #303048;
  border-color: #a2a8c4;
  color: #fff;
}

.sidebar-organization-icon {
  align-items: center;
  display: inline-flex;
  flex: 0 0 24px;
  height: 24px;
  justify-content: center;
  margin: 0;
  width: 24px;
}

.sidebar-organization-icon img {
  max-height: 22px;
  max-width: 24px;
  object-fit: contain;
}

.sidebar-organization-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-item-counter {
  margin: 0 !important;
  position: absolute;
  right: 10px;
}

.sidebar-wrapper .menu .sidebar-item--separator {
  border-top: 1px solid #e5e9f2;
  margin-top: 1.05rem;
  padding-top: 0.85rem;
}

.sidebar-menu-group {
  background: transparent;
  border: 0;
  border-top: 1px solid #e5e9f2;
  border-radius: 0;
  box-shadow: none;
  list-style: none;
  margin: 1.05rem 0 0.65rem;
  padding: 0.85rem 0 0;
}

.sidebar-menu-group--first {
  border-top: 0;
  margin-top: 0.35rem;
  padding-top: 0.25rem;
}

.sidebar-menu-group--active {
  border-top-color: rgba(67, 94, 190, 0.36);
  box-shadow: none;
}

.sidebar-menu-group-content {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.sidebar-menu-group-heading {
  align-items: center;
  background: transparent;
  cursor: default;
  display: flex;
  gap: 0;
  justify-content: flex-start;
  min-height: 20px;
  padding: 0 0.75rem 0.35rem;
  user-select: none;
  width: 100%;
}

.sidebar-menu-group-heading::after {
  display: none;
}

.sidebar-menu-group-heading > i:first-child {
  display: none;
}

.sidebar-menu-group-name {
  color: #8b94a6;
  flex: 1 1 auto;
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  line-height: 1.15;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.sidebar-menu-group--active .sidebar-menu-group-name {
  color: #435ebe;
}

.sidebar-menu-group-modules {
  list-style: none;
  margin: 0;
  padding: 0;
}

.sidebar-menu-group-modules .sidebar-item {
  margin-top: 0.15rem;
}

.sidebar-menu-group-modules .sidebar-item--separator {
  margin-top: 0.65rem;
  padding-top: 0.65rem;
}

.sidebar-menu-group-modules .sidebar-link {
  border-radius: 0.45rem;
  font-size: 0.92rem !important;
  padding-left: 1rem !important;
}

.sidebar-menu-group-modules .sidebar-link i {
  opacity: 0.92;
}

body.theme-dark .sidebar-menu-group {
  background: transparent;
  border-top-color: #303044;
}

body.theme-dark .sidebar-wrapper .menu .sidebar-item--separator {
  border-top-color: #303044;
}

body.theme-dark .sidebar-menu-group--active {
  border-top-color: rgba(139, 158, 255, 0.48);
  box-shadow: none;
}

body.theme-dark .sidebar-menu-group-name {
  color: #aeb6d7;
}

body.theme-dark .sidebar-menu-group--active .sidebar-menu-group-name {
  color: #dfe4ff;
}

#main,
#main .page-heading.fixed-top {
  transition: margin-left 0.25s ease;
}

@media screen and (min-width: 1200px) {
  body.sidebar-collapsed #sidebar.active .sidebar-wrapper {
    width: var(--sidebar-collapsed-width);
  }

  body.sidebar-collapsed #sidebar.active ~ #main:not(.embedded) {
    margin-left: var(--sidebar-collapsed-width);
  }

  body.sidebar-collapsed #sidebar.active ~ #main:not(.embedded) .page-heading.fixed-top {
    margin-left: var(--sidebar-collapsed-width);
  }

  body.sidebar-collapsed .sidebar-wrapper .sidebar-header {
    padding: 1rem 0.5rem !important;
  }

  body.sidebar-collapsed .sidebar-topbar {
    justify-content: center;
  }

  body.sidebar-collapsed .sidebar-brand,
  body.sidebar-collapsed .sidebar-title,
  body.sidebar-collapsed .sidebar-menu-group-name,
  body.sidebar-collapsed .sidebar-link-label,
  body.sidebar-collapsed .box-info-user-logged,
  body.sidebar-collapsed .sidebar-master-badge,
  body.sidebar-collapsed .sidebar-organization-name,
  body.sidebar-collapsed .alert-trial {
    display: none !important;
  }

  body.sidebar-collapsed .sidebar-wrapper .menu {
    margin-top: 0.75rem !important;
    padding: 0 0.625rem !important;
  }

  body.sidebar-collapsed .sidebar-wrapper .menu .sidebar-item {
    margin-top: 0.375rem;
  }

  body.sidebar-collapsed .sidebar-wrapper .menu .sidebar-item--separator {
    border-top: 1px solid #e3e6ef;
    margin-top: 0.75rem;
    padding-top: 0.45rem;
  }

  body.sidebar-collapsed .sidebar-menu-group {
    background: transparent;
    border: 0;
    border-top: 1px solid #e3e6ef;
    border-radius: 0;
    box-shadow: none;
    margin: 0.75rem 0 0;
    padding: 0.45rem 0 0;
  }

  body.sidebar-collapsed .sidebar-menu-group--first {
    border-top: 0;
    margin-top: 0.35rem;
    padding-top: 0.2rem;
  }

  body.sidebar-collapsed .sidebar-menu-group--active {
    border-top-color: rgba(67, 94, 190, 0.42);
  }

  body.theme-dark.sidebar-collapsed .sidebar-menu-group {
    border-top-color: #303044;
  }

  body.theme-dark.sidebar-collapsed .sidebar-wrapper .menu .sidebar-item--separator {
    border-top-color: #303044;
  }

  body.theme-dark.sidebar-collapsed .sidebar-menu-group--active {
    border-top-color: rgba(139, 158, 255, 0.48);
  }

  body.sidebar-collapsed .sidebar-wrapper .menu .sidebar-link {
    align-items: center;
    height: 48px;
    justify-content: center;
    padding: 0;
    width: 100%;
  }

  body.sidebar-collapsed .sidebar-menu-group-heading {
    display: none;
  }

  body.sidebar-collapsed .sidebar-menu-group-modules .sidebar-link {
    padding: 0 !important;
  }

  body.sidebar-collapsed .sidebar-wrapper .menu .sidebar-link i {
    font-size: 1.25rem;
    line-height: 1;
  }

  body.sidebar-collapsed .sidebar-wrapper .menu .sidebar-link i::before {
    vertical-align: middle;
  }

  body.sidebar-collapsed .box-profile {
    flex-direction: column;
    gap: 0.375rem;
    min-height: 112px;
    padding: 0.75rem 0.625rem;
  }

  body.sidebar-collapsed .sidebar-profile-link {
    flex: 0 0 44px;
    justify-content: center;
    width: 44px;
  }

  body.sidebar-collapsed .sidebar-notification-link {
    flex-basis: 36px;
    height: 36px;
    width: 36px;
  }

  body.sidebar-collapsed .sidebar-organization-menu {
    border-bottom: 1px solid #ebebeb;
    padding-bottom: 0.75rem !important;
  }

  body.theme-dark.sidebar-collapsed .sidebar-organization-menu {
    border-bottom-color: #303044;
  }

  body.sidebar-collapsed .sidebar-item-organization .btn-organizations {
    height: 46px;
    justify-content: center;
    min-height: 46px;
    padding: 0;
  }

  body.sidebar-collapsed .sidebar-item-organization .dropdown-toggle::after {
    bottom: 3px;
    margin: 0;
    position: absolute;
    right: 4px;
  }

  body.sidebar-collapsed .sidebar-item-organization .dropdown-menu {
    min-width: 230px;
  }

  body.sidebar-collapsed .sidebar-item-counter {
    font-size: 0.55rem;
    line-height: 1;
    min-width: 17px;
    padding: 0.2rem 0.3rem;
    right: -4px;
    top: -4px;
  }
}

@media screen and (max-width: 1199px) {
  .sidebar-collapse-control {
    display: none;
  }

  .sidebar-menu-group {
    margin-left: 0;
    margin-right: 0;
  }

  .sidebar-topbar {
    padding-right: 48px;
  }

  .sidebar-wrapper .sidebar-toggler.x {
    top: 16px !important;
  }
}

#main.embedded,
#main.embedded .page-heading.fixed-top,
body.theme-dark #main.embedded,
body.theme-dark #main.embedded .page-heading.fixed-top {
  margin-left: 0;
}

@media print {
  .sidebar-controls {
    display: none !important;
  }

  body.theme-dark #main,
  body.theme-dark #main.embedded,
  body.theme-dark #main .page-heading.fixed-top {
    margin-left: 0 !important;
  }

  body.theme-dark #main {
    padding: 0 !important;
  }
}
