/* ========================================
   SIDEBAR.CSS - Sidebar styling
   ======================================== */

.sb-h {
  margin-bottom: var(--sp-4);
}

.brand {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  margin-bottom: var(--sp-3);
}

.brand-icon {
  font-size: 1.5rem;
}

#appBrandName {
  font-weight: 700;
  font-size: 1.125rem;
}

.sb-project {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}

.sb-master-switch {
  margin-top: var(--sp-2);
}

.sb-master-switch[hidden] {
  display: none !important;
}

.sb-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--muted);
}

.sb-nav {
  flex: 1;
  overflow-y: auto;
}

.sb-section {
  font-size: 0.75rem;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--muted);
  margin: var(--sp-4) 0 var(--sp-2) 0;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-2) var(--sp-3);
  border-radius: var(--r-sm);
  cursor: pointer;
  transition: all 0.2s;
  color: var(--text);
  margin-bottom: var(--sp-2);
}

.nav-item:hover {
  background: var(--bg);
  color: var(--accent);
}

.nav-item.active {
  background: var(--bg);
  color: var(--accent);
  font-weight: 600;
}

.sb-footer {
  border-top: 1px solid var(--border);
  padding-top: var(--sp-3);
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}

.sidebar .user-pill,
.l-sidebar .user-pill {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-2);
  border-radius: var(--r-sm);
  transition: all 0.2s;
}

.sidebar .sb-account-card,
.l-sidebar .sb-account-card {
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.07);
  border-radius: 14px;
  padding: 0.7rem 0.75rem;
  align-items: flex-start;
  gap: 0.65rem;
}

.sidebar .sb-account-card:hover,
.l-sidebar .sb-account-card:hover {
  background: rgba(255, 255, 255, 0.1);
}

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--accent);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.875rem;
}

.user-meta {
  flex: 1;
  min-width: 0;
}

.user-meta .name {
  font-weight: 600;
  font-size: 0.9rem;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-meta .role {
  font-size: 0.75rem;
  color: var(--muted);
  margin-top: 0.08rem;
  font-weight: 700;
}

.sb-auth-actions {
  display: grid;
  gap: var(--sp-2);
}

.sb-user-settings-btn {
  margin-left: auto;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.95);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  cursor: pointer;
  transition: background-color 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}

.sb-user-settings-btn:hover {
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(255, 255, 255, 0.34);
  transform: translateY(-1px);
}

.sb-user-settings-btn:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.55);
  outline-offset: 2px;
}

.sb-auth-btn {
  width: 100%;
  justify-content: center;
}

.sb-demo-btn {
  width: 100%;
  justify-content: space-between;
  align-items: center;
  height: 34px;
  padding: 0 10px;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: none;
  letter-spacing: 0.01em;
}

.sb-demo-btn__label {
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
}

.sb-demo-btn__indicator {
  width: 16px;
  height: 6px;
  border-radius: 999px;
  background: #22c55e;
  box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.12) inset;
  transition: background-color 0.18s ease;
}

.sb-demo-btn.is-on .sb-demo-btn__indicator {
  background: #22c55e;
}

.sb-demo-btn.is-off {
  opacity: 0.85;
}

.sb-demo-btn.is-off .sb-demo-btn__indicator {
  background: #ef4444;
}
