* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    border-radius: 15px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.header {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: white;
    padding: 20px;
    text-align: center;
}

.header h1 {
    font-size: 2em;
    margin-bottom: 5px;
}

.header p {
    opacity: 0.9;
}

.main-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    padding: 20px;
}

.panel {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
}

.panel h3 {
    color: #2c3e50;
    margin-bottom: 15px;
    font-size: 1.2em;
    border-bottom: 2px solid #e9ecef;
    padding-bottom: 10px;
}

.connection-section {
    grid-column: 1 / -1;
    background: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%);
}

.form-group {
    margin-bottom: 15px;
}

.form-row {
    display: flex;
    gap: 15px;
    align-items: center;
    margin-bottom: 10px;
}

label {
    font-weight: 600;
    color: #2c3e50;
    min-width: 100px;
}

input,
select {
    padding: 10px 15px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 14px;
    flex: 1;
    transition: border-color 0.3s;
}

input:focus,
select:focus {
    outline: none;
    border-color: #4facfe;
}

button {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s;
    margin-right: 10px;
}

button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

button:disabled {
    background: #6c757d;
    cursor: not-allowed;
    transform: none;
}

.status-indicator {
    display: inline-block;
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 600;
    margin: 10px 0;
}

.status-connected {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.status-disconnected {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.status-connecting {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

.chat-container {
    height: 400px;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.messages {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
    background: white;
}

.message {
    margin-bottom: 12px;
    padding: 10px 15px;
    border-radius: 18px;
    max-width: 80%;
    word-wrap: break-word;
}

.message-sent {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    margin-left: auto;
    text-align: right;
}

.message-received {
    background: #e9ecef;
    color: #2c3e50;
}

.message-system {
    background: #fff3cd;
    color: #856404;
    text-align: center;
    font-style: italic;
    margin: 0 auto;
}

.message-header {
    font-size: 0.8em;
    opacity: 0.8;
    margin-bottom: 4px;
}

.message-time {
    font-size: 0.7em;
    opacity: 0.6;
    margin-top: 4px;
}

.message-input-container {
    display: flex;
    padding: 15px;
    background: #f8f9fa;
    border-top: 1px solid #e9ecef;
}

.message-input {
    flex: 1;
    margin-right: 10px;
}

.tenant-tabs {
    display: flex;
    gap: 5px;
    margin-bottom: 15px;
}

.tenant-tab {
    padding: 8px 16px;
    background: #e9ecef;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.3s;
}

.tenant-tab.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.broadcast-section {
    border: 2px dashed #4facfe;
    border-radius: 10px;
    padding: 15px;
    margin-top: 15px;
}

.stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    margin-top: 15px;
}

.stat-card {
    background: white;
    padding: 15px;
    border-radius: 8px;
    text-align: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.stat-value {
    font-size: 2em;
    font-weight: bold;
    color: #667eea;
}

.stat-label {
    color: #6c757d;
    font-size: 0.9em;
}

@media (max-width: 768px) {
    .main-content {
        grid-template-columns: 1fr;
    }

    .form-row {
        flex-direction: column;
        align-items: stretch;
    }

    label {
        min-width: auto;
    }
}