body {
    margin: 0;
    background: #f0f2f5;
    height: 100vh;
    overflow: hidden;
}

.app-layout {
    display: flex;
    height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 350px;
    background: white;
    border-right: 1px solid #e0e0e0;
    display: flex;
    flex-direction: column;
}

.sidebar-header {
    padding: 16px;
    background: #f0f2f5;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.search-bar {
    padding: 10px;
    border-bottom: 1px solid #eee;
}

.search-bar input {
    width: 100%;
    padding: 8px;
    border-radius: 4px;
    border: 1px solid #ddd;
}

.filters {
    display: flex;
    padding: 10px;
    gap: 5px;
    border-bottom: 1px solid #eee;
}

.filter-btn {
    border: none;
    background: transparent;
    padding: 5px 10px;
    cursor: pointer;
    border-radius: 12px;
    font-size: 0.9rem;
}

.filter-btn.active {
    background: #e6f2ff;
    color: #007bff;
    font-weight: bold;
}

.ticket-list {
    flex: 1;
    overflow-y: auto;
    list-style: none;
    padding: 0;
    margin: 0;
}

.ticket-item {
    padding: 15px;
    border-bottom: 1px solid #f0f2f5;
    cursor: pointer;
    transition: background 0.2s;
}

.ticket-item:hover {
    background: #f5f5f5;
}

.ticket-item.active {
    background: #e6f2ff;
}

.ticket-item.unread {
    border-left: 4px solid #00c853;
}

.t-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 5px;
}

.t-id {
    font-weight: bold;
    color: #333;
}

.t-time {
    font-size: 0.8rem;
    color: #888;
}

.t-msg {
    font-size: 0.9rem;
    color: #666;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Main Chat */
.main-chat {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: #e5ddd5;
    background-image: url("data:image/svg+xml,%3Csvg width='64' height='64' viewBox='0 0 64 64' ... (same pattern)");
}

.empty-state {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #888;
}

.chat-interface {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.hidden {
    display: none !important;
}

.chat-header {
    background: #f0f2f5;
    padding: 10px 20px;
    border-bottom: 1px solid #ddd;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-viewport {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.message {
    padding: 10px 15px;
    border-radius: 8px;
    max-width: 60%;
    font-size: 0.95rem;
    position: relative;
    box-shadow: 0 1px 1px rgba(0, 0, 0, 0.1);
}

.msg-admin {
    background: #d9fdd3;
    align-self: flex-end;
}

.msg-user {
    background: white;
    align-self: flex-start;
}

.msg-auto {
    background: #fff3cd;
    align-self: center;
    font-size: 0.85rem;
    border: 1px dashed #e6c200;
}

.chat-input {
    background: #f0f2f5;
    padding: 10px;
}

#admin-msg-form {
    display: flex;
    gap: 10px;
    align-items: center;
}

#admin-msg-input {
    flex: 1;
    padding: 10px;
    border-radius: 20px;
    border: 1px solid #ddd;
}

.send-btn {
    padding: 8px 16px;
    background: #007bff;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

/* Media styling same as user chat */
.msg-media {
    max-width: 200px;
    border-radius: 8px;
    cursor: pointer;
}

.msg-video {
    max-width: 300px;
    border-radius: 8px;
}