/**
 * JUQOR — Sidebar v2
 * Visual nível Telegram/WhatsApp Web
 */

/* Header com logo clicável */
.sidebar-header {
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg1);
  border-bottom: 1px solid var(--b1);
  flex-shrink: 0;
  min-height: 60px;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  padding: 4px 8px;
  margin-left: -8px;
  border-radius: 10px;
  transition: background 0.2s var(--ease);
  background: none;
  border: none;
  font-family: var(--fh);
}
.sidebar-logo:hover { background: var(--bg2); }

.sidebar-logo-icon {
  width: 34px; height: 34px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--a), var(--a-hover));
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 3px 10px var(--a2);
}
.sidebar-logo-text {
  font-size: 15px;
  color: var(--t0);
  font-weight: 800;
  letter-spacing: -.3px;
}
.sidebar-logo-text span { color: var(--a); }

.sidebar-header-actions {
  display: flex;
  gap: 4px;
}

/* Profile card */
.sidebar-profile {
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--b1);
  flex-shrink: 0;
  cursor: pointer;
  transition: background 0.2s var(--ease);
}
.sidebar-profile:hover { background: var(--bg2); }

.sidebar-avatar {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--a3), var(--purple-d));
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--b1);
  flex-shrink: 0;
}
.sidebar-avatar span {
  font-size: 15px;
  color: var(--a);
  font-weight: 700;
}

.sidebar-profile-info { flex: 1; min-width: 0; }
.sidebar-profile-name {
  font-size: 14px;
  color: var(--t0);
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sidebar-profile-wallet {
  font-size: 11px;
  color: var(--t3);
  font-family: ui-monospace, 'SF Mono', monospace;
  margin-top: 2px;
}

/* Search bar */
.sidebar-search {
  padding: 10px 12px;
  flex-shrink: 0;
}

/* Actions row */
.sidebar-actions {
  padding: 0 12px 12px;
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}
.sidebar-actions .btn-secondary {
  flex: 1;
  font-weight: 600;
}

/* List container */
.sidebar-list {
  flex: 1;
  overflow-y: auto;
  padding-bottom: 8px;
}

/* Section label */
.sidebar-label {
  padding: 10px 18px 6px;
  font-size: 10px;
  color: var(--t3);
  letter-spacing: 2px;
  text-transform: uppercase;
  font-weight: 600;
}

/* Contact/Group item — item único unificado */
.contact-item {
  width: 100%;
  padding: 10px 14px;
  border: none;
  background: transparent;
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: left;
  transition: background 0.15s var(--ease);
  cursor: pointer;
  color: var(--t1);
  font-family: var(--fh);
  position: relative;
}
.contact-item:hover { background: var(--bg2); }
.contact-item.active {
  background: var(--a3);
}
.contact-item.active .contact-name { color: var(--a); }

.contact-avatar {
  width: 48px; height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  flex-shrink: 0;
  font-size: 17px;
  font-weight: 700;
}
.contact-avatar.dm {
  background: linear-gradient(135deg, rgba(6,214,160,.20), rgba(59,130,246,.20));
  color: var(--a);
  border: 1px solid rgba(6,214,160,.12);
}
.contact-avatar.grp {
  background: linear-gradient(135deg, rgba(139,92,246,.20), rgba(59,130,246,.20));
  color: var(--purple);
  border: 1px solid rgba(139,92,246,.12);
}

.online-dot {
  position: absolute;
  bottom: 0; right: 0;
  width: 12px; height: 12px;
  border-radius: 50%;
  background: var(--green);
  border: 2.5px solid var(--bg1);
}

.contact-info { flex: 1; min-width: 0; }
.contact-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 3px;
}
.contact-name {
  font-size: 14px;
  color: var(--t0);
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
}
.contact-name .members {
  font-size: 10px;
  color: var(--t3);
  font-weight: 400;
  margin-left: 4px;
}
.contact-time {
  font-size: 11px;
  color: var(--t3);
  font-family: var(--fm);
  flex-shrink: 0;
}
.contact-bottom-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.contact-last {
  font-size: 12px;
  color: var(--t2);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
}
.contact-last .you { color: var(--t3); }

.contact-meta {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

/* Empty list state */
.sidebar-empty {
  padding: 40px 20px;
  text-align: center;
  color: var(--t3);
}
.sidebar-empty-icon {
  width: 56px; height: 56px;
  border-radius: 50%;
  background: var(--bg2);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 14px;
}
.sidebar-empty-title {
  font-size: 13px;
  color: var(--t1);
  font-weight: 600;
  margin-bottom: 4px;
}
.sidebar-empty-sub {
  font-size: 11px;
  color: var(--t3);
  line-height: 1.5;
}
