body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-weight: 400;
    margin: 0;
    padding: 0;
    background: #eef1f5;
    min-height: 100vh;
}

strong {
    font-weight: 600;
}

.container {
    width: 100%;
    max-width: 1280px;
    height: 100vh;
    margin: 0 auto;
    background: #ffffff;
    display: flex;
    flex-direction: column;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.15);
}

h1 {
    margin: 0;
    font-size: 24px;
    color: #111b21;
}

h2 {
    color: #111b21;
    margin-top: 0;
}

.header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    background: #ffffff;
    color: #111827;
    border-bottom: 1px solid #e5e7eb;
}

.header-title {
    font-size: 22px;
    font-weight: 600;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.header-logo {
    height: 28px;
    width: auto;
    display: none;
}

.header-status-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 999px;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
}

.header-status-label {
    font-size: 12px;
    color: #4b5563;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.header-status-value {
    font-size: 13px;
    font-weight: 600;
    color: #1d4ed8;
}

.menu {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    gap: 8px;
    background: #f3f4f6;
    padding: 8px 16px;
    border-bottom: 1px solid #e5e7eb;
}

.menu button {
    margin: 0;
    padding: 8px 18px;
    background: transparent;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    color: #4b5563;
    font-size: 14px;
    transition: background 0.2s ease, color 0.2s ease, transform 0.1s ease;
}

.menu button:hover {
    background: rgba(17, 24, 39, 0.06);
    transform: translateY(-1px);
}

.menu button.active {
    background: #2563eb;
    color: #ffffff;
}

.section {
    display: none;
    padding: 16px 24px 24px;
    height: calc(100vh - 122px);
    overflow-y: auto;
}

.section.active {
    display: block;
}

.status {
    margin-bottom: 20px;
    padding: 12px 16px;
    border-radius: 8px;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    color: #1e3a8a;
}

.status p {
    margin: 0;
    font-weight: 600;
}

.qr-container {
    text-align: center;
    margin-bottom: 20px;
}

#qr-code {
    display: inline-block;
    padding: 10px;
    background: white;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.chat-layout {
    display: flex;
    height: 100%;
    border-radius: 12px;
    overflow: hidden;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
}

.sidebar {
    width: 320px;
    background: #f9fafb;
    border-right: 1px solid #e5e7eb;
    padding: 12px;
    overflow-y: auto;
    color: #111827;
}

.sidebar h2 {
    margin-top: 0;
    color: #111827;
}

.chat-item {
    padding: 10px;
    cursor: pointer;
    background: #ffffff;
    margin-bottom: 5px;
    border-radius: 5px;
    border: none;
    width: 100%;
    text-align: left;
    font-size: inherit;
    color: #111827;
}
.chat-item:hover {
    background: #f3f4f6;
}

.chat-item.selected {
    background: #2563eb;
    color: #ffffff;
}

.main-chat {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: #ffffff;
}

#selected-chat {
    flex: 1;
    padding: 12px 16px;
    overflow-y: auto;
    background: #f9fafb;
}

#chats-container {
    max-height: 600px;
    overflow-y: auto;
}

.chat {
    margin-bottom: 20px;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 10px;
    background: #fafafa;
}

.chat h3 {
    margin-top: 0;
    color: #111827;
    font-size: 18px;
}

.chat h3.collapsed::after {
    content: ' ▼';
}

.chat h3:not(.collapsed)::after {
    content: ' ▲';
}

.controls {
    margin-bottom: 10px;
}

.controls button {
    margin-right: 5px;
    padding: 5px 10px;
    font-size: 12px;
    border-radius: 16px;
}

.leave-btn {
    background: #dc3545;
    color: white;
}

.leave-btn:hover {
    background: #c82333;
}

.messages-list {
    max-height: 300px;
    overflow-y: auto;
    padding: 10px 0;
    background: transparent;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
}

.message {
    margin-bottom: 10px;
    padding: 8px 12px;
    border-radius: 18px;
    max-width: 70%;
    word-wrap: break-word;
    position: relative;
}

.message strong {
    display: block;
    font-size: 12px;
    margin-bottom: 4px;
    color: #666;
}

.message.sent {
    background: #dbeafe;
    align-self: flex-end;
    text-align: right;
}
.message.received {
    background: #ffffff;
    color: #111827;
    align-self: flex-start;
}

.message small {
    display: block;
    font-size: 10px;
    color: #999;
    margin-top: 4px;
}

.message img {
    display: block;
    margin-top: 5px;
    max-width: 100%;
    height: auto;
    border-radius: 8px;
}

.message audio, .message video {
    display: block;
    margin-top: 5px;
    max-width: 100%;
    border-radius: 8px;
}

.quoted-message {
    border-left: 3px solid #ccc;
    padding-left: 8px;
    margin-bottom: 5px;
    font-size: 14px;
    color: #666;
    background: #f0f0f0;
    padding: 5px;
    border-radius: 4px;
}

.reply-to {
    background: #e1f5fe;
    padding: 8px;
    border-radius: 4px;
    margin-bottom: 10px;
    font-size: 14px;
}

.reply {
    display: flex;
    gap: 10px;
    margin-top: 8px;
}

.reply textarea {
    flex: 1;
    min-height: 40px;
    resize: vertical;
    border: 1px solid #ddd;
    border-radius: 20px;
    padding: 10px;
    font-family: inherit;
}

.reply button {
    align-self: flex-end;
}

.send-message {
    margin-top: 12px;
    background: #ffffff;
    padding: 16px 20px;
    border-radius: 12px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
}

.bulk-send {
    margin-top: 12px;
    background: #ffffff;
    padding: 16px 20px;
    border-radius: 12px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
}

input, textarea {
    width: 100%;
    padding: 10px;
    margin: 5px 0;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-sizing: border-box;
}

button {
    background: #25d366;
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: background 0.2s ease, transform 0.1s ease, box-shadow 0.2s ease;
}

button:hover {
    background: #128c7e;
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
}

.dashboard {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
    padding: 12px 24px;
}

.metric-card {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 12px 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.metric-title {
    font-size: 12px;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.metric-value {
    font-size: 22px;
    font-weight: 700;
    color: var(--text);
}

.interactions-list {
    display: grid;
    gap: 16px;
    margin-top: 20px;
}

.interaction-item {
    background: white;
    padding: 16px;
    border-radius: 12px;
    border: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.interaction-info {
    flex: 1;
}

.interaction-info strong {
    color: var(--primary);
    font-size: 1.1em;
}

.interaction-info p {
    margin: 4px 0;
    color: var(--muted);
    font-size: 0.9em;
}

.interaction-actions button {
    background: #fee2e2;
    color: #ef4444;
    border: none;
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85em;
    font-weight: 600;
}

.interaction-actions button:hover {
    background: #fecaca;
}
    .container {
        height: auto;
        min-height: 100vh;
    }

    .section {
        height: auto;
    }

    .chat-layout {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        max-height: 200px;
        border-right: none;
        border-bottom: 1px solid #202c33;
    }

    .main-chat {
        min-height: 300px;
    }

