* { box-sizing: border-box; margin: 0; padding: 0; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; }
body { background: #f0f2f5; height: 100vh; display: flex; overflow: hidden; }

.app-container { display: flex; width: 100%; height: 100%; background: #fff; }

/* Sidebar */
.sidebar { width: 300px; border-right: 1px solid #e0e0e0; display: flex; flex-direction: column; background: #fafafa; }
.sidebar-header { padding: 16px; border-bottom: 1px solid #e0e0e0; display: flex; justify-content: space-between; align-items: center; }
.sidebar-header h2 { font-size: 18px; color: #0068ff; }
.status-wrap { display: flex; align-items: center; gap: 10px; }
.status-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.status-dot.online { background: #22c55e; box-shadow: 0 0 6px #22c55e; }
.status-dot.offline { background: #ef4444; }
.btn-icon { background: none; border: none; cursor: pointer; font-size: 16px; }

.add-chat-box { display: flex; padding: 10px; gap: 6px; border-bottom: 1px solid #eee; }
.add-chat-box input { flex: 1; padding: 8px; border: 1px solid #ccc; border-radius: 6px; font-size: 13px; }
.add-chat-box button { padding: 0 12px; background: #0068ff; color: #fff; border: none; border-radius: 6px; cursor: pointer; font-weight: bold; }

.chat-list { list-style: none; overflow-y: auto; flex: 1; }
.chat-item { padding: 12px 16px; border-bottom: 1px solid #f0f0f0; cursor: pointer; transition: background 0.15s; }
.chat-item:hover { background: #eef4ff; }
.chat-item.active { background: #dceaff; border-left: 4px solid #0068ff; }
.chat-item-title { font-weight: 600; font-size: 14px; color: #222; margin-bottom: 4px; }
.chat-item-preview { font-size: 12px; color: #666; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Chat Area */
.chat-area { flex: 1; display: flex; flex-direction: column; background: #e5effa; }
.chat-header { padding: 14px 20px; background: #fff; border-bottom: 1px solid #e0e0e0; display: flex; justify-content: space-between; align-items: center; }
.chat-header h3 { font-size: 16px; color: #111; }
.chat-header small { color: #666; font-size: 12px; }
.btn-secondary { padding: 6px 12px; background: #f3f4f6; border: 1px solid #d1d5db; border-radius: 6px; cursor: pointer; font-size: 12px; }

.message-container { flex: 1; padding: 20px; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; }
.msg-bubble { max-width: 65%; padding: 10px 14px; border-radius: 12px; font-size: 14px; line-height: 1.4; position: relative; word-wrap: break-word; }
.msg-in { align-self: flex-start; background: #fff; color: #111; border-bottom-left-radius: 2px; box-shadow: 0 1px 2px rgba(0,0,0,0.08); }
.msg-out { align-self: flex-end; background: #0068ff; color: #fff; border-bottom-right-radius: 2px; }
.msg-meta { font-size: 11px; opacity: 0.7; margin-top: 4px; display: block; text-align: right; }
.msg-sender { font-size: 11px; font-weight: bold; color: #0068ff; margin-bottom: 3px; display: block; }

.chat-input-area { padding: 14px; background: #fff; border-top: 1px solid #e0e0e0; display: flex; gap: 10px; }
.chat-input-area input { flex: 1; padding: 10px 14px; border: 1px solid #ccc; border-radius: 20px; outline: none; font-size: 14px; }
.chat-input-area button { padding: 10px 22px; background: #0068ff; color: #fff; border: none; border-radius: 20px; font-weight: 600; cursor: pointer; }
.chat-input-area button:disabled { background: #a0c4ff; cursor: not-allowed; }

/* Modal */
.modal { position: fixed; inset: 0; background: rgba(0,0,0,0.5); display: flex; align-items: center; justify-content: center; z-index: 100; }
.modal.hidden { display: none; }
.modal-content { background: #fff; padding: 24px; border-radius: 12px; width: 400px; max-width: 90%; box-shadow: 0 10px 25px rgba(0,0,0,0.2); }
.modal-content h3 { margin-bottom: 8px; }
.modal-content p { font-size: 13px; color: #555; margin-bottom: 16px; }
.modal-content input { width: 100%; padding: 10px; border: 1px solid #ccc; border-radius: 6px; margin-bottom: 16px; }
.modal-actions { text-align: right; }
.btn-primary { padding: 10px 18px; background: #0068ff; color: #fff; border: none; border-radius: 6px; cursor: pointer; font-weight: 600; }