/* Shared workspace switcher · Unslop by Damir Sokolovsky (@heydamir), CC BY 4.0. */
[data-workspace-switcher] {
  position: relative;
  z-index: 45;
  flex: 0 0 auto;
  min-width: 0;
}

.wsw-shell {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.wsw-status,
.wsw-current {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 36px;
  white-space: nowrap;
}

.wsw-status {
  color: #61706b;
  font-size: 12px;
}

.wsw-status i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #28775f;
}

.wsw-current {
  padding: 0 12px;
  border: 1px solid #c9dbd6;
  border-radius: 9px;
  background: #eef6f2;
  color: #245149;
  font-size: 13px;
  font-weight: 500;
}

.wsw-icon {
  width: 17px;
  height: 17px;
  flex: 0 0 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.wsw-trigger {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 0 13px;
  border: 1px solid #d1dcd8;
  border-radius: 10px;
  background: #fffefa;
  color: #25332f;
  font: inherit;
  font-size: 13px;
  cursor: pointer;
  transition: background-color 140ms ease, border-color 140ms ease;
}

.wsw-trigger:hover {
  border-color: #aabdb7;
  background: #f7f5ee;
}

.wsw-trigger svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.wsw-trigger[aria-expanded="true"] svg {
  transform: rotate(180deg);
}

.wsw-menu {
  position: absolute;
  top: calc(100% + 9px);
  right: 0;
  z-index: 80;
  width: min(360px, calc(100vw - 24px));
  padding: 8px;
  border: 1px solid #d6ddd8;
  border-radius: 14px;
  background: #fffdf8;
  box-shadow: 0 18px 44px rgba(29, 47, 42, .14);
}

.wsw-option {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) auto;
  align-items: center;
  gap: 11px;
  min-height: 66px;
  padding: 9px 10px;
  border-radius: 10px;
  color: #34433e;
  text-decoration: none;
  transition: background-color 140ms ease;
}

.wsw-option:hover {
  background: #f3f6f2;
  text-decoration: none;
}

.wsw-option.active {
  background: #eef6f2;
  color: #1f5148;
}

.wsw-icon-box {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 9px;
  background: #e6eeeb;
  color: #415c55;
}

.wsw-option.active .wsw-icon-box {
  background: #dcebe5;
  color: #1f6659;
}

.wsw-option-copy {
  min-width: 0;
}

.wsw-option-copy strong,
.wsw-option-copy small {
  display: block;
}

.wsw-option-copy strong {
  font-size: 14px;
  font-weight: 500;
}

.wsw-option-copy small {
  margin-top: 3px;
  color: #6b766f;
  font-size: 11px;
  line-height: 1.45;
}

.wsw-active-mark {
  color: #2f6c5c;
  font-size: 10px;
}

.wsw-menu-note {
  margin: 4px 0 0;
  padding: 9px 10px 4px;
  border-top: 1px solid #ece8df;
  color: #747e78;
  font-size: 10px;
}

[data-workspace-sidebar] {
  flex: 0 0 auto;
  margin: 8px 8px 0;
  padding: 12px 8px 10px;
  border-top: 1px solid rgba(255, 255, 255, .1);
}

.wsw-side-title {
  padding: 0 4px 7px;
  color: currentColor;
  font-size: 11px;
  font-weight: 500;
  opacity: .64;
}

.wsw-side-list {
  display: grid;
  gap: 2px;
}

.wsw-side-item {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 6px 8px;
  border-radius: 7px;
  color: inherit;
  font-size: 13px;
  text-decoration: none;
  opacity: .8;
  transition: background-color 140ms ease, color 140ms ease, opacity 140ms ease;
}

.wsw-side-item:hover {
  color: #fff;
  background: rgba(255, 255, 255, .07);
  text-decoration: none;
  opacity: 1;
}

.wsw-side-item.active {
  color: #fff;
  background: rgba(255, 255, 255, .09);
  box-shadow: inset 2px 0 0 #d8a64b;
  opacity: 1;
}

.wsw-side-item small {
  color: currentColor;
  font-size: 10px;
  opacity: .56;
}

#finance-app [data-workspace-sidebar] {
  border-top-color: rgba(31, 42, 37, .12);
}

#finance-app .wsw-side-title {
  color: #65716b;
  opacity: 1;
}

#finance-app .wsw-side-item {
  color: #48564f;
  opacity: 1;
}

#finance-app .wsw-side-item:hover {
  color: #1f2a25;
  background: #f1eee6;
}

#finance-app .wsw-side-item.active {
  color: #0d6f64;
  background: #e6f1ed;
  box-shadow: inset 2px 0 0 #b47a24;
}

#finance-app .wsw-side-item small {
  opacity: .7;
}

.portal-workspace-header {
  flex-wrap: wrap;
}

.portal-workspace-actions {
  align-items: center;
}

.portal-workspace-actions .wsw-menu {
  right: 0;
  left: auto;
}

@media (max-width: 760px) {
  [data-workspace-switcher] {
    min-width: 0;
  }

  .wsw-shell {
    gap: 6px;
  }

  .wsw-status {
    display: none;
  }

  .wsw-current {
    max-width: 118px;
    padding: 0 9px;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .wsw-current span {
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .wsw-trigger {
    min-height: 36px;
    padding: 0 10px;
    font-size: 12px;
  }

  .wsw-menu {
    right: auto;
    left: 0;
  }

  .portal-workspace-header {
    gap: 12px;
  }

  .portal-workspace-actions {
    width: 100%;
    justify-content: space-between;
  }

  .portal-workspace-actions [data-workspace-switcher] {
    flex: 1 1 100%;
  }

  .portal-workspace-actions .wsw-shell {
    justify-content: flex-start;
  }

  .sales-top,
  .procurement-top {
    flex-wrap: wrap;
  }

  .sales-user,
  .procurement-user {
    width: 100%;
    justify-content: flex-start;
  }

  .topbar-right {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .topbar-right [data-workspace-switcher] {
    width: auto;
    justify-self: start;
  }

  .topbar-right .online-chip {
    width: auto;
    justify-self: end;
  }

  .finance-app .topbar-actions [data-workspace-switcher],
  .topbar-actions [data-workspace-switcher] {
    grid-column: 1 / -1;
  }

  .head-actions [data-workspace-switcher] {
    grid-column: 1 / -1;
  }
}

@media (max-width: 430px) {
  .wsw-current {
    max-width: 94px;
  }

  .wsw-trigger span {
    display: inline;
  }
}
