* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; height: 100vh; background: #1a1a2e; color: #e0e0e0; }

#app { display: flex; height: 100vh; }

#sidebar { width: 280px; min-width: 280px; background: #16213e; display: flex; flex-direction: column; border-right: 1px solid #0f3460; }
#sidebar-header { padding: 16px; border-bottom: 1px solid #0f3460; display: flex; align-items: center; justify-content: space-between; }
#sidebar-header h2 { font-size: 18px; color: #e94560; }

#connection-status { font-size: 11px; padding: 3px 8px; border-radius: 4px; }
.status-connected { background: #1a8a3a; color: #fff; }
.status-disconnected { background: #8a1a1a; color: #fff; }

#user-controls { padding: 10px; display: flex; gap: 6px; border-bottom: 1px solid #0f3460; }
#nickname-input { flex: 1; padding: 6px 10px; background: #0f3460; border: 1px solid #1a4a7a; border-radius: 4px; color: #e0e0e0; font-size: 13px; }
#nickname-btn { padding: 6px 12px; background: #e94560; border: none; border-radius: 4px; color: #fff; cursor: pointer; font-size: 13px; }

#user-list-header { padding: 10px 16px; font-size: 13px; color: #888; display: flex; justify-content: space-between; border-bottom: 1px solid #0f3460; }

#user-list { flex: 1; overflow-y: auto; padding: 4px 0; }
.user-item { padding: 8px 16px; display: flex; align-items: center; gap: 8px; cursor: pointer; transition: background .15s; }
.user-item:hover { background: #0f3460; }
.user-item .online-dot { width: 8px; height: 8px; border-radius: 50%; background: #1a8a3a; }
.user-item .nickname { flex: 1; font-size: 14px; }
.user-item .admin-badge { font-size: 10px; background: #e94560; color: #fff; padding: 1px 6px; border-radius: 3px; }

#admin-section { border-top: 1px solid #0f3460; padding: 10px 16px; }
#admin-section h3 { font-size: 13px; color: #e94560; margin-bottom: 8px; }
#admin-controls { display: flex; flex-direction: column; gap: 6px; }
#admin-controls button { padding: 6px 10px; background: #0f3460; border: 1px solid #1a4a7a; border-radius: 4px; color: #e0e0e0; font-size: 12px; cursor: pointer; }
#admin-controls button:hover { background: #e94560; }

#main { flex: 1; display: flex; flex-direction: column; min-width: 0; }

#messages { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 4px; }
.msg { padding: 6px 12px; border-radius: 6px; max-width: 80%; word-break: break-word; }
.msg.system { align-self: center; font-size: 12px; color: #888; background: transparent; font-style: italic; white-space: pre-wrap; }
.msg.chat { background: #0f3460; align-self: flex-start; }
.msg.chat.own { background: #1a4a7a; align-self: flex-end; }
.msg .msg-nick { font-size: 12px; color: #e94560; font-weight: 600; }
.msg .msg-time { font-size: 10px; color: #666; float: right; margin-left: 8px; }

#poll-area { border-top: 1px solid #0f3460; padding: 12px 16px; background: #16213e; }
#poll-display { display: flex; flex-direction: column; gap: 8px; }
.poll-card { background: #0f3460; padding: 12px; border-radius: 6px; }
.poll-card .poll-q { font-size: 14px; margin-bottom: 8px; }
.poll-card .poll-opt { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; padding: 4px 8px; background: #1a4a7a; border-radius: 4px; cursor: pointer; }
.poll-card .poll-opt:hover { background: #2a5a8a; }
.poll-card .poll-opt .bar { height: 6px; background: #e94560; border-radius: 3px; transition: width .3s; }
.poll-card .poll-opt .label { font-size: 13px; }
.poll-card .poll-opt .count { font-size: 12px; color: #888; }

#call-area { border-top: 1px solid #0f3460; padding: 10px 16px; background: #16213e; display: flex; align-items: center; gap: 12px; }
#call-status { flex: 1; font-size: 14px; color: #1a8a3a; }
#end-call-btn { padding: 6px 16px; background: #8a1a1a; border: none; border-radius: 4px; color: #fff; cursor: pointer; }

#message-input-area { border-top: 1px solid #0f3460; padding: 12px 16px; background: #16213e; }
#input-row { display: flex; gap: 8px; }
#message-input { flex: 1; padding: 10px 14px; background: #0f3460; border: 1px solid #1a4a7a; border-radius: 6px; color: #e0e0e0; font-size: 14px; }
#send-btn { padding: 10px 20px; background: #e94560; border: none; border-radius: 6px; color: #fff; cursor: pointer; font-size: 14px; }

.hidden { display: none !important; }

.modal { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.6); display: flex; align-items: center; justify-content: center; z-index: 1000; }
.modal-content { background: #16213e; padding: 24px; border-radius: 8px; min-width: 320px; border: 1px solid #0f3460; }
.modal-content h3 { margin-bottom: 12px; color: #e94560; }
.modal-content input { width: 100%; padding: 8px 12px; margin-bottom: 8px; background: #0f3460; border: 1px solid #1a4a7a; border-radius: 4px; color: #e0e0e0; font-size: 13px; }
.modal-content button { padding: 8px 16px; margin-right: 8px; background: #e94560; border: none; border-radius: 4px; color: #fff; cursor: pointer; }
.modal-content button:hover { opacity: .85; }

#user-context-menu { position: fixed; background: #16213e; border: 1px solid #0f3460; border-radius: 6px; padding: 4px; z-index: 999; min-width: 150px; }
#user-context-menu button { display: block; width: 100%; padding: 8px 14px; background: none; border: none; color: #e0e0e0; text-align: left; cursor: pointer; font-size: 13px; border-radius: 3px; }
#user-context-menu button:hover { background: #0f3460; }
#user-context-menu button.danger { color: #e94560; }
