/* ── NAV ── */
.nav { margin-left: auto; display: flex; gap: 8px; }
.nav a {
  color: #fff;
  text-decoration: none;
  font-size: 1.05rem;
  font-weight: 800;
  padding: 6px 18px;
  border-radius: 6px;
  letter-spacing: .4px;
  transition: background .15s;
}
.nav a:hover {
  background: rgba(255,255,255,.2);
}
.nav a.active {
  background: rgba(255,255,255,.25);
  color: #fff;
}

/* ── LAYOUT ── */
.chat-layout {
  display: flex;
  height: calc(100vh - 50px);
  max-width: 1200px;
  margin: 0 auto;
}

/* ── SIDEBAR ── */
.chat-sidebar {
  width: 230px;
  flex-shrink: 0;
  background: #fff;
  border-right: 1px solid var(--border);
  padding: 20px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow-y: auto;
}
.chat-sidebar h3 {
  font-size: .78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--sub);
  margin-bottom: 4px;
}
.chat-sidebar hr { border: none; border-top: 1px solid var(--border); margin: 4px 0; }

.quick-btn {
  width: 100%;
  text-align: left;
  background: var(--gray);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px 10px;
  font-size: .82rem;
  color: var(--text);
  cursor: pointer;
  line-height: 1.3;
  transition: background .12s, border-color .12s;
}
.quick-btn:hover { background: #e5e7eb; border-color: #9ca3af; }

.btn-clear-chat {
  margin-top: auto;
  background: none;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 7px 12px;
  font-size: .82rem;
  color: var(--sub);
  cursor: pointer;
  width: 100%;
}
.btn-clear-chat:hover { border-color: #ef4444; color: #ef4444; }

/* ── CHAT MAIN ── */
.chat-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: #f9fafb;
  min-width: 0;
}

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

/* ── MESAJLAR ── */
.msg { display: flex; }
.msg--user { justify-content: flex-end; }
.msg--bot  { justify-content: flex-start; }

.msg-bubble {
  max-width: 75%;
  padding: 12px 16px;
  border-radius: 14px;
  font-size: .93rem;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
}

.msg--user .msg-bubble {
  background: var(--blue);
  color: #fff;
  border-bottom-right-radius: 4px;
}

.msg--bot .msg-bubble {
  background: #fff;
  color: var(--text);
  border: 1px solid var(--border);
  border-bottom-left-radius: 4px;
  box-shadow: var(--shadow);
}

/* Markdown-benzeri tablo */
.msg-bubble table {
  border-collapse: collapse;
  font-size: .85rem;
  margin-top: 8px;
  width: 100%;
}
.msg-bubble th, .msg-bubble td {
  border: 1px solid var(--border);
  padding: 5px 8px;
  text-align: left;
}
.msg-bubble th { background: var(--gray); font-weight: 600; }

/* Yazıyor animasyonu */
.typing-dots span {
  display: inline-block;
  width: 7px; height: 7px;
  background: var(--sub);
  border-radius: 50%;
  margin: 0 2px;
  animation: bounce .9s infinite;
}
.typing-dots span:nth-child(2) { animation-delay: .15s; }
.typing-dots span:nth-child(3) { animation-delay: .30s; }
@keyframes bounce {
  0%, 80%, 100% { transform: translateY(0); }
  40%           { transform: translateY(-6px); }
}

/* ── INPUT ── */
.chat-input-wrap {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  padding: 14px 20px;
  background: #fff;
  border-top: 1px solid var(--border);
}

#chatInput {
  flex: 1;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 14px;
  font-size: .95rem;
  font-family: inherit;
  resize: none;
  max-height: 140px;
  overflow-y: auto;
  outline: none;
  transition: border-color .15s;
  line-height: 1.45;
}
#chatInput:focus { border-color: var(--blue); }

#sendBtn {
  background: var(--blue);
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 10px 22px;
  font-size: .95rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background .15s;
  height: 42px;
}
#sendBtn:hover    { background: var(--blue-dk); }
#sendBtn:disabled { opacity: .5; cursor: not-allowed; }

/* ── RESPONSIVE ── */
@media (max-width: 650px) {
  .chat-sidebar { display: none; }
  .msg-bubble   { max-width: 92%; }
}
