.admin-panel {
    display: flex;
    flex-direction: column;
    height: 100vh;
    background: #F4F7FB;
}

/* Admin Header */
.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 20px;
    background: white;
    border-bottom: 1px solid #e0e0e0;
    z-index: 10;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.header-logo {
    width: 32px;
    height: 32px;
}

.header-left h2 {
    font-size: 18px;
    color: #E62E04;
    margin: 0;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

.status-indicator {
    font-size: 14px;
}

.status-indicator.online {
    color: #22c55e;
}

.status-indicator.offline {
    color: #ef4444;
}

.admin-name {
    font-weight: 500;
    color: #333;
}

.logout-btn {
    padding: 6px 16px;
    background: #E62E04;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 13px;
    transition: background 0.3s;
}

.logout-btn:hover {
    background: #cc2803;
}

/* Main Layout */
.admin-main {
    display: flex;
    flex: 1;
    overflow: hidden;
}

/* Conversation List */
.conversation-list {
    width: 320px;
    background: white;
    border-right: 1px solid #e0e0e0;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}

.list-header {
    padding: 15px;
    border-bottom: 1px solid #e0e0e0;
}

.list-header h3 {
    font-size: 16px;
    margin: 0 0 10px 0;
    color: #333;
}

.list-filters {
    display: flex;
    gap: 5px;
    margin-bottom: 10px;
}

.filter-btn {
    padding: 4px 12px;
    background: transparent;
    border: 1px solid #ddd;
    border-radius: 15px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.3s;
}

.filter-btn:hover,
.filter-btn.active {
    background: #E62E04;
    color: white;
    border-color: #E62E04;
}

.search-box input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 20px;
    font-size: 13px;
    box-sizing: border-box;
}

.search-box input:focus {
    border-color: #E62E04;
    outline: none;
}

/* Conversation Items */
.list-items {
    flex: 1;
    overflow-y: auto;
    padding: 5px 0;
}

.conversation-item {
    padding: 12px 15px;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
    transition: background 0.3s;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.conversation-item:hover {
    background: #f8f9fa;
}

.conversation-item.active {
    background: #fff0eb;
    border-left: 3px solid #E62E04;
}

.item-info {
    flex: 1;
    min-width: 0;
}

.item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 3px;
}

.customer-name {
    font-weight: 500;
    color: #333;
    font-size: 14px;
}

.customer-mobile {
    font-size: 12px;
    color: #888;
}

.customer-status {
    font-size: 12px;
}

.customer-status.online {
    color: #22c55e;
}

.customer-status.offline {
    color: #9ca3af;
}

.last-message {
    font-size: 13px;
    color: #666;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.last-message-time {
    font-size: 11px;
    color: #999;
    margin-left: 8px;
}

.item-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.unread-badge {
    background: #E62E04;
    color: white;
    border-radius: 50%;
    padding: 2px 8px;
    font-size: 11px;
    font-weight: 600;
    min-width: 20px;
    text-align: center;
}

.conversation-status {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 10px;
}

.conversation-status.open {
    background: #dbeafe;
    color: #1d4ed8;
}

.conversation-status.closed {
    background: #f3f4f6;
    color: #6b7280;
}

/* Chat Area */
.chat-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: #F4F7FB;
}

.chat-placeholder {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #999;
}

.placeholder-content {
    text-align: center;
}

.placeholder-icon {
    font-size: 48px;
    margin-bottom: 15px;
}

.placeholder-content h3 {
    color: #333;
    margin-bottom: 5px;
}

.placeholder-content p {
    color: #888;
}

/* Chat View (loaded dynamically) */
.chat-view {
    flex: 1;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.chat-view-header {
    padding: 12px 20px;
    background: white;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-view-header .customer-info {
    display: flex;
    flex-direction: column;
}

.chat-view-header .customer-name {
    font-size: 16px;
    font-weight: 600;
}

.chat-view-header .customer-detail {
    font-size: 12px;
    color: #888;
}

.chat-view-header .chat-actions {
    display: flex;
    gap: 8px;
}

.chat-view-header .chat-actions button {
    padding: 4px 12px;
    border: 1px solid #ddd;
    border-radius: 5px;
    background: white;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.3s;
}

.chat-view-header .chat-actions button:hover {
    background: #f0f0f0;
}

.chat-view-header .chat-actions .close-chat {
    border-color: #ef4444;
    color: #ef4444;
}

.chat-view-header .chat-actions .close-chat:hover {
    background: #ef4444;
    color: white;
}

.chat-view-header .chat-actions .reopen-chat {
    border-color: #22c55e;
    color: #22c55e;
}

.chat-view-header .chat-actions .reopen-chat:hover {
    background: #22c55e;
    color: white;
}

.chat-messages-admin {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
}

.chat-messages-admin .message-wrapper.customer {
    align-items: flex-start;
}

.chat-messages-admin .message-wrapper.admin {
    align-items: flex-end;
}

.chat-composer-admin {
    padding: 12px 20px;
    background: white;
    border-top: 1px solid #e0e0e0;
}

/* Responsive */
@media (max-width: 1024px) {
    .conversation-list {
        width: 280px;
    }
}

@media (max-width: 768px) {
    .admin-main {
        flex-direction: column;
    }
    
    .conversation-list {
        width: 100%;
        height: 40vh;
        border-right: none;
        border-bottom: 1px solid #e0e0e0;
    }
    
    .chat-area {
        height: 60vh;
    }
    
    .admin-header {
        flex-wrap: wrap;
        gap: 10px;
    }
    
    .header-right {
        flex-wrap: wrap;
    }
}

@media (max-width: 480px) {
    .conversation-list {
        height: 35vh;
    }
    
    .chat-area {
        height: 65vh;
    }
    
    .list-header h3 {
        font-size: 14px;
    }
    
    .conversation-item {
        padding: 10px 12px;
    }
}