/* Team Chat — dark theme, mirip screenshot referensi. */
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body { background: #0b0d10; color: #e8eaed; font-family: -apple-system, "Segoe UI", Roboto, Arial, sans-serif; font-size: 14px; }
a { color: #4da3ff; text-decoration: none; }

/* ---------- Login ---------- */
.login-page { display: flex; align-items: center; justify-content: center; min-height: 100vh; }
.login-card { background: #15181d; border: 1px solid #262a31; border-radius: 12px; padding: 32px; width: 340px; }
.login-logo { width: 52px; height: 52px; border-radius: 50%; background: #2f7bff; color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 18px; margin-bottom: 14px; }
.login-card h1 { font-size: 20px; margin-bottom: 4px; }
.login-sub { color: #9aa0a6; margin-bottom: 18px; }
.login-card label { display: block; color: #9aa0a6; font-size: 12px; margin: 12px 0 5px; }
.login-card input[type=text], .login-card input[type=password] { width: 100%; padding: 10px 12px; border-radius: 8px; border: 1px solid #33373f; background: #0f1216; color: #e8eaed; outline: none; }
.login-card input:focus { border-color: #2f7bff; }
.login-card button { width: 100%; margin-top: 18px; padding: 11px; border: none; border-radius: 8px; background: #2f7bff; color: #fff; font-size: 15px; font-weight: 600; cursor: pointer; }
.login-card button:hover { background: #1f6ae0; }
.login-error { background: #3d1a1a; border: 1px solid #7a2e2e; color: #ffb4b4; padding: 9px 12px; border-radius: 8px; margin-top: 10px; }

/* ---------- App layout ---------- */
.app { display: flex; height: 100vh; overflow: hidden; }
.sidebar { width: 300px; min-width: 260px; background: #121417; border-right: 1px solid #23262b; display: flex; flex-direction: column; }
.side-top { display: flex; gap: 8px; padding: 14px 12px 8px; }
.search-wrap { flex: 1; display: flex; align-items: center; background: #1d2025; border: 1px solid #2b2f36; border-radius: 8px; padding: 0 10px; }
.search-icon { color: #9aa0a6; margin-right: 6px; }
.search-wrap input { flex: 1; background: transparent; border: none; outline: none; color: #e8eaed; padding: 9px 0; }
.btn-plus { width: 38px; height: 38px; border-radius: 8px; border: 1px solid #2b2f36; background: #1d2025; color: #e8eaed; font-size: 20px; cursor: pointer; }
.btn-plus:hover { background: #262a31; }
.me { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-bottom: 1px solid #23262b; }
.avatar { width: 40px; height: 40px; min-width: 40px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 700; color: #0b0d10; background: #e8e8e8; }
.avatar.ceo { background: #f5f5f5; font-size: 11px; }
.me-name { font-weight: 600; }
.me-sub { color: #9aa0a6; font-size: 12px; }
.side-section { padding: 14px 14px 6px; color: #9aa0a6; font-size: 11px; font-weight: 700; letter-spacing: .04em; }
.side-section .count { color: #6b7076; font-weight: 400; }
.agent-list { padding: 0 6px; }
.agent-item { display: flex; gap: 10px; align-items: center; padding: 9px 10px; border-radius: 9px; cursor: pointer; }
.agent-item:hover { background: #1b1e23; }
.agent-item.active { background: #22262d; }
.agent-item .avatar { width: 36px; height: 36px; min-width: 36px; font-size: 14px; }
.agent-meta { min-width: 0; }
.agent-name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.agent-last { color: #9aa0a6; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-foot { margin-top: auto; padding: 12px 14px; border-top: 1px solid #23262b; display: flex; justify-content: space-between; align-items: center; font-size: 12px; }
.side-status { color: #ffb020; }

/* ---------- Chat ---------- */
.chat { flex: 1; display: flex; flex-direction: column; background: #0b0d10; min-width: 0; }
.chat-header { display: flex; align-items: center; gap: 12px; padding: 12px 20px; border-bottom: 1px solid #23262b; background: #101215; }
.hdr-name { font-weight: 700; font-size: 15px; }
.hdr-sub { color: #9aa0a6; font-size: 12px; margin-top: 2px; }
.hdr-right { margin-left: auto; }
.hdr-badge { background: #1d2025; border: 1px solid #2b2f36; color: #9aa0a6; font-size: 11px; padding: 4px 9px; border-radius: 20px; }
.messages { flex: 1; overflow-y: auto; padding: 20px; display: flex; flex-direction: column; gap: 12px; }
.msg { max-width: 78%; padding: 11px 14px; border-radius: 12px; line-height: 1.5; white-space: pre-wrap; word-wrap: break-word; }
.msg.user { align-self: flex-end; background: #2f7bff; color: #fff; border-bottom-right-radius: 4px; }
.msg.assistant { align-self: flex-start; background: #1d2025; border: 1px solid #262a31; border-bottom-left-radius: 4px; }
.msg.system { align-self: center; background: transparent; color: #9aa0a6; font-size: 12px; padding: 4px 10px; border: 1px dashed #33373f; border-radius: 20px; }
.msg .msg-time { display: block; font-size: 10px; color: rgba(255,255,255,.55); margin-top: 5px; text-align: right; }
.msg.assistant .msg-time { color: #6b7076; }
.msg-empty { color: #9aa0a6; text-align: center; margin-top: 40px; }
.thinking { display: flex; align-items: center; gap: 6px; padding: 0 20px 10px; color: #9aa0a6; font-size: 13px; }
.thinking .dot { width: 7px; height: 7px; border-radius: 50%; background: #4da3ff; animation: blink 1.2s infinite; }
.thinking .dot:nth-child(2) { animation-delay: .2s; }
.thinking .dot:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%, 80%, 100% { opacity: .25; } 40% { opacity: 1; } }
.composer { display: flex; gap: 10px; padding: 14px 20px 18px; border-top: 1px solid #23262b; background: #101215; }
.composer input { flex: 1; padding: 12px 14px; border-radius: 10px; border: 1px solid #33373f; background: #1d2025; color: #e8eaed; outline: none; font-size: 14px; }
.composer input:focus { border-color: #2f7bff; }
.composer button { width: 46px; border: none; border-radius: 10px; background: #2f7bff; color: #fff; font-size: 18px; cursor: pointer; }
.composer button:hover { background: #1f6ae0; }
.composer button:disabled { opacity: .5; cursor: default; }
@media (max-width: 700px) { .sidebar { width: 220px; min-width: 200px; } .msg { max-width: 92%; } }

/* Markdown di dalam bubble pesan */
.msg strong { font-weight: 700; }
.msg em { font-style: italic; }
.msg code { background: #2a2e35; padding: 1px 5px; border-radius: 4px; font-size: 0.92em; }
.msg pre { background: #14161a; border: 1px solid #262a31; padding: 10px 12px; border-radius: 8px; overflow-x: auto; margin: 6px 0; white-space: pre-wrap; }
.msg pre code { background: none; padding: 0; }
.msg ul, .msg ol { margin: 4px 0; padding-left: 20px; }
.msg li { margin: 2px 0; }
.msg a { color: #7fb0ff; }
