/* sidebar.css
   Sidebar structure + items (no media queries)
*/
.sidebar {
  position: sticky;
  top: 0;
  height: 100dvh;
  background: #e8f1fb;
  color: #0b0f19;

  font-family: Arial, Helvetica, sans-serif;

  border-right: 1px solid rgba(15, 76, 129, 0.16);
  display: flex;
  flex-direction: column;
  padding: 14px 14px 12px;
  gap: 14px;
}

.sb-top {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 3px 15px; /* gives the brand the same comfortable inset */
}

.sb-logo {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
}
.sb-title {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.sb-appname {
  font-weight: 650;
  font-size: 14px;
  letter-spacing: 0.2px;
  opacity: 0.95;
}
.sb-plan {
  font-size: 13px;
  color: rgba(11, 15, 25, 0.62);
}

.sb-nav {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

#sbChatsSlot {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.sb-btn {
  width: 100%;
  border: 1px solid transparent;
  background: transparent;
  color: #0b0f19;
  border-radius: 12px;
  padding: 10px 10px;
  display: flex;
  align-items: center;
  gap: 10px;
  text-align: left;
  font-size: 14px;
}
.sb-btn:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.06);
}

.ico {
  width: 20px;
  display: grid;
  place-items: center;
  opacity: 0.95;
}

.sb-section {
  margin-top: 6px;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1 1 auto;
}
.sb-section-title {
  font-size: 12px;
  color: #0b0f19;
  padding: 0 6px;
}

.sb-chatlist {
  min-height: 0;
  overflow: auto;
  padding-right: 6px;
  flex: 1 1 auto;
}

.sb-chatrow {
  display: flex;
  align-items: center;
  gap: 8px;
  position: relative;
}

.sb-chatrow .sb-chat {
  flex: 1 1 auto;
  min-width: 0; /* required so ellipsis works inside flex */
}

.sb-chatmenu {
  flex: 0 0 auto;
  height: 34px;
  width: 34px;
  border-radius: 50%;
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 18px;
  display: grid;
  place-items: center;
  color: rgba(11, 15, 25, 0.6);
  padding: 0;
  -webkit-tap-highlight-color: transparent;
  transition: color 0.15s ease;
}

.sb-chatmenu:hover {
  color: rgba(11, 15, 25, 0.9);
  background: transparent;
}

.sb-chatmenu:hover {
  background: rgba(2, 6, 23, 0.06);
  color: rgba(11, 15, 25, 0.92);
}

.sb-chatmenu:active {
  background: rgba(2, 6, 23, 0.1);
}

.sb-chatmenu:focus {
  outline: none;
}

.sb-chatmenu:focus-visible {
  box-shadow: 0 0 0 3px rgba(10, 61, 98, 0.25);
}

.sb-chatmenu-pop {
  position: fixed;
  top: 0;
  left: 0;

  min-width: 170px;
  border-radius: 14px;

  /* more transparent glass */
  background: rgba(255, 255, 255, 0.35);
  border: 1px solid rgba(15, 23, 42, 0.1);
  box-shadow: 0 16px 44px rgba(15, 23, 42, 0.14),
    0 2px 10px rgba(15, 23, 42, 0.06);

  backdrop-filter: saturate(180%) blur(22px);
  -webkit-backdrop-filter: saturate(180%) blur(22px);

  padding: 6px;
  z-index: 90;

  display: flex;
  flex-direction: column;
  gap: 2px;

  overflow: hidden;

  animation: sbMenuIn 120ms ease-out;
  transform-origin: top right;
}

.sb-chatmenu-pop[hidden] {
  display: none !important;
}

@keyframes sbMenuIn {
  from {
    opacity: 0;
    transform: translateY(-4px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.sb-chatmenu-item {
  width: 100%;
  text-align: left;
  padding: 10px 12px;
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 14px;
  font-weight: 550;
  color: rgba(15, 23, 42, 0.92);
  display: block;
  white-space: nowrap;
  border-radius: 10px;
  transition: background 0.15s ease, color 0.15s ease;
}

.sb-chatmenu-item:hover {
  background: rgba(15, 23, 42, 0.045);
}

.sb-chatmenu-item.danger {
  color: #dc2626;
}

.sb-chatmenu-item.danger:hover {
  background: rgba(220, 38, 38, 0.085);
}

.sb-chatlist-empty {
  padding: 10px 6px;
  font-size: 13px;
  color: rgba(11, 15, 25, 0.6);
}

.sb-chat {
  width: 100%;
  text-align: left;
  background: transparent;
  color: #0b0f19;
  border: 1px solid transparent;
  border-radius: 12px;
  padding: 10px 10px;
  margin-bottom: 6px;
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  position: relative;
}

.sb-chat:hover {
  background: rgba(15, 76, 129, 0.08);
}
.sb-chat.active {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(15, 76, 129, 0.12);
}

.userchip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 8px;
  border-radius: 14px;
}
.avatar {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 12px;
}
.user-name {
  font-size: 13px;
  font-weight: 650;
}
.user-plan {
  font-size: 12px;
  color: rgba(11, 15, 25, 0.55);
  margin-top: 2px;
}

.sidebar svg {
  stroke: currentColor;
}

.avatar {
  overflow: hidden;
}

.avatar img {
  width: 100%;
  height: 100%;
  border-radius: 999px;
  object-fit: cover;
  display: block;
}
