/* ============================================================================
   SIDEBAR (desktop)
   Hidden on phone, where the bottom nav takes over (see bottom-nav.css).
   ============================================================================ */

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 18px;
  width: var(--sidebar-w);
  padding: 16px 12px;
  overflow-y: auto;
  background: var(--sf);
  border-right: var(--bw) solid var(--line);
  font-family: var(--font);
  color: var(--tx);
  scrollbar-width: thin;
  scrollbar-color: var(--line) transparent;
}

/* Logo: the layered product wordmark at 124x27 (shared/_logo.html.erb) */
.sidebar-logo {
  display: flex;
  align-items: center;
  height: 40px;
  padding: 0 8px;
}

.sidebar-logo a {
  display: inline-flex;
  border-radius: 8px;
}

.logo-mark {
  position: relative;
  display: inline-block;
  width: 124px;
  height: 27px;
}

.logo-mark-layer {
  position: absolute;
  inset: 0;
  display: block;
}

.logo-mark-layer svg {
  display: block;
  width: 100%;
  height: 100%;
}

.logo-mark-whistle { color: var(--ac); }
.logo-mark-lip { color: var(--ac-deep); }
.logo-mark-word { color: var(--tx); }

/* Log session: the primary button, full width, 40 high with the design's
   10px corner rather than the pill used everywhere else */
.sidebar .sidebar-log-button {
  flex-shrink: 0;
  width: 100%;
  height: 40px;
  border-radius: 10px;
  font-size: 14px;
}

/* Nav items */
.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sidebar-nav .nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 40px;
  padding: 0 10px;
  border-radius: 8px;
  color: var(--tx);
  font: var(--fw-regular) 14px/1 var(--font);
  text-decoration: none;
  transition: background-color 80ms ease-out, color 80ms ease-out;
}

.sidebar-nav .nav-icon {
  flex: none;
  width: 20px;
  height: 20px;
}

.sidebar-nav .nav-label {
  flex: 1;
  min-width: 0;
}

.sidebar-nav .nav-item:hover {
  background: var(--sf2);
  color: var(--tx);
}

.sidebar-nav .nav-item .nav-icon {
  color: var(--ac);
}

.sidebar-nav .nav-item.active {
  background: var(--ac-bg);
  color: var(--ac-text);
  font-weight: var(--fw-medium);
}

.sidebar-spacer {
  flex: 1;
}

/* Account row: avatar, name, business name, settings cog */
.sidebar-account {
  flex-shrink: 0;
  padding-top: 8px;
  border-top: var(--bw) solid var(--line);
}

.sidebar-account-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px;
  border-radius: 8px;
  color: var(--tx);
  text-decoration: none;
  transition: background-color 80ms ease-out;
}

.sidebar-account-row:hover {
  background: var(--sf2);
}

.sidebar-account-row.active {
  background: var(--ac-bg);
}

#sidebar-account-avatar {
  display: contents;
}

.sidebar-account-text {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-width: 0;
}

.sidebar-account-name,
.sidebar-account-business {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.sidebar-account-name {
  font: var(--fw-regular) var(--t-body-s) var(--font);
}

.sidebar-account-business {
  font: var(--fw-regular) var(--t-micro) var(--font);
  color: var(--tx3);
}

.sidebar-account-cog {
  flex: none;
  width: 18px;
  height: 18px;
  color: var(--tx3);
}

.sidebar-account-row.active .sidebar-account-cog {
  color: var(--ac);
}

/* Phone: no sidebar */
@media (max-width: 1099px), (hover: none) and (pointer: coarse) {
  .sidebar {
    display: none;
  }
}
