/* Reset & Global */
* { margin:0; padding:0; box-sizing:border-box; }
body { font-family: 'Segoe UI', 'Helvetica Neue', sans-serif; background: #e5ddd5; height:100vh; display:flex; justify-content:center; align-items:center; }
.app { width:100%; max-width:1200px; height:100vh; display:flex; background:#fff; box-shadow:0 0 20px rgba(0,0,0,0.1); overflow:hidden; }

/* Sidebar */
.sidebar { width:35%; min-width:280px; background:#f7f9fc; border-right:1px solid #e0e0e0; display:flex; flex-direction:column; }
.sidebar-header { background:#075e54; color:#fff; padding:15px 20px; display:flex; justify-content:space-between; align-items:center; }
.profile { display:flex; align-items:center; gap:12px; }
.profile .avatar { width:40px; height:40px; border-radius:50%; object-fit:cover; }
.profile .name { font-weight:600; font-size:16px; }
.header-actions { display:flex; gap:15px; font-size:18px; cursor:pointer; }
.status-dot { display:inline-block; width:10px; height:10px; border-radius:50%; }
.status-dot.online { background:#31a24c; }
.search-bar { padding:10px 15px; background:#fff; border-bottom:1px solid #e0e0e0; }
.search-bar input { width:100%; padding:10px 15px; border:none; border-radius:20px; background:#f0f0f0; font-size:14px; }
.contacts { flex:1; overflow-y:auto; }
.contact-item { display:flex; align-items:center; padding:12px 15px; border-bottom:1px solid #f0f0f0; cursor:pointer; transition:background 0.2s; }
.contact-item:hover { background:#f0f2f5; }
.contact-item .avatar { width:45px; height:45px; border-radius:50%; object-fit:cover; margin-right:12px; }
.contact-item .info { flex:1; min-width:0; }
.contact-item .info .name { font-weight:500; }
.contact-item .info .last-msg { font-size:13px; color:#888; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.contact-item .meta { display:flex; flex-direction:column; align-items:flex-end; gap:4px; }
.contact-item .meta .time { font-size:11px; color:#999; }
.online-status { width:10px; height:10px; border-radius:50%; display:inline-block; }
.online-status.online { background:#31a24c; }
.online-status.offline { background:#ccc; }
.no-contacts { padding:30px; text-align:center; color:#888; }

/* Chat Area (kosong) */
.chat-area { flex:1; background:#e5ddd5; display:flex; justify-content:center; align-items:center; }
.empty-state { text-align:center; color:#888; }
.empty-state h2 { font-weight:300; margin-top:10px; }
.empty-state p { margin-top:5px; }

/* Chat View */
.chat-view { flex-direction:column; }
.chat-header { background:#075e54; color:#fff; padding:10px 15px; display:flex; align-items:center; gap:12px; }
.chat-header .back-btn { color:#fff; font-size:24px; text-decoration:none; }
.chat-header .avatar { width:40px; height:40px; border-radius:50%; object-fit:cover; }
.chat-header .contact-info { flex:1; }
.chat-header .contact-info .name { font-weight:600; }
.chat-header .contact-info .status { font-size:13px; opacity:0.8; }
.messages { flex:1; padding:15px 20px; overflow-y:auto; display:flex; flex-direction:column; background:#e5ddd5; }
.message { display:flex; margin-bottom:6px; }
.message.sent { justify-content:flex-end; }
.message.received { justify-content:flex-start; }
.bubble { max-width:70%; padding:8px 12px; border-radius:18px; position:relative; word-wrap:break-word; }
.message.sent .bubble { background:#dcf8c6; border-top-right-radius:4px; }
.message.received .bubble { background:#fff; border-top-left-radius:4px; }
.bubble .time { font-size:10px; color:#999; margin-left:10px; }
.bubble .status { font-size:12px; margin-left:4px; color:#999; }
.bubble .status.read { color:#34b7f1; }
.chat-image { max-width:100%; border-radius:8px; max-height:250px; }

/* Input Area */
.input-area { background:#f0f0f0; padding:10px 15px; display:flex; align-items:center; gap:10px; border-top:1px solid #ddd; }
.input-area input[type="text"] { flex:1; padding:10px 15px; border:none; border-radius:20px; font-size:15px; background:#fff; }
.input-area button { background:transparent; border:none; font-size:22px; cursor:pointer; padding:5px 8px; }
.input-area .send-btn { background:#25d366; color:#fff; border-radius:50%; width:40px; height:40px; display:flex; align-items:center; justify-content:center; font-size:18px; }
.input-area .send-btn:hover { background:#128c7e; }

/* Responsive */
@media (max-width:768px) {
    .sidebar { width:100%; min-width:unset; }
    .chat-area { display:none; }
    .chat-view .sidebar { display:none; }
    .chat-view .chat-area { display:flex; }
}