* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: #f0f2f5;
    color: #1a1a2e;
    height: 100vh;
    overflow: hidden;
}

/* ==================== LAYOUT ==================== */
.app {
    display: flex;
    height: 100vh;
}

/* Platform bar removed - merged into nav-sidebar */

/* ==================== SIDEBAR ==================== */
.sidebar {
    width: 300px;
    background: #fff;
    border-right: 1px solid #e5e7eb;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}

.sidebar-header {
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #e5e7eb;
}

.logo {
    font-size: 20px;
    font-weight: 700;
    color: #7c3aed;
}

.user-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.username {
    font-size: 13px;
    font-weight: 500;
    color: #6b7280;
}

.icon-btn {
    width: 34px;
    height: 34px;
    border: none;
    background: #f3f4f6;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6b7280;
    transition: all 0.2s;
}

.icon-btn:hover {
    background: #e5e7eb;
    color: #374151;
}

/* ==================== NAV SIDEBAR (Chatwoot style) ==================== */
.nav-sidebar {
    width: 200px;
    background: #fff;
    border-right: 1px solid #e5e7eb;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}

.nav-sidebar::-webkit-scrollbar {
    width: 4px;
}

.nav-sidebar::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 2px;
}

.nav-sidebar-brand {
    height: 52px;
    padding: 0 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    border-bottom: 1px solid #e5e7eb;
    flex-shrink: 0;
}

.nav-brand-logo {
    width: 28px;
    height: 28px;
    background: #7c3aed;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 14px;
    font-weight: 800;
    flex-shrink: 0;
}

.nav-brand-text {
    font-size: 16px;
    font-weight: 700;
    color: #1a1a2e;
    letter-spacing: -0.3px;
}

/* Nav Search */
.nav-search {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 10px 12px;
    padding: 7px 10px;
    background: #f3f4f6;
    border-radius: 8px;
    border: 1px solid transparent;
    transition: all 0.2s;
}

.nav-search:focus-within {
    background: #fff;
    border-color: #7c3aed;
}

.nav-search svg {
    color: #9ca3af;
    flex-shrink: 0;
}

.nav-search input {
    border: none;
    background: transparent;
    font-family: inherit;
    font-size: 13px;
    color: #374151;
    outline: none;
    width: 100%;
}

.nav-search input::placeholder {
    color: #9ca3af;
}

/* Nav Sections */
.nav-sections {
    flex: 1;
    overflow-y: auto;
    padding: 4px 0;
}

.nav-sections::-webkit-scrollbar {
    width: 4px;
}

.nav-sections::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 2px;
}

.nav-section {
    margin-bottom: 2px;
}

.nav-section-header {
    font-size: 10px;
    font-weight: 700;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    padding: 10px 16px 4px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 12px;
    font-size: 13px;
    font-weight: 500;
    color: #6b7280;
    cursor: pointer;
    border-radius: 6px;
    margin: 1px 8px;
    transition: all 0.15s;
    border: none;
    background: transparent;
    width: calc(100% - 16px);
    text-align: left;
    position: relative;
}

.nav-item:hover {
    background: #f3f4f6;
    color: #374151;
}

.nav-item.active {
    background: #ede9fe;
    color: #7c3aed;
    font-weight: 600;
}

.nav-item svg {
    flex-shrink: 0;
    width: 16px;
    height: 16px;
}

.nav-item.active svg {
    color: #7c3aed;
}

/* Nav Badge (count) */
.nav-badge {
    margin-left: auto;
    font-size: 10px;
    font-weight: 600;
    min-width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 9px;
    padding: 0 5px;
}

.nav-badge:empty {
    display: none;
}

.nav-badge:not(:empty) {
    background: #7c3aed;
    color: #fff;
}

/* Platform color indicators for nav items */
.nav-item.chatbox.active { color: #7c3aed; }
.nav-item.whatsapp.active { color: #25d366; }
.nav-item.telegram.active { color: #0088cc; }
.nav-item.telegram_bot.active { color: #229ED9; }
.nav-item.sms.active { color: #f59e0b; }
.nav-item.archived.active { color: #6b7280; }

.nav-item.chatbox.active svg { color: #7c3aed; }
.nav-item.whatsapp.active svg { color: #25d366; }
.nav-item.telegram.active svg { color: #0088cc; }
.nav-item.telegram_bot.active svg { color: #229ED9; }
.nav-item.sms.active svg { color: #f59e0b; }
.nav-item.archived.active svg { color: #6b7280; }

/* User Profile (bottom of sidebar) */
.nav-user-profile {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 14px;
    border-top: 1px solid #e5e7eb;
    flex-shrink: 0;
    margin-top: auto;
}

.nav-agent-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #7c3aed;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
    flex-shrink: 0;
}

.nav-agent-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.nav-agent-name {
    font-size: 12px;
    font-weight: 600;
    color: #374151;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.nav-logout-btn {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
}

/* ==================== CONV SIDEBAR (Conversation List) ==================== */
.conv-sidebar {
    width: 300px;
    background: #fff;
    border-right: 1px solid #e5e7eb;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}

.conv-sidebar-header {
    height: 52px;
    padding: 0 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid #e5e7eb;
    flex-shrink: 0;
}

.conv-sidebar-header h2 {
    font-size: 15px;
    font-weight: 700;
    color: #1a1a2e;
}

.conv-count-badge {
    font-size: 11px;
    background: #f3f4f6;
    color: #6b7280;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 600;
}

/* Search */
.sidebar-search {
    padding: 12px 16px;
}

.sidebar-search input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    font-family: inherit;
    font-size: 14px;
    outline: none;
    background: #f9fafb;
    transition: border-color 0.2s;
}

.sidebar-search input:focus {
    border-color: #7c3aed;
    background: #fff;
}

.sidebar-search input::placeholder {
    color: #9ca3af;
}

/* Platform Filters - eski yatay filtreler kaldirildi, simdi .platform-bar kullaniliyor */

/* Conversations List */
.conversations-list {
    flex: 1;
    overflow-y: auto;
}

.conversations-list::-webkit-scrollbar {
    width: 4px;
}

.conversations-list::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 2px;
}

.conversation-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    cursor: pointer;
    transition: background 0.15s;
    border-bottom: 1px solid #f3f4f6;
}

.conversation-item:hover {
    background: #f9fafb;
}

.conversation-item.active {
    background: #ede9fe;
}

/* Avatar */
.conv-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 600;
    color: #fff;
    flex-shrink: 0;
    position: relative;
}

.conv-avatar.chatbox { background: #7c3aed; }
.conv-avatar.whatsapp { background: #25d366; }
.conv-avatar.telegram { background: #0088cc; }
.conv-avatar.telegram_bot { background: #229ED9; }
.conv-avatar.sms { background: #f59e0b; }
.conv-avatar.sms_android { background: #f59e0b; }
.conv-avatar.sms_verimor { background: #f59e0b; }
.conv-avatar.sms_twilio { background: #f59e0b; }
.conv-avatar.sms_netgsm { background: #f59e0b; }
.conv-avatar.sms_vonage { background: #f59e0b; }

.conv-avatar .platform-icon {
    position: absolute;
    bottom: -2px;
    right: -2px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}

/* Conversation Content */
.conv-content {
    flex: 1;
    min-width: 0;
}

.conv-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}

.conv-name {
    font-size: 14px;
    font-weight: 600;
    color: #1a1a2e;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.conv-time {
    font-size: 11px;
    color: #9ca3af;
    white-space: nowrap;
    flex-shrink: 0;
    margin-left: 8px;
}

.conv-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.conv-last-msg {
    font-size: 13px;
    color: #6b7280;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
}

.conv-badges {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
    margin-left: 8px;
}

.mode-badge {
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 10px;
    font-weight: 600;
    text-transform: uppercase;
}

.mode-badge.ai {
    background: #dcfce7;
    color: #16a34a;
}

.mode-badge.human {
    background: #fef3c7;
    color: #d97706;
}

.mode-badge.waiting {
    background: #fee2e2;
    color: #dc2626;
    animation: waitingPulse 1.5s ease-in-out infinite;
}

@keyframes waitingPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* ==================== CHAT AREA ==================== */
.chat-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: #f0f2f5;
    min-width: 0;
}

/* Empty State */
.chat-empty {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    color: #9ca3af;
}

.chat-empty h3 {
    font-size: 18px;
    color: #6b7280;
}

.chat-empty p {
    font-size: 14px;
}

/* Active Chat */
.chat-active {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

/* Chat Header */
.chat-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    background: #fff;
    border-bottom: 1px solid #e5e7eb;
    flex-shrink: 0;
}

.back-btn {
    display: none;
    width: 34px;
    height: 34px;
    border: none;
    background: none;
    cursor: pointer;
    color: #6b7280;
    border-radius: 8px;
    align-items: center;
    justify-content: center;
}

.back-btn:hover {
    background: #f3f4f6;
}

.chat-header-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    font-weight: 600;
    color: #fff;
    flex-shrink: 0;
}

.chat-header-info {
    flex: 1;
    min-width: 0;
}

.chat-header-name {
    font-size: 15px;
    font-weight: 600;
    color: #1a1a2e;
}

.chat-header-meta {
    display: flex;
    gap: 8px;
    margin-top: 2px;
}

.platform-badge {
    font-size: 11px;
    padding: 1px 8px;
    border-radius: 10px;
    font-weight: 500;
}

.platform-badge.chatbox {
    background: #ede9fe;
    color: #7c3aed;
}

.platform-badge.whatsapp {
    background: #dcfce7;
    color: #16a34a;
}

.platform-badge.telegram {
    background: #dbeafe;
    color: #2563eb;
}

.platform-badge.telegram_bot {
    background: #e0f2fe;
    color: #0284c7;
}

.platform-badge.sms,
.platform-badge.sms_android,
.platform-badge.sms_verimor,
.platform-badge.sms_twilio,
.platform-badge.sms_netgsm,
.platform-badge.sms_vonage {
    background: #fef3c7;
    color: #d97706;
}

.status-badge {
    font-size: 11px;
    padding: 1px 8px;
    border-radius: 10px;
    font-weight: 500;
}

.status-badge.idle {
    background: #f3f4f6;
    color: #6b7280;
}

.status-badge.in_conversation {
    background: #fef3c7;
    color: #d97706;
}

.status-badge.closed {
    background: #f3f4f6;
    color: #9ca3af;
}

.chat-header-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.mode-btn {
    padding: 6px 14px;
    border: none;
    border-radius: 8px;
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    background: #ef4444;
    color: #fff;
}

.mode-btn.ai-mode {
    background: #22c55e;
}

.mode-btn.waiting-mode {
    background: #dc2626;
    animation: waitingPulse 1.5s ease-in-out infinite;
}

/* ==================== MESSAGES ==================== */
.messages-container {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    background: #f0f2f5;
}

.messages-container::-webkit-scrollbar {
    width: 5px;
}

.messages-container::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 3px;
}

/* Message Bubble */
.message {
    display: flex;
    flex-direction: column;
    max-width: 65%;
    animation: msgIn 0.15s ease;
}

@keyframes msgIn {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes msgPop {
    0% { opacity: 0; transform: translateY(20px) scale(0.9); }
    50% { transform: translateY(-4px) scale(1.02); }
    100% { opacity: 1; transform: translateY(0) scale(1); }
}

.message.new-msg {
    animation: msgPop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Conversation flash on new message */
@keyframes convFlash {
    0% { background: transparent; box-shadow: none; }
    15% { background: #c4b5fd; box-shadow: inset 4px 0 0 #7c3aed; }
    30% { background: #ede9fe; }
    50% { background: #c4b5fd; box-shadow: inset 4px 0 0 #7c3aed; }
    100% { background: transparent; box-shadow: none; }
}

.conversation-item.flash {
    animation: convFlash 2s ease;
}

.conversation-item.has-new {
    background: #faf5ff;
    border-left: 3px solid #7c3aed;
}

/* Unread dot */
.unread-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #7c3aed;
    flex-shrink: 0;
    animation: unreadPulse 2s infinite;
}

@keyframes unreadPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(124, 58, 237, 0.4); }
    50% { box-shadow: 0 0 0 6px rgba(124, 58, 237, 0); }
}

.message.customer {
    align-self: flex-start;
}

.message.agent {
    align-self: flex-end;
}

.message-bubble {
    padding: 10px 14px;
    border-radius: 16px;
    font-size: 14px;
    line-height: 1.45;
    word-wrap: break-word;
    white-space: pre-wrap;
    box-shadow: 0 1px 2px rgba(0,0,0,0.06);
}

.message.customer .message-bubble {
    background: #fff;
    color: #1a1a2e;
    border-bottom-left-radius: 4px;
}

.message.agent .message-bubble {
    background: #7c3aed;
    color: #fff;
    border-bottom-right-radius: 4px;
}

.message-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 3px;
    padding: 0 4px;
}

.message-sender {
    font-size: 11px;
    font-weight: 500;
    color: #9ca3af;
}

.message-time {
    font-size: 11px;
    color: #9ca3af;
}

.message.agent .message-meta {
    justify-content: flex-end;
}

/* Date Separator */
.date-separator {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 16px 0;
    color: #9ca3af;
    font-size: 12px;
}

.date-separator::before,
.date-separator::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #e5e7eb;
}

/* Typing Indicator */
.typing-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 20px;
    background: #f0f2f5;
    flex-shrink: 0;
}

.typing-dots {
    display: flex;
    gap: 3px;
}

.typing-dots span {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #9ca3af;
    animation: typingBounce 1.4s infinite;
}

.typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.typing-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes typingBounce {
    0%, 60%, 100% { transform: translateY(0); }
    30% { transform: translateY(-5px); }
}

.typing-text {
    font-size: 12px;
    color: #9ca3af;
    font-style: italic;
}

/* ==================== CHAT INPUT WRAPPER (Chatwoot style) ==================== */
.chat-input-wrapper {
    border-top: 1px solid #e5e7eb;
    background: #fff;
    flex-shrink: 0;
}

.chat-input-tabs {
    display: flex;
    gap: 0;
    padding: 0 20px;
    border-bottom: 1px solid #f3f4f6;
}

.chat-tab {
    padding: 10px 16px;
    border: none;
    background: none;
    font-family: inherit;
    font-size: 13px;
    font-weight: 500;
    color: #6b7280;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
}

.chat-tab:hover {
    color: #374151;
}

.chat-tab.active {
    color: #7c3aed;
    border-bottom-color: #7c3aed;
    font-weight: 600;
}

.chat-tab[data-tab="note"].active {
    color: #f59e0b;
    border-bottom-color: #f59e0b;
}

/* Note mode indicator */
.chat-input-wrapper.note-mode {
    background: #fffbeb;
}

.chat-input-wrapper.note-mode .chat-input {
    background: #fffbeb;
}

/* ==================== CHAT INPUT ==================== */
.chat-input {
    display: flex;
    flex-direction: column;
    padding: 12px 20px;
    background: #fff;
    flex-shrink: 0;
    position: relative;
}

.chat-input textarea {
    width: 100%;
    padding: 8px 0;
    border: none;
    font-family: inherit;
    font-size: 14px;
    line-height: 1.5;
    resize: none;
    max-height: 120px;
    outline: none;
    background: transparent;
    color: #1a1a2e;
}

.chat-input textarea::placeholder {
    color: #9ca3af;
}

.chat-input-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 8px;
}

.send-btn {
    width: 42px;
    height: 42px;
    border: none;
    border-radius: 50%;
    background: #7c3aed;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background 0.2s;
}

.send-btn:hover {
    background: #6d28d9;
}

.send-btn-new {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 16px;
    border: none;
    border-radius: 8px;
    background: #7c3aed;
    color: #fff;
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.send-btn-new:hover {
    background: #6d28d9;
}

.send-btn-new svg {
    flex-shrink: 0;
}

/* Note mode send button */
.chat-input-wrapper.note-mode .send-btn-new {
    background: #f59e0b;
}

.chat-input-wrapper.note-mode .send-btn-new:hover {
    background: #d97706;
}

/* ==================== UTILITIES ==================== */
.empty-state {
    padding: 40px 20px;
    text-align: center;
    color: #9ca3af;
    font-size: 14px;
}

/* ==================== LOGIN PAGE ==================== */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f0f2f5;
}

.login-card {
    background: #fff;
    padding: 40px;
    border-radius: 16px;
    box-shadow: 0 4px 24px rgba(0,0,0,0.08);
    width: 400px;
    max-width: 90%;
}

.login-card h1 {
    font-size: 24px;
    color: #7c3aed;
    margin-bottom: 8px;
}

.login-card p {
    color: #6b7280;
    margin-bottom: 24px;
}

.login-card input {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    font-family: inherit;
    font-size: 14px;
    margin-bottom: 12px;
    outline: none;
}

.login-card input:focus {
    border-color: #7c3aed;
}

.login-card button {
    width: 100%;
    padding: 12px;
    background: #7c3aed;
    color: #fff;
    border: none;
    border-radius: 10px;
    font-family: inherit;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.login-card button:hover {
    background: #6d28d9;
}

.login-error {
    color: #ef4444;
    font-size: 13px;
    margin-bottom: 12px;
    display: none;
}

/* ==================== BAN ==================== */
.ban-icon-btn:hover {
    color: #ef4444 !important;
    background: #fef2f2 !important;
}

.ban-icon-btn.banned {
    background: #ef4444 !important;
    color: #fff !important;
}

.ban-icon-btn.banned:hover {
    background: #22c55e !important;
    color: #fff !important;
}

.banned-badge {
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 10px;
    font-weight: 600;
    text-transform: uppercase;
    background: #fef2f2;
    color: #ef4444;
}

/* ==================== PROFILE SIDEBAR ==================== */
.profile-sidebar {
    position: fixed;
    top: 0;
    right: -340px;
    width: 340px;
    height: 100vh;
    background: #fff;
    box-shadow: -4px 0 20px rgba(0,0,0,0.1);
    z-index: 100;
    display: flex;
    flex-direction: column;
    transition: right 0.3s ease;
}

.profile-sidebar.open {
    right: 0;
}

.profile-sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid #e5e7eb;
}

.profile-sidebar-header h3 {
    font-size: 16px;
    font-weight: 600;
    color: #1a1a2e;
}

.profile-close-btn {
    width: 32px;
    height: 32px;
    border: none;
    background: #f3f4f6;
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
    color: #6b7280;
    display: flex;
    align-items: center;
    justify-content: center;
}

.profile-close-btn:hover { background: #e5e7eb; }

.profile-sidebar-content {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

.profile-avatar-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    margin-bottom: 24px;
}

.profile-avatar-large {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    font-weight: 600;
    color: #fff;
}

.profile-name {
    font-size: 18px;
    font-weight: 600;
    color: #1a1a2e;
}

.profile-platform-badge {
    font-size: 12px;
    padding: 3px 12px;
    border-radius: 12px;
    font-weight: 500;
}

.profile-platform-badge.chatbox { background: #ede9fe; color: #7c3aed; }
.profile-platform-badge.whatsapp { background: #dcfce7; color: #16a34a; }
.profile-platform-badge.telegram { background: #dbeafe; color: #2563eb; }
.profile-platform-badge.telegram_bot { background: #e0f2fe; color: #0284c7; }
.profile-platform-badge.sms,
.profile-platform-badge.sms_android,
.profile-platform-badge.sms_verimor,
.profile-platform-badge.sms_twilio,
.profile-platform-badge.sms_netgsm,
.profile-platform-badge.sms_vonage { background: #fef3c7; color: #d97706; }

.profile-info-card {
    background: #f9fafb;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 16px;
}

.profile-info-card h4 {
    font-size: 13px;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
}

.profile-info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #e5e7eb;
}

.profile-info-row:last-child { border-bottom: none; }

.profile-info-label {
    font-size: 13px;
    color: #6b7280;
}

.profile-info-value {
    font-size: 13px;
    font-weight: 500;
    color: #1a1a2e;
    text-align: right;
    word-break: break-all;
    max-width: 60%;
}

.profile-notes {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    font-family: inherit;
    font-size: 13px;
    resize: none;
    outline: none;
    margin-bottom: 8px;
}

.profile-notes:focus { border-color: #7c3aed; }

.profile-save-btn {
    width: 100%;
    padding: 8px;
    border: none;
    border-radius: 8px;
    background: #7c3aed;
    color: #fff;
    font-family: inherit;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
}

.profile-save-btn:hover { background: #6d28d9; }

/* ==================== EMOJI PICKER ==================== */
.emoji-picker {
    position: absolute;
    bottom: 65px;
    left: 20px;
    width: 320px;
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.15);
    z-index: 50;
    overflow: hidden;
}

.emoji-search {
    padding: 10px 12px 6px;
}

.emoji-search input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    font-family: inherit;
    font-size: 13px;
    outline: none;
}

.emoji-search input:focus { border-color: #7c3aed; }

.emoji-categories {
    display: flex;
    gap: 2px;
    padding: 6px 12px;
    overflow-x: auto;
    border-bottom: 1px solid #f3f4f6;
}

.emoji-cat-btn {
    width: 32px;
    height: 32px;
    border: none;
    background: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.emoji-cat-btn:hover { background: #f3f4f6; }
.emoji-cat-btn.active { background: #ede9fe; }

.emoji-grid {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 2px;
    padding: 8px 12px 12px;
    max-height: 220px;
    overflow-y: auto;
}

.emoji-btn {
    width: 100%;
    aspect-ratio: 1;
    border: none;
    background: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.emoji-btn:hover { background: #f3f4f6; transform: scale(1.2); }

/* ==================== CHAT TOOLBAR ==================== */
.chat-toolbar {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
}

.toolbar-btn {
    width: 36px;
    height: 36px;
    border: none;
    background: none;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #9ca3af;
    transition: all 0.2s;
}

.toolbar-btn:hover {
    background: #f3f4f6;
    color: #7c3aed;
}

/* ==================== CANNED MESSAGES POPUP ==================== */
.canned-popup {
    position: absolute;
    bottom: 70px;
    left: 20px;
    right: 20px;
    max-width: 420px;
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.15);
    flex-direction: column;
    max-height: 400px;
    z-index: 50;
    overflow: hidden;
}

.canned-popup-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 16px 10px;
    border-bottom: 1px solid #f3f4f6;
}

.canned-popup-header h4 {
    font-size: 15px;
    font-weight: 600;
    color: #1a1a2e;
}

.canned-close-btn {
    width: 28px;
    height: 28px;
    border: none;
    background: #f3f4f6;
    border-radius: 50%;
    cursor: pointer;
    font-size: 16px;
    color: #6b7280;
    display: flex;
    align-items: center;
    justify-content: center;
}

.canned-close-btn:hover { background: #e5e7eb; }

.canned-popup-search {
    padding: 8px 16px;
}

.canned-popup-search input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    font-family: inherit;
    font-size: 13px;
    outline: none;
}

.canned-popup-search input:focus { border-color: #7c3aed; }

.canned-popup-categories {
    display: flex;
    gap: 6px;
    padding: 6px 16px;
    overflow-x: auto;
    flex-shrink: 0;
}

.canned-cat-btn {
    padding: 4px 10px;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    background: #fff;
    font-size: 12px;
    font-weight: 500;
    color: #6b7280;
    cursor: pointer;
    white-space: nowrap;
}

.canned-cat-btn.active {
    background: #7c3aed;
    border-color: #7c3aed;
    color: #fff;
}

.canned-popup-list {
    flex: 1;
    overflow-y: auto;
    padding: 8px 16px;
    max-height: 200px;
}

.canned-item {
    padding: 10px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.15s;
    margin-bottom: 4px;
}

.canned-item:hover { background: #f9fafb; }

.canned-item-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}

.canned-shortcut {
    font-size: 12px;
    font-weight: 600;
    color: #7c3aed;
    background: #ede9fe;
    padding: 2px 6px;
    border-radius: 4px;
}

.canned-title {
    font-size: 13px;
    font-weight: 500;
    color: #1a1a2e;
    flex: 1;
}

.canned-item-actions {
    display: flex;
    gap: 4px;
    opacity: 0;
    transition: opacity 0.15s;
}

.canned-item:hover .canned-item-actions { opacity: 1; }

.canned-edit-btn, .canned-delete-btn {
    width: 26px;
    height: 26px;
    border: none;
    background: none;
    cursor: pointer;
    color: #9ca3af;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.canned-edit-btn:hover { color: #7c3aed; background: #ede9fe; }
.canned-delete-btn:hover { color: #ef4444; background: #fef2f2; }

.canned-item-text {
    font-size: 12px;
    color: #6b7280;
    line-height: 1.4;
}

.canned-empty {
    text-align: center;
    color: #9ca3af;
    font-size: 13px;
    padding: 20px 0;
}

.canned-popup-footer {
    padding: 8px 16px 12px;
    border-top: 1px solid #f3f4f6;
}

.canned-add-btn {
    width: 100%;
    padding: 8px;
    border: 1px dashed #d1d5db;
    border-radius: 8px;
    background: #fff;
    color: #7c3aed;
    font-family: inherit;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
}

.canned-add-btn:hover { background: #faf5ff; border-color: #7c3aed; }

/* Canned Form */
.canned-form {
    flex-direction: column;
    gap: 8px;
    padding: 16px;
    border-top: 1px solid #e5e7eb;
    background: #faf5ff;
}

.canned-form h4 {
    font-size: 14px;
    font-weight: 600;
    color: #1a1a2e;
    margin-bottom: 4px;
}

.canned-form input, .canned-form textarea {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    font-family: inherit;
    font-size: 13px;
    outline: none;
    resize: none;
}

.canned-form input:focus, .canned-form textarea:focus { border-color: #7c3aed; }

.canned-form-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

.canned-form-cancel {
    padding: 6px 14px;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    background: #fff;
    font-family: inherit;
    font-size: 13px;
    cursor: pointer;
    color: #6b7280;
}

.canned-form-save {
    padding: 6px 14px;
    border: none;
    border-radius: 6px;
    background: #7c3aed;
    color: #fff;
    font-family: inherit;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
}

.canned-form-save:hover { background: #6d28d9; }

/* ==================== SLASH DROPDOWN ==================== */
.slash-dropdown {
    position: absolute;
    bottom: 70px;
    left: 60px;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
    min-width: 240px;
    max-height: 200px;
    overflow-y: auto;
    z-index: 50;
    padding: 6px;
}

.slash-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 6px;
    cursor: pointer;
}

.slash-item:hover { background: #f9fafb; }

.slash-shortcut {
    font-size: 13px;
    font-weight: 600;
    color: #7c3aed;
}

.slash-title {
    font-size: 13px;
    color: #6b7280;
}

/* ==================== TOAST ==================== */
.toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: #1a1a2e;
    color: #fff;
    padding: 12px 24px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    z-index: 1000;
    opacity: 0;
    transition: all 0.3s ease;
    pointer-events: none;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.toast-error {
    background: #dc3545;
}

/* ==================== AGENT STATUS SELECT ==================== */
.agent-status-select {
    padding: 4px 8px;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    outline: none;
    background: #fff;
}

.agent-status-select.status-online { border-color: #22c55e; color: #16a34a; }
.agent-status-select.status-away { border-color: #f59e0b; color: #d97706; }
.agent-status-select.status-offline { border-color: #ef4444; color: #dc2626; }

/* ==================== ASSIGNMENT FILTER ==================== */
.assignment-filter {
    display: flex;
    gap: 4px;
    padding: 8px 16px;
    border-bottom: 1px solid #f3f4f6;
}

/* assignment-filter-btn styles overridden by .nav-item when used in nav-sidebar */
.assignment-filter-btn {
    flex: 1;
    padding: 6px 10px;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    background: #fff;
    font-size: 12px;
    font-weight: 500;
    color: #6b7280;
    cursor: pointer;
    transition: all 0.15s;
}

.assignment-filter-btn:hover {
    background: #f9fafb;
}

.assignment-filter-btn.active {
    background: #7c3aed;
    border-color: #7c3aed;
    color: #fff;
}

/* Override when assignment-filter-btn is used as nav-item */
.nav-item.assignment-filter-btn {
    flex: unset;
    border: none;
    border-radius: 6px;
    padding: 8px 16px;
    font-size: 13px;
}

.nav-item.assignment-filter-btn:hover {
    background: #f3f4f6;
    color: #1a1a2e;
}

.nav-item.assignment-filter-btn.active {
    background: #ede9fe;
    color: #7c3aed;
    border-color: transparent;
}

/* ==================== ASSIGNMENT BADGES ==================== */
.assign-badge {
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 10px;
    font-weight: 500;
}

.assign-badge.mine {
    background: #dcfce7;
    color: #16a34a;
}

.assign-badge.other {
    background: #dbeafe;
    color: #2563eb;
}

.assign-badge.queue {
    background: #fef3c7;
    color: #d97706;
}

.assign-badge.waiting {
    background: #fee2e2;
    color: #dc2626;
    animation: waitingPulse 1.5s ease-in-out infinite;
}

/* ==================== TRANSFER/CLAIM/RELEASE BUTTONS ==================== */
.transfer-btn:hover { color: #7c3aed !important; background: #ede9fe !important; }
.claim-btn:hover { color: #22c55e !important; background: #dcfce7 !important; }
.release-btn:hover { color: #f59e0b !important; background: #fef3c7 !important; }

/* ==================== MODAL ==================== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 200;
}

.modal-content {
    background: #fff;
    border-radius: 12px;
    width: 400px;
    max-width: 90%;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    overflow: hidden;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid #e5e7eb;
}

.modal-header h3 {
    font-size: 16px;
    font-weight: 600;
    color: #1a1a2e;
}

.modal-close-btn {
    width: 32px;
    height: 32px;
    border: none;
    background: #f3f4f6;
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
    color: #6b7280;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close-btn:hover { background: #e5e7eb; }

.modal-body {
    padding: 20px;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 16px 20px;
    border-top: 1px solid #e5e7eb;
    background: #f9fafb;
}

.form-group {
    margin-bottom: 16px;
}

.form-group:last-child {
    margin-bottom: 0;
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: #374151;
    margin-bottom: 6px;
}

.form-select,
.form-textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    font-family: inherit;
    font-size: 14px;
    outline: none;
}

.form-select:focus,
.form-textarea:focus {
    border-color: #7c3aed;
}

.form-textarea {
    resize: none;
}

.btn {
    padding: 10px 18px;
    border: none;
    border-radius: 8px;
    font-family: inherit;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
}

.btn-secondary {
    background: #f3f4f6;
    color: #374151;
}

.btn-secondary:hover {
    background: #e5e7eb;
}

.btn-primary {
    background: #7c3aed;
    color: #fff;
}

.btn-primary:hover {
    background: #6d28d9;
}

/* ==================== QUEUE STATUS BAR ==================== */
.queue-status-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: linear-gradient(135deg, #f5f3ff 0%, #ede9fe 100%);
    border-bottom: 1px solid #ddd6fe;
    flex-wrap: wrap;
    gap: 6px;
}

.queue-status-info {
    display: flex;
    gap: 12px;
}

.queue-badge {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.queue-badge.waiting {
    color: #d97706;
    border: 1px solid #fcd34d;
}

.queue-badge.waiting svg {
    color: #f59e0b;
}

.queue-badge.agents {
    color: #16a34a;
    border: 1px solid #86efac;
}

.queue-badge.agents svg {
    color: #22c55e;
}

.take-next-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border: none;
    border-radius: 8px;
    background: #7c3aed;
    color: #fff;
    font-family: inherit;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
}

.take-next-btn:hover {
    background: #6d28d9;
    transform: translateY(-1px);
}

.take-next-btn:disabled {
    background: #c4b5fd;
    cursor: not-allowed;
    transform: none;
}

.take-next-btn svg {
    flex-shrink: 0;
}

/* ==================== TRIAGE BADGE ==================== */
.triage-badge {
    font-size: 9px;
    padding: 2px 5px;
    border-radius: 8px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.triage-badge.urgent {
    background: #fef2f2;
    color: #dc2626;
    border: 1px solid #fecaca;
}

.triage-badge.normal {
    background: #fef3c7;
    color: #d97706;
    border: 1px solid #fcd34d;
}

.triage-badge.simple {
    background: #dcfce7;
    color: #16a34a;
    border: 1px solid #86efac;
}

/* ==================== CALLBACK LIST ==================== */
.callback-section {
    border-top: 1px solid #e5e7eb;
    padding: 12px 16px;
    background: #fffbeb;
}

.callback-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.callback-section-header h4 {
    font-size: 12px;
    font-weight: 600;
    color: #d97706;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.callback-badge {
    background: #fbbf24;
    color: #fff;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 10px;
    font-weight: 600;
}

.callback-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: 150px;
    overflow-y: auto;
}

.callback-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 10px;
    background: #fff;
    border-radius: 8px;
    border: 1px solid #fcd34d;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.15s;
}

.callback-item:hover {
    background: #fef3c7;
}

.callback-item-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.callback-item-name {
    font-weight: 600;
    color: #1a1a2e;
}

.callback-item-time {
    font-size: 10px;
    color: #9ca3af;
}

.callback-item-action {
    padding: 4px 8px;
    border: none;
    border-radius: 6px;
    background: #f59e0b;
    color: #fff;
    font-size: 10px;
    font-weight: 600;
    cursor: pointer;
}

.callback-item-action:hover {
    background: #d97706;
}

/* ==================== AI TRIAGE INFO IN CHAT HEADER ==================== */
.triage-info {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 8px;
    background: #f9fafb;
    border-radius: 6px;
    font-size: 11px;
    color: #6b7280;
}

.triage-info-label {
    font-weight: 500;
}

.triage-info-category {
    font-weight: 600;
    color: #374151;
}

/* ==================== RESPONSIVE ==================== */
@media (max-width: 1024px) {
    .nav-sidebar {
        display: none;
    }
}

@media (max-width: 768px) {
    .conv-sidebar {
        width: 100%;
        position: fixed;
        top: 0;
        left: 0;
        z-index: 10;
        transition: transform 0.3s;
    }

    .conv-sidebar.hidden {
        transform: translateX(-100%);
    }

    .back-btn {
        display: flex;
    }

    .chat-area {
        width: 100%;
    }
}

/* Autocomplete Dropdown */
.autocomplete-dropdown {
    position: absolute;
    bottom: 100%;
    left: 0;
    right: 0;
    background: var(--bg-secondary, #1e1e2e);
    border: 1px solid var(--border-color, #333);
    border-radius: 8px;
    max-height: 200px;
    overflow-y: auto;
    z-index: 1000;
    box-shadow: 0 -4px 12px rgba(0,0,0,0.3);
    margin-bottom: 4px;
    display: none;
}
.autocomplete-item {
    padding: 8px 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}
.autocomplete-item:hover {
    background: rgba(255,255,255,0.1);
}
.autocomplete-item:last-child {
    border-bottom: none;
}
.autocomplete-icon {
    flex-shrink: 0;
    font-size: 14px;
}
.autocomplete-text {
    color: var(--text-secondary, #ccc);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.autocomplete-item:hover .autocomplete-text {
    color: var(--text-primary, #fff);
}

/* Kabul Et butonu - konuşma listesinde */
.accept-btn {
    background: #28a745;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 2px 8px;
    font-size: 11px;
    cursor: pointer;
    margin-left: 4px;
    animation: pulse-accept 1.5s infinite;
}
.accept-btn:hover {
    background: #218838;
}
@keyframes pulse-accept {
    0% { box-shadow: 0 0 0 0 rgba(40, 167, 69, 0.5); }
    70% { box-shadow: 0 0 0 6px rgba(40, 167, 69, 0); }
    100% { box-shadow: 0 0 0 0 rgba(40, 167, 69, 0); }
}

/* ==================== LIVE SUPPORT TOAST ==================== */
.live-support-toast {
    position: fixed;
    top: -200px;
    right: 20px;
    width: 340px;
    background: #1e1e2d;
    border: 2px solid #dc2626;
    border-radius: 12px;
    padding: 14px;
    z-index: 10000;
    box-shadow: 0 8px 32px rgba(220, 38, 38, 0.3);
    transition: top 0.4s ease;
    color: #fff;
}

.lst-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    font-size: 14px;
}
.lst-icon {
    font-size: 18px;
    animation: waitingPulse 1s infinite;
}
.lst-timer {
    margin-left: auto;
    font-size: 20px;
    font-weight: bold;
    color: #dc2626;
}
.lst-body {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-bottom: 10px;
    font-size: 13px;
}
.lst-name {
    font-weight: 600;
    color: #e5e7eb;
}
.lst-text {
    color: #9ca3af;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.lst-accept {
    width: 100%;
    background: #22c55e;
    color: white;
    border: none;
    border-radius: 8px;
    padding: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}
.lst-accept:hover {
    background: #16a34a;
}
