.sidebar-footer {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0;
}

.tenant-account-menu {
  position: relative;
}

.tenant-account-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  padding: 0;
  border: 1px solid #334155;
  border-radius: 999px;
  background: #1e293b;
  color: #dbe2ea;
  cursor: pointer;
  transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}

.tenant-account-trigger:hover,
.tenant-account-trigger[aria-expanded="true"] {
  background: #263449;
  border-color: #475569;
  color: #fff;
}

.tenant-account-trigger:focus-visible,
.tenant-account-menu-item:focus-visible,
.tenant-account-card:focus-visible {
  outline: 3px solid #93c5fd;
  outline-offset: 2px;
}

.tenant-account-popover[hidden] {
  display: none !important;
}

.tenant-account-popover {
  position: absolute;
  left: 0;
  bottom: 58px;
  z-index: 70;
  display: grid;
  gap: 7px;
  width: 216px;
  padding: 8px;
  border: 1px solid #334155;
  border-radius: 12px;
  background: #172033;
  color: #e5e7eb;
  box-shadow: 0 18px 45px rgba(2, 6, 23, .38);
}

.tenant-account-popover::after {
  content: "";
  position: absolute;
  left: 15px;
  bottom: -6px;
  width: 11px;
  height: 11px;
  border-right: 1px solid #334155;
  border-bottom: 1px solid #334155;
  background: #172033;
  transform: rotate(45deg);
}

.tenant-account-menu-item {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-width: 0;
  min-height: 46px;
  padding: 9px 10px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: #d6deea;
  font: inherit;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}

.tenant-account-menu-item:hover {
  background: #202c3e;
  color: #fff;
}

.tenant-account-menu-item > .icon:first-child {
  color: #a8b5c9;
}

.tenant-account-menu-copy {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.tenant-account-menu-copy strong {
  overflow: hidden;
  color: inherit;
  font-size: 12px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tenant-account-menu-copy span {
  overflow: hidden;
  color: #94a3b8;
  font-size: 10px;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tenant-account-menu-chevron {
  width: 15px;
  height: 15px;
  color: #7f8da3;
  transform: rotate(180deg);
}

.tenant-account-card {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 9px 10px;
  align-items: center;
  padding: 11px;
  border: 1px solid #334b8f;
  border-radius: 10px;
  background: #172554;
  color: inherit;
  text-decoration: none;
  transition: background-color .15s ease, border-color .15s ease;
}

.tenant-account-card:hover {
  border-color: #5b78c7;
  background: #1e3a8a;
}

.tenant-account-card-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  background: #101a3b;
  color: #dbeafe;
}

.tenant-account-card-copy {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.tenant-account-card-copy strong,
.tenant-account-card-copy span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tenant-account-card-copy strong {
  color: #fff;
  font-size: 12px;
  font-weight: 700;
}

.tenant-account-card-copy span {
  margin-top: 2px;
  color: #c7d2fe;
  font-size: 10px;
}

.tenant-account-logout {
  margin-top: 1px;
  padding-top: 11px;
  border-top: 1px solid #2c394d;
  border-radius: 0 0 9px 9px;
}

@media (min-width: 901px) {
  html.sidebar-collapsed .sidebar-footer {
    justify-content: center;
  }

  html.sidebar-collapsed .tenant-account-popover {
    left: calc(100% + 12px);
    bottom: 0;
    width: 278px;
  }

  html.sidebar-collapsed .tenant-account-popover::after {
    left: -6px;
    bottom: 15px;
    border-right: 0;
    border-bottom: 1px solid #334155;
    border-left: 1px solid #334155;
    transform: rotate(45deg);
  }
}

@media (max-width: 900px) {
  .tenant-account-popover {
    left: 0;
    bottom: 60px;
    width: min(278px, calc(86vw - 28px));
  }
}

@media (prefers-reduced-motion: reduce) {
  .tenant-account-trigger,
  .tenant-account-card {
    transition: none;
  }
}
