/* ===================================
   MESSAGES TAB
   =================================== */

/* Header */
.msgs-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}

.msgs-header-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.msgs-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 18px;
  font-weight: 700;
  color: #18181b;
}

.msgs-title-icon {
  width: 20px;
  height: 20px;
  color: #18181b;
}

.msgs-count-badge {
  font-size: 11px;
  font-weight: 600;
  color: #71717a;
  background: #f4f4f5;
  border: 1px solid #e4e4e7;
  border-radius: 20px;
  padding: 2px 10px;
  white-space: nowrap;
}

.msgs-header-right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.msgs-bot-select {
  height: 34px;
  border: 1px solid #e4e4e7;
  border-radius: 8px;
  padding: 0 0.75rem;
  font-size: 13px;
  background: #fff;
  color: #18181b;
  cursor: pointer;
  outline: none;
}

.msgs-delete-btn {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  height: 34px;
  padding: 0 0.75rem;
  font-size: 12px;
  font-weight: 500;
  color: #ef4444;
  border: 1px solid #fee2e2;
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
  transition: background 0.15s;
  white-space: nowrap;
}
.msgs-delete-btn:hover { background: #fef2f2; }
.msgs-delete-btn i { width: 13px; height: 13px; }

/* Layout */
.msgs-layout {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 1rem;
  height: 640px;
}

/* Sidebar */
.msgs-sidebar {
  background: #f4f4f5;
  border: 1px solid #e4e4e7;
  border-radius: 14px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.msgs-search-wrap {
  position: relative;
  padding: 0.75rem;
  border-bottom: 1px solid #f4f4f5;
  flex-shrink: 0;
}

.msgs-search-icon {
  position: absolute;
  left: 1.35rem;
  top: 50%;
  transform: translateY(-50%);
  width: 14px;
  height: 14px;
  color: #a1a1aa;
}

.msgs-search-input {
  width: 100%;
  height: 34px;
  border: 1px solid #e4e4e7;
  border-radius: 8px;
  padding: 0 0.75rem 0 2.25rem;
  font-size: 13px;
  background: #fafafa;
  outline: none;
  transition: border-color 0.15s;
}
.msgs-search-input:focus { border-color: #a1a1aa; background: #fff; }

.msgs-empty-list {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  padding: 2.5rem 1rem;
  color: #a1a1aa;
  font-size: 13px;
}
.msgs-empty-list i { width: 28px; height: 28px; }

.msgs-list {
  flex: 1;
  overflow-y: auto;
  padding: 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

/* Conversation cards */
.msgs-conv-item {
  width: 100%;
  text-align: left;
  border: 1px solid #e4e4e7;
  border-radius: 10px;
  padding: 0.6rem 0.75rem;
  background: #fff;
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}
.msgs-conv-item:hover { background: #f9f9f9; border-color: #d4d4d8; }
.msgs-conv-item.active {
  background: #18181b;
  border-color: #18181b;
}

.msgs-conv-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.msgs-conv-date {
  font-size: 12px;
  font-weight: 600;
  color: #3f3f46;
  flex: 1;
  min-width: 0;
  truncate: clip;
}
.msgs-conv-item.active .msgs-conv-date { color: #fff; }

.msgs-conv-time {
  font-size: 11px;
  color: #a1a1aa;
  white-space: nowrap;
  flex-shrink: 0;
}
.msgs-conv-item.active .msgs-conv-time { color: rgba(255,255,255,0.6); }

.msgs-conv-preview {
  font-size: 12px;
  color: #71717a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.msgs-conv-item.active .msgs-conv-preview { color: rgba(255,255,255,0.7); }

.msgs-conv-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 0.1rem;
}

.msgs-conv-count {
  font-size: 11px;
  color: #a1a1aa;
  display: flex;
  align-items: center;
  gap: 3px;
}
.msgs-conv-item.active .msgs-conv-count { color: rgba(255,255,255,0.5); }

.msgs-conv-delete {
  padding: 3px;
  border-radius: 5px;
  background: transparent;
  border: none;
  cursor: pointer;
  color: #a1a1aa;
  opacity: 0;
  transition: opacity 0.15s, color 0.15s;
  display: flex;
  align-items: center;
}
.msgs-conv-item:hover .msgs-conv-delete,
.msgs-conv-item.active .msgs-conv-delete { opacity: 1; }
.msgs-conv-delete:hover { color: #ef4444; }
.msgs-conv-item.active .msgs-conv-delete { color: rgba(255,255,255,0.6); }
.msgs-conv-item.active .msgs-conv-delete:hover { color: #fca5a5; }

/* Detail panel */
.msgs-detail-panel {
  background: #fff;
  border: 1px solid #e4e4e7;
  border-radius: 14px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.msgs-detail-header {
  padding: 0.9rem 1.1rem;
  border-bottom: 1px solid #f4f4f5;
  flex-shrink: 0;
}

.msgs-detail-name {
  font-size: 15px;
  font-weight: 700;
  color: #18181b;
  margin-bottom: 0.25rem;
}

.msgs-detail-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.msgs-meta-item {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 11px;
  color: #a1a1aa;
}
.msgs-meta-item i { width: 12px; height: 12px; }

/* Empty state (right panel) */
.msgs-placeholder {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 2rem;
  text-align: center;
}

.msgs-placeholder-icon {
  width: 36px;
  height: 36px;
  color: #d4d4d8;
  margin-bottom: 0.25rem;
}

.msgs-placeholder-title {
  font-size: 14px;
  font-weight: 600;
  color: #52525b;
}

.msgs-placeholder-sub {
  font-size: 12px;
  color: #a1a1aa;
  max-width: 240px;
}
