
#tab-chat.active-content {
    display: flex !important;
    height: calc(100vh - 367px);
    overflow: hidden;
    padding: 0 !important;
    background: #f5f7fa;
}

.chat-layout {
    display: flex;
    width: 100%;
    height: 100%;
    gap: 0;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    overflow: hidden;
}
/* Left Sidebar - Project List */

.chat-sidebar {
    width: 350px;
    min-width: 350px;
    border-right: 1px solid #e2e8f0;
    display: flex;
    flex-direction: column;
    background: #fafbfc;
}

.chat-sidebar-header {
    padding: 20px;
    border-bottom: 1px solid #e2e8f0;
    background: white;
}

.chat-sidebar-header h3 {
    font-size: 18px;
    font-weight: 700;
    color: #1a202c;
    margin: 0 0 12px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.chat-sidebar-header h3 i {
    color: #0066cc;
    font-size: 22px;
}

.chat-sidebar-search {
    position: relative;
}

.chat-sidebar-search input {
    width: 100%;
    padding: 10px 12px 10px 36px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 13px;
    outline: none;
    transition: all 0.2s;
    background: #f7fafc;
    box-sizing: border-box;
}

.chat-sidebar-search input:focus {
    border-color: #0066cc;
    background: white;
}

.chat-sidebar-search i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #a0aec0;
    font-size: 16px;
}

.chat-sidebar-list {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
}

.chat-sidebar-list::-webkit-scrollbar {
    width: 6px;
}

.chat-sidebar-list::-webkit-scrollbar-thumb {
    background: #cbd5e0;
    border-radius: 3px;
}
/* Designer Group */

.designer-group-chat {
    margin-bottom: 8px;
}

.designer-group-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.2s;
    margin-bottom: 2px;
    user-select: none;
}

.designer-group-header:hover {
    background: #edf2f7;
}

.designer-info-mini {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
}

.designer-avatar-mini {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #e2e8f0;
}

.designer-name-mini {
    font-size: 14px;
    font-weight: 600;
    color: #2d3748;
    margin: 0;
}

.designer-meta-mini {
    font-size: 11px;
    color: #a0aec0;
    margin: 2px 0 0 0;
}

.designer-group-icon {
    color: #a0aec0;
    transition: transform 0.3s;
    font-size: 16px;
}

.designer-group-icon.collapsed {
    transform: rotate(-90deg);
}
/* Project Items */

.projects-sublist {
    padding-left: 16px;
}

.project-item-chat {
    padding: 10px 12px;
    margin: 2px 0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    border-left: 3px solid transparent;
    user-select: none;
    position: relative;
}

.project-item-chat:hover {
    background: #edf2f7;
}

.project-item-chat.active {
    background: #ebf4ff;
    border-left-color: #0066cc;
}

.project-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}

.project-item-title {
    font-size: 13px;
    font-weight: 600;
    color: #2d3748;
    margin: 0;
}

.project-item-badge {
    font-size: 10px;
    padding: 2px 8px;
    border-radius: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.project-item-badge.new {
    background: #fed7d7;
    color: #c53030;
}

.project-item-badge.time {
    background: #e2e8f0;
    color: #4a5568;
}

.project-item-client {
    font-size: 11px;
    color: #718096;
    display: flex;
    align-items: center;
    gap: 4px;
    margin: 0;
}

.project-item-preview {
    font-size: 11px;
    color: #a0aec0;
    margin: 4px 0 0 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.project-item-preview.unread {
    color: #2d3748;
    font-weight: 600;
}
/* Notification dot on project item */

.notification-dot {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 8px;
    height: 8px;
    background: #f56565;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(245, 101, 101, 0.7);
    }
    70% {
        box-shadow: 0 0 0 6px rgba(245, 101, 101, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(245, 101, 101, 0);
    }
}
/* Right Chat Area - Full Chat Interface */

.chat-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: white;
    min-width: 0;
}

.chat-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #a0aec0;
    gap: 16px;
}

.chat-empty-state i {
    font-size: 64px;
    opacity: 0.3;
}

.chat-empty-state p {
    font-size: 15px;
    font-weight: 500;
    margin: 0;
}

.chat-empty-state .sub-text {
    font-size: 13px;
    opacity: 0.7;
}
/* Chat Header */

.chat-header-chat {
    padding: 16px 20px;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: white;
    flex-shrink: 0;
}

.chat-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.chat-header-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #e2e8f0;
}

.chat-header-info h4 {
    font-size: 15px;
    font-weight: 700;
    color: #1a202c;
    margin: 0 0 4px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.chat-header-badge {
    font-size: 11px;
    padding: 3px 10px;
    border-radius: 12px;
    background: #ebf4ff;
    color: #0066cc;
    font-weight: 600;
}

.chat-header-meta {
    font-size: 12px;
    color: #718096;
    margin: 0;
}

.chat-header-actions {
    display: flex;
    gap: 8px;
}

.chat-header-actions button {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    border: none;
    background: #f7fafc;
    color: #4a5568;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chat-header-actions button:hover {
    background: #edf2f7;
    color: #2d3748;
}
/* Messages Area */

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: #f7fafc;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.chat-messages::-webkit-scrollbar {
    width: 6px;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: #cbd5e0;
    border-radius: 3px;
}
/* Message Styles */

.message-row {
    display: flex;
    flex-direction: column;
    max-width: 70%;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.message-row.sent {
    align-self: flex-end;
    align-items: flex-end;
}

.message-row.received {
    align-self: flex-start;
    align-items: flex-start;
}

.message-bubble {
    padding: 12px 16px;
    border-radius: 16px;
    position: relative;
    font-size: 14px;
    line-height: 1.5;
    word-wrap: break-word;
}

.message-row.sent .message-bubble {
    background: #0066cc;
    color: white;
    border-bottom-right-radius: 4px;
}

.message-row.received .message-bubble {
    background: white;
    color: #2d3748;
    border-bottom-left-radius: 4px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.message-image {
    max-width: 250px;
    border-radius: 12px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: transform 0.2s;
}

.message-image:hover {
    transform: scale(1.02);
}

.message-time {
    font-size: 11px;
    color: #a0aec0;
    margin-top: 4px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.message-row.sent .message-time {
    justify-content: flex-end;
}
/* Order Card */

.order-card {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    max-width: 300px;
}

.order-card-header {
    background: #0066cc;
    color: white;
    padding: 12px 16px;
    font-weight: 600;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.order-card-body {
    padding: 16px;
}

.order-card-row {
    margin-bottom: 12px;
    font-size: 13px;
    color: #2d3748;
}

.order-card-label {
    font-size: 11px;
    color: #a0aec0;
    text-transform: uppercase;
    font-weight: 600;
}

.order-card-btn {
    width: 100%;
    padding: 8px;
    background: #ebf4ff;
    color: #0066cc;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    font-size: 12px;
    cursor: pointer;
    margin-top: 8px;
}
/* Input Area */

.chat-input-area {
    padding: 16px 20px;
    border-top: 1px solid #e2e8f0;
    background: white;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.chat-input-area input {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid #e2e8f0;
    border-radius: 24px;
    outline: none;
    font-size: 14px;
    font-family: 'Inter', sans-serif;
    transition: all 0.2s;
    min-width: 0;
}

.chat-input-area input:focus {
    border-color: #0066cc;
    box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.1);
}

.chat-input-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.chat-input-actions button {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-attach {
    background: #f7fafc;
    color: #4a5568;
}

.btn-attach:hover {
    background: #edf2f7;
}

.btn-send {
    background: #0066cc;
    color: white;
}

.btn-send:hover {
    background: #0052a3;
}

.btn-send:disabled {
    background: #cbd5e0;
    cursor: not-allowed;
}
/* Loading State */

.chat-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    flex-direction: column;
    gap: 12px;
    color: #a0aec0;
}

.chat-loading i {
    font-size: 32px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.empty-chat-list {
    text-align: center;
    padding: 40px 20px;
    color: #a0aec0;
    font-size: 14px;
}
/* Toast notification - POSITIONED AT BOTTOM */

.toast-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 10000;
    display: flex;
    flex-direction: column-reverse;
    gap: 10px;
    max-width: 400px;
}

.toast-notif {
    padding: 14px 20px;
    border-radius: 12px;
    color: white;
    font-weight: 500;
    font-size: 14px;
    animation: slideUp 0.3s ease;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.toast-notif:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

.toast-notif.success {
    background: linear-gradient(135deg, #48bb78, #38a169);
}

.toast-notif.error {
    background: linear-gradient(135deg, #f56565, #e53e3e);
}

.toast-notif.warning {
    background: linear-gradient(135deg, #ed8936, #dd6b20);
}

.toast-notif.info {
    background: linear-gradient(135deg, #4299e1, #3182ce);
}

.toast-notif .toast-icon {
    font-size: 20px;
    flex-shrink: 0;
}

.toast-notif .toast-content {
    flex: 1;
    min-width: 0;
}

.toast-notif .toast-title {
    font-weight: 600;
    font-size: 13px;
    margin-bottom: 2px;
}

.toast-notif .toast-message {
    font-size: 12px;
    opacity: 0.9;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.toast-notif .toast-close {
    cursor: pointer;
    opacity: 0.7;
    font-size: 16px;
    flex-shrink: 0;
    transition: opacity 0.2s;
}

.toast-notif .toast-close:hover {
    opacity: 1;
}

@keyframes slideUp {
    from {
        transform: translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes slideOut {
    from {
        transform: translateY(0);
        opacity: 1;
    }
    to {
        transform: translateY(100%);
        opacity: 0;
    }
}
/* Tab badge animation */

#chatBadge {
    animation: badgePulse 2s infinite;
}

@keyframes badgePulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.2);
    }
    100% {
        transform: scale(1);
    }
}
/* Tab chat highlight when has new messages */

.tab.has-notification {
    position: relative;
}

.tab.has-notification::after {
    content: '';
    position: absolute;
    top: -3px;
    right: -3px;
    width: 10px;
    height: 10px;
    background: #f56565;
    border-radius: 50%;
    border: 2px solid white;
    animation: pulse 2s infinite;
}
/* Browser notification permission button */

.notification-permission {
    position: fixed;
    bottom: 20px;
    left: 20px;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 12px 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    z-index: 9999;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 13px;
}

.notification-permission button {
    padding: 6px 16px;
    border-radius: 6px;
    border: none;
    background: #0066cc;
    color: white;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
}

.notification-permission button:hover {
    background: #0052a3;
}
