/* ==========================================================================
   CHAT MODULE CSS — WHATSAPP DESK, THREADS, VIEWPORT
   Arquivo fatiado < 110 lines
   ========================================================================== */

.chat-container {
  display: grid; grid-template-columns: 340px 1fr;
  height: calc(100vh - var(--header-height) - 70px);
  border: 1px solid var(--card-border); border-radius: var(--radius-lg);
  overflow: hidden; background: var(--bg-surface);
}

.chat-threads {
  border-right: 1px solid var(--card-border);
  display: flex; flex-direction: column; background: rgba(0, 0, 0, 0.2);
}

.chat-search-box {
  padding: 16px; border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.chat-search-input {
  width: 100%; padding: 10px 14px; background: var(--bg-elevated);
  border: 1px solid rgba(255, 255, 255, 0.08); border-radius: var(--radius-md);
  color: #fff; font-size: 13px; outline: none;
}

.thread-list { flex: 1; overflow-y: auto; }

.thread-item {
  padding: 14px 16px; border-bottom: 1px solid rgba(255, 255, 255, 0.03);
  cursor: pointer; transition: var(--transition);
  display: flex; gap: 12px; align-items: center;
}

.thread-item:hover { background: rgba(255, 255, 255, 0.03); }
.thread-item.active { background: rgba(197, 160, 89, 0.1); border-left: 3px solid var(--gold-primary); }

.thread-avatar {
  width: 42px; height: 42px; border-radius: 50%;
  background: var(--gold-gradient); display: flex;
  align-items: center; justify-content: center;
  font-weight: 700; color: #000; flex-shrink: 0;
}

.thread-content { flex: 1; min-width: 0; }
.thread-title-row { display: flex; justify-content: space-between; margin-bottom: 4px; }
.thread-name { font-size: 13.5px; font-weight: 600; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.thread-time { font-size: 11px; color: var(--text-muted); }
.thread-snippet { font-size: 12px; color: var(--text-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.chat-viewport { display: flex; flex-direction: column; background: var(--bg-deep); }

.chat-header {
  padding: 16px 24px; border-bottom: 1px solid var(--card-border);
  display: flex; align-items: center; justify-content: space-between;
  background: rgba(15, 16, 21, 0.5);
}

.chat-messages {
  flex: 1; padding: 24px; overflow-y: auto;
  display: flex; flex-direction: column; gap: 14px;
}

.message-bubble {
  max-width: 70%; padding: 12px 16px; border-radius: 16px;
  font-size: 13.5px; line-height: 1.5; position: relative;
}

.message-in {
  align-self: flex-start; background: var(--bg-elevated);
  border: 1px solid rgba(255, 255, 255, 0.08); border-bottom-left-radius: 4px;
}

.message-out {
  align-self: flex-end;
  background: linear-gradient(135deg, rgba(197, 160, 89, 0.25) 0%, rgba(197, 160, 89, 0.12) 100%);
  border: 1px solid var(--card-border); border-bottom-right-radius: 4px;
}

.message-time { font-size: 10.5px; color: var(--text-muted); text-align: right; margin-top: 4px; }

.chat-input-bar {
  padding: 16px 24px; border-top: 1px solid var(--card-border);
  display: flex; gap: 12px; align-items: center; background: var(--bg-surface);
}

.chat-input-bar input {
  flex: 1; padding: 12px 18px; background: var(--bg-elevated);
  border: 1px solid rgba(255, 255, 255, 0.1); border-radius: 25px;
  color: #fff; font-size: 14px; outline: none;
}
