* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: -apple-system, "Segoe UI", Roboto, sans-serif; background: #0b141a; color: #e9edef; height: 100vh; overflow: hidden; }
.hidden { display: none !important; }
.center { height: 100vh; display: flex; align-items: center; justify-content: center; }
.card { background: #111b21; padding: 32px; border-radius: 16px; width: 340px; text-align: center; box-shadow: 0 10px 40px rgba(0,0,0,.5); }
.logo { width: 64px; height: 64px; border-radius: 16px; background: #00a884; color: #fff; font-weight: 800; font-size: 26px; display: flex; align-items: center; justify-content: center; margin: 0 auto 16px; }
h1 { font-size: 20px; margin-bottom: 8px; }
.muted { color: #8696a0; font-size: 13px; margin-bottom: 16px; }
input { width: 100%; padding: 12px 14px; border-radius: 10px; border: 1px solid #2a3942; background: #202c33; color: #e9edef; font-size: 14px; outline: none; margin-bottom: 12px; }
input:focus { border-color: #00a884; }
button { background: #00a884; color: #fff; border: none; padding: 12px 16px; border-radius: 10px; font-size: 15px; cursor: pointer; font-weight: 600; }
button:hover { background: #06cf9c; }

#main { display: flex; height: 100vh; }
.sidebar { width: 340px; background: #111b21; border-right: 1px solid #2a3942; display: flex; flex-direction: column; }
.me { display: flex; align-items: center; gap: 10px; padding: 14px; background: #202c33; }
.meinfo { overflow: hidden; }
.me .name { font-weight: 600; }
.gc { color: #8696a0; font-size: 12px; letter-spacing: .5px; }
.gc.big { font-size: 20px; color: #00a884; font-weight: 700; margin: 6px 0; }
.me button { margin-left: auto; background: #2a3942; padding: 8px 12px; font-size: 18px; }
.avatar { width: 44px; height: 44px; min-width: 44px; border-radius: 50%; background: #6a7175; color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; }
.avatar.sm { width: 40px; height: 40px; min-width: 40px; font-size: 14px; }
.add { display: flex; gap: 8px; padding: 10px 14px; border-bottom: 1px solid #2a3942; }
.add input { margin: 0; }
.add button { padding: 10px 16px; font-size: 18px; }
.chats { overflow-y: auto; flex: 1; }
.chat-item { display: flex; gap: 10px; align-items: center; padding: 12px 14px; cursor: pointer; border-bottom: 1px solid #1a2830; }
.chat-item:hover, .chat-item.active { background: #202c33; }

.chat { flex: 1; display: flex; flex-direction: column; background: #0b141a; }
.chat-header { display: flex; gap: 10px; align-items: center; padding: 12px 16px; background: #202c33; border-bottom: 1px solid #2a3942; min-height: 64px; }
.messages { flex: 1; overflow-y: auto; padding: 20px; display: flex; flex-direction: column; gap: 6px; }
.bubble { max-width: 65%; padding: 8px 12px; border-radius: 10px; font-size: 14px; line-height: 1.4; word-wrap: break-word; }
.bubble.out { align-self: flex-end; background: #005c4b; }
.bubble.in { align-self: flex-start; background: #202c33; }
.bubble time { display: block; font-size: 10px; color: #ffffff88; text-align: right; margin-top: 2px; }
.composer { display: flex; gap: 10px; padding: 14px; background: #202c33; }
.composer input { margin: 0; }
.composer button { padding: 12px 20px; font-size: 16px; }

.modal { position: fixed; inset: 0; background: rgba(0,0,0,.6); display: flex; align-items: center; justify-content: center; z-index: 10; }
.modal-card { background: #111b21; padding: 28px; border-radius: 16px; text-align: center; width: 300px; }
.modal-card img { width: 220px; height: 220px; background: #fff; border-radius: 12px; padding: 8px; margin: 12px 0; }
.incoming-actions { display: flex; gap: 10px; justify-content: center; margin-top: 8px; }
.danger { background: #e53935; } .danger:hover { background: #f2534f; }
.hdr-btn { background: #2a3942; padding: 8px 12px; font-size: 18px; margin-left: 6px; }

/* ---- call overlay (video / voice / screen-share) ---- */
.call-overlay { position: fixed; inset: 0; background: #050a0d; z-index: 20; }
.remote-video { width: 100%; height: 100%; object-fit: cover; background: #050a0d; }
.local-video { position: absolute; right: 20px; bottom: 110px; width: 180px; border-radius: 12px; border: 2px solid #00a884; object-fit: cover; background: #111b21; }
.call-status { position: absolute; top: 20px; left: 0; right: 0; text-align: center; color: #e9edef; font-size: 16px; text-shadow: 0 1px 4px #000; }
.call-controls { position: absolute; bottom: 26px; left: 0; right: 0; display: flex; gap: 16px; justify-content: center; }
.cc { width: 56px; height: 56px; border-radius: 50%; background: #2a3942; font-size: 22px; display: flex; align-items: center; justify-content: center; padding: 0; }
.cc:hover { background: #3b4a54; }
.cc.off { background: #e53935; }
.cc.hangup { background: #e53935; }
.cc.hangup:hover { background: #f2534f; }
