/* Общие стили */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f5f5f5;
    min-height: 100vh;
}

/* Страница входа */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.login-card {
    background: white;
    padding: 40px;
    border-radius: 15px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    width: 100%;
    max-width: 400px;
}

.login-header {
    text-align: center;
    margin-bottom: 30px;
}

.login-header h2 {
    color: #333;
    margin-bottom: 5px;
}

.login-header p {
    color: #666;
}

/* Карточки диалогов */
.dialogue-card {
    cursor: pointer;
    transition: all 0.3s ease;
    border-left: 4px solid transparent;
}

.dialogue-card:hover {
    transform: translateX(5px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    border-left-color: #667eea;
}

.dialogue-card .badge {
    font-size: 0.8rem;
}

/* Сообщения в чате */
.message {
    margin-bottom: 15px;
    display: flex;
    flex-direction: column;
}

.message-client {
    align-items: flex-start;
}

.message-operator {
    align-items: flex-end;
}

.message-curator {
    align-items: flex-end;
}

.message-bubble {
    max-width: 70%;
    padding: 10px 15px;
    border-radius: 18px;
    position: relative;
    word-wrap: break-word;
}

.message-client .message-bubble {
    background-color: #e9ecef;
    color: #212529;
    border-bottom-left-radius: 5px;
}

.message-operator .message-bubble {
    background-color: #667eea;
    color: white;
    border-bottom-right-radius: 5px;
}

.message-curator .message-bubble {
    background-color: #28a745;
    color: white;
    border-bottom-right-radius: 5px;
}

.message-private .message-bubble {
    background-color: #ffc107;
    color: #212529;
    border: 1px dashed #ff9800;
}

.message-time {
    font-size: 0.7rem;
    color: #999;
    margin-top: 5px;
}

.message-sender {
    font-size: 0.8rem;
    color: #666;
    margin-bottom: 3px;
}

/* Список клиентов */
.client-card {
    cursor: pointer;
    transition: all 0.3s ease;
}

.client-card:hover {
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

/* QR-коды */
.qr-container {
    text-align: center;
    padding: 20px;
}

.qr-container img {
    max-width: 200px;
    height: auto;
    border: 2px solid #ddd;
    border-radius: 10px;
    padding: 10px;
    background: white;
}

/* Уведомления */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    min-width: 300px;
    max-width: 400px;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Адаптивность */
@media (max-width: 768px) {
    .message-bubble {
        max-width: 85%;
    }
    
    .login-card {
        margin: 20px;
        padding: 30px;
    }
}

/* Скроллбар */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Загрузка */
.loading {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 50px;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}