/* ── SIDEBAR ── */
.sidebar {
  background: #ffffff;
  border-right: 1px solid #e9e9e7;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.sidebar-top {
  padding: 8px 10px;
  border-bottom: 1px solid #e9e9e7;
  flex-shrink: 0;
}

.sidebar-top input {
  width: 100%;
  padding: 6px 10px;
  border: 1px solid #e9e9e7;
  border-radius: 6px;
  font-size: 13px;
  color: #37352f;
  background: #f7f6f3;
  outline: none;
  font-family: inherit;
}
.sidebar-top input:focus { border-color: #2383e2; background: #ffffff; }

/* ── FILTER BAR ── */
.filter-bar {
  padding: 6px 10px;
  border-bottom: 1px solid #e9e9e7;
  display: flex;
  gap: 4px;
  overflow-x: auto;
  scrollbar-width: none;
  flex-shrink: 0;
}
.filter-bar::-webkit-scrollbar { display: none; }

.filter-btn {
  padding: 3px 10px;
  font-size: 12px;
  border-radius: 20px;
  border: 1px solid #e9e9e7;
  background: #ffffff;
  color: #37352f;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  font-family: inherit;
}
.filter-btn:hover { background: #f1f1ef; }
.filter-btn.active { background: #2383e2; color: #ffffff; border-color: #2383e2; }

/* ── CHAT LIST ── */
.chat-list {
  flex: 1;
  overflow-y: auto;
  min-height: 0;
}

/* ── CHAT ITEMS ── */
.chat-item {
  padding: 10px 13px 10px 13px;
  display: flex;
  gap: 11px;
  align-items: center;
  cursor: pointer;
  border-bottom: 1px solid #f1f1ef;
  border-left: 3px solid transparent;
  margin-left: 0;
}
.chat-item:hover { background: #f7f6f3; }
.chat-item.active {
  background: #edf4fd;
  border-left-color: #2383e2;
}
.chat-item.chat-item-unread {
  border-left: 3px solid #0F4C8A;
  background: rgba(15,76,138,0.03);
}
.chat-item.chat-item-unread.active {
  border-left-color: #0F4C8A;
}
.chat-item.chat-item-unread:hover { background: rgba(15,76,138,0.07); }
.chat-item-unread .chat-buyer-name { font-weight: 700; }

/* ── THUMBNAIL ── */
.chat-thumb {
  width: 50px;
  height: 50px;
  min-width: 50px;
  border-radius: 10px;
  object-fit: cover;
  border: 0.5px solid #e9e9e7;
  flex-shrink: 0;
  overflow: hidden;
}

.chat-thumb-letter {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 500;
  color: #ffffff;
  text-transform: uppercase;
}

.chat-body { flex: 1; min-width: 0; }

.chat-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  flex-shrink: 0;
}

.chat-buyer-name {
  font-size: 13px;
  font-weight: 500;
  color: #37352f;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-bottom: 1px;
}

.chat-time {
  font-size: 11px;
  color: #aaa;
  white-space: nowrap;
}

.chat-unread-badge {
  background: #E24B4A;
  color: #fff;
  border-radius: 10px;
  font-size: 10px;
  font-weight: 500;
  padding: 2px 6px;
  min-width: 18px;
  text-align: center;
}

/* Row 2: product title */
.chat-prod-title {
  font-size: 11.5px;
  font-style: italic;
  color: #9b9a97;
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Last message preview */
.chat-preview-text {
  font-size: 11px;
  color: #aaa;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 2px;
}

/* Row 3: price + badge + account + unread */
.chat-row-bottom {
  display: flex;
  align-items: center;
  gap: 6px;
}

.chat-price {
  font-size: 12px;
  font-weight: 500;
  color: #37352f;
  white-space: nowrap;
  flex-shrink: 0;
}

.unread-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  border-radius: 9px;
  background: #ef4444;
  color: white;
  font-size: 10px;
  font-weight: 700;
  flex-shrink: 0;
}

.badge {
  display: inline-flex;
  padding: 1px 7px;
  border-radius: 20px;
  font-size: 10px;
  font-weight: 500;
  white-space: nowrap;
  flex-shrink: 0;
}
.badge-new         { background: #f1f1ef; color: #9b9a97; }
.badge-in_progress { background: #dbeafe; color: #1d4ed8; }
.badge-ordered     { background: #fef9c3; color: #92400e; }
.badge-done        { background: #dcfce7; color: #15803d; }

.account-tag { font-size: 10px; color: #9b9a97; }

/* ── SECTION DIVIDERS ── */
.chat-section-label {
  font-size: 10px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: #aaa;
  padding: 10px 16px 5px;
  display: flex;
  align-items: center;
  gap: 7px;
}

.chat-section-count {
  background: #0F4C8A;
  color: #fff;
  font-size: 10px;
  font-weight: 600;
  padding: 1px 7px;
  border-radius: 10px;
  letter-spacing: 0;
}

.chat-section-gap {
  height: 8px;
  background: #F4F4F6;
}
