
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #111b21;
    color: #e9edef;
    height: 100vh;
    overflow: hidden;
}

.app {
    height: 100vh;
    display: flex;
    flex-direction: column;
}

/* QR Modal */
.qr-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #111b21;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.qr-content {
    background: #1f2937;
    padding: 3rem;
    border-radius: 12px;
    text-align: center;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

.qr-header h2 {
    color: #e9edef;
    margin-bottom: 1rem;
    font-size: 1.5rem;
    font-weight: 400;
}

.qr-header p {
    color: #8696a0;
    margin-bottom: 2rem;
}

.qr-code-container {
    margin: 2rem 0;
    min-height: 264px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.qr-loader {
    display: flex;
    flex-direction: column;
    align-items: center;
    color: #8696a0;
}

.qr-loader i {
    font-size: 2rem;
    margin-bottom: 1rem;
    color: #00a884;
}

.qr-image {
    max-width: 264px;
    border: 20px solid white;
    border-radius: 12px;
}

.qr-steps {
    text-align: left;
    background: #202c33;
    padding: 1.5rem;
    border-radius: 8px;
    margin-top: 2rem;
}

.qr-steps ol {
    color: #8696a0;
    padding-left: 1.5rem;
}

.qr-steps li {
    margin-bottom: 0.5rem;
    line-height: 1.5;
}

/* Main App */
.main-app {
    display: flex;
    height: calc(100vh - 60px); /* navbar height'ı çıkar */
    overflow: hidden; /* scroll'u engelle */
}

/* Sidebar */
.sidebar {
    width: 400px;
    background: #111b21;
    border-right: 1px solid #2a3942;
    display: flex;
    flex-direction: column;
}

.sidebar-header {
    background: #202c33;
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #2a3942;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.avatar {
    width: 40px;
    height: 40px;
    background: #2a3942;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #8696a0;
}

.user-name {
    font-weight: 400;
    color: #e9edef;
}

.header-actions {
    display: flex;
    gap: 0.5rem;
}

.btn-icon {
    background: none;
    border: none;
    color: #8696a0;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    transition: background 0.2s;
}

.btn-icon:hover {
    background: #2a3942;
    color: #e9edef;
}

/* Search */
.search-container {
    padding: 1rem;
    background: #111b21;
}

.wp-account-selector {
    padding: 0.75rem 1rem;
    background: #111b21;
    border-bottom: 1px solid #2a3942;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.wp-account-selector label {
    color: #8696a0;
    font-size: 0.9rem;
    white-space: nowrap;
}

.wp-dropdown {
    flex: 1;
    padding: 0.5rem;
    background: #2a3942;
    color: #e9edef;
    border: 1px solid #3b4a54;
    border-radius: 8px;
    font-size: 0.9rem;
    cursor: pointer;
    outline: none;
}

.wp-dropdown:hover {
    background: #374248;
}

.wp-dropdown:focus {
    border-color: #00a884;
}

.btn-mini {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    border: 1px solid #3b4a54;
    background: #2a3942;
    color: #e9edef;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.btn-mini:hover {
    background: #374248;
}

.btn-mini:active {
    transform: translateY(1px);
}

.upload-progress {
    margin-top: 10px;
    width: 100%;
}

.upload-progress-bar {
    width: 100%;
    height: 8px;
    background: #2a3942;
    border: 1px solid #3b4a54;
    border-radius: 999px;
    overflow: hidden;
}

.upload-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #00a884, #25d366);
    width: 0%;
    transition: width 0.15s ease;
}

.upload-progress-text {
    margin-top: 6px;
    font-size: 12px;
    color: #e9edef;
    opacity: 0.9;
}

.logs-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin: 12px 0 14px;
}

.logs-controls label {
    color: #8696a0;
    font-size: 0.9rem;
}

.logs-tabs {
    display: flex;
    gap: 10px;
    margin: 6px 0 10px;
}

.logs-tab {
    background: #202c33;
    border: 1px solid #2a3942;
    color: #e9edef;
    padding: 8px 12px;
    border-radius: 999px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.9rem;
}

.logs-tab.active {
    border-color: #00a884;
    color: #00a884;
}

.logs-panel {
    background: #111b21;
    border: 1px solid #2a3942;
    border-radius: 12px;
    overflow: hidden;
}

.logs-pre {
    margin: 0;
    padding: 12px;
    max-height: 360px;
    overflow: auto;
    white-space: pre-wrap;
    word-break: break-word;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    font-size: 12px;
    color: #e9edef;
}

/* Media preview modal */
.media-modal {
    position: fixed;
    inset: 0;
    z-index: 12000;
    display: none;
}
.media-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.65);
}
.media-modal-content {
    position: relative;
    width: min(980px, 92vw);
    height: min(720px, 86vh);
    margin: 6vh auto 0;
    background: #111b21;
    border: 1px solid #2a3942;
    border-radius: 14px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}
.media-modal-header {
    padding: 12px 14px;
    background: #202c33;
    border-bottom: 1px solid #2a3942;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
.media-modal-title {
    font-weight: 700;
    color: #e9edef;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.media-modal-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}
.media-modal-download {
    color: #00a884;
    text-decoration: none;
    font-weight: 700;
}
.media-modal-close {
    border: 1px solid #3b4a54;
    background: #2a3942;
    color: #e9edef;
    border-radius: 10px;
    padding: 8px 10px;
    cursor: pointer;
}
.media-modal-body {
    flex: 1;
    overflow: auto;
    padding: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.media-modal-body iframe,
.media-modal-body video,
.media-modal-body img {
    max-width: 100%;
    max-height: 100%;
    border-radius: 10px;
    border: 1px solid #2a3942;
    background: #0b141a;
}

/* Status Modal */
.status-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
}

.status-modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
}

.status-modal-content {
    position: relative;
    background: #1f2937;
    border-radius: 12px;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    z-index: 2001;
}

.status-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid #2f3a47;
}

.status-modal-header h2 {
    color: #e9edef;
    font-size: 1.5rem;
    font-weight: 400;
    margin: 0;
}

.status-modal-close {
    background: transparent;
    border: none;
    color: #8696a0;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    transition: background 0.2s;
}

.status-modal-close:hover {
    background: #2f3a47;
    color: #e9edef;
}

.status-modal-body {
    padding: 1.5rem;
}

.status-upload-area {
    margin-bottom: 1.5rem;
}

.status-upload-placeholder {
    border: 2px dashed #2f3a47;
    border-radius: 8px;
    padding: 3rem;
    text-align: center;
    color: #8696a0;
    cursor: pointer;
    transition: border-color 0.2s;
}

.status-upload-placeholder:hover {
    border-color: #00a884;
}

.status-upload-placeholder i {
    font-size: 3rem;
    margin-bottom: 1rem;
    display: block;
    color: #8696a0;
}

.status-upload-placeholder p {
    margin-bottom: 1rem;
    color: #8696a0;
}

.status-preview {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    background: #111b21;
}

.status-preview img,
.status-preview video {
    width: 100%;
    display: block;
    max-height: 400px;
    object-fit: contain;
}

.status-preview button {
    margin-top: 1rem;
    width: 100%;
}

.status-caption-area {
    margin-top: 1.5rem;
}

.status-caption-area label {
    display: block;
    color: #e9edef;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.status-caption-area textarea {
    width: 100%;
    background: #111b21;
    border: 1px solid #2f3a47;
    border-radius: 8px;
    padding: 0.75rem;
    color: #e9edef;
    font-family: inherit;
    font-size: 0.9rem;
    resize: vertical;
    min-height: 80px;
}

.status-caption-area textarea:focus {
    outline: none;
    border-color: #00a884;
}

.status-caption-count {
    display: block;
    text-align: right;
    color: #8696a0;
    font-size: 0.8rem;
    margin-top: 0.25rem;
}

.status-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    padding: 1.5rem;
    border-top: 1px solid #2f3a47;
}

.status-modal-footer button {
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
}

.status-modal-footer .btn-secondary {
    background: #2f3a47;
    color: #e9edef;
}

.status-modal-footer .btn-secondary:hover {
    background: #3f4a57;
}

.status-modal-footer .btn-primary {
    background: #00a884;
    color: #fff;
}

.status-modal-footer .btn-primary:hover:not(:disabled) {
    background: #00c894;
}

.status-modal-footer .btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.media-open-btn {
    border: 1px solid #2a3942;
    background: #202c33;
    color: #e9edef;
    border-radius: 10px;
    padding: 8px 10px;
    cursor: pointer;
    font-weight: 700;
    margin-bottom: 6px;
}
.media-open-btn:hover {
    border-color: #00a884;
    color: #00a884;
}

/* Voice recording UI */
.recording-pill {
    margin-top: 10px;
    padding: 10px 12px;
    background: #202c33;
    border: 1px solid #2a3942;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    justify-content: flex-end;
}
.recording-dot {
    width: 10px;
    height: 10px;
    background: #ef4444;
    border-radius: 999px;
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.6);
    animation: recPulse 1.1s infinite;
    margin-right: auto;
}
@keyframes recPulse {
    0% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.6); }
    70% { box-shadow: 0 0 0 10px rgba(239, 68, 68, 0); }
    100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}
.recording-pill #recordingTimer {
    font-weight: 800;
    color: #e9edef;
    font-variant-numeric: tabular-nums;
}
.recording-btn {
    border: 1px solid #3b4a54;
    background: #2a3942;
    color: #e9edef;
    border-radius: 10px;
    padding: 8px 10px;
    cursor: pointer;
}
.recording-btn:hover {
    border-color: #00a884;
    color: #00a884;
}

/* Emoji picker */
.emoji-picker {
    position: absolute;
    bottom: 64px;
    left: 16px;
    width: min(320px, 86vw);
    max-height: 240px;
    overflow: auto;
    background: #202c33;
    border: 1px solid #2a3942;
    border-radius: 12px;
    padding: 10px;
    display: none;
    box-shadow: 0 20px 40px rgba(0,0,0,0.35);
    z-index: 5000;
}
.emoji-grid {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 6px;
}
.emoji-btn {
    border: none;
    background: #111b21;
    border: 1px solid #2a3942;
    border-radius: 10px;
    padding: 8px 0;
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
}
.emoji-btn:hover {
    border-color: #00a884;
    background: #0b141a;
}

.search-box {
    position: relative;
    display: flex;
    align-items: center;
}

.search-box i {
    position: absolute;
    left: 1rem;
    color: #8696a0;
    z-index: 1;
}

.search-box input {
    width: 100%;
    background: #202c33;
    border: none;
    padding: 0.75rem 1rem 0.75rem 3rem;
    border-radius: 8px;
    color: #e9edef;
    font-size: 0.9rem;
}

.search-box input::placeholder {
    color: #8696a0;
}

.search-box input:focus {
    outline: none;
    background: #2a3942;
}

/* Chat List */
.chat-list {
    flex: 1;
    overflow-y: auto;
}

.no-chats {
    text-align: center;
    padding: 3rem 2rem;
    color: #8696a0;
}

.no-chats p {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

.no-chats small {
    font-size: 0.9rem;
}

.chat-item {
    display: flex;
    align-items: center;
    padding: 1rem;
    cursor: pointer;
    border-bottom: 1px solid #2a3942;
    transition: background 0.2s;
}

.chat-item:hover {
    background: #202c33;
}

.chat-item.active {
    background: #2a3942;
}

.chat-item .avatar {
    margin-right: 1rem;
    flex-shrink: 0;
}

.chat-details {
    flex: 1;
    min-width: 0;
}

.chat-name {
    font-weight: 400;
    color: #e9edef;
    margin-bottom: 0.25rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.last-message {
    color: #8696a0;
    font-size: 0.9rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chat-meta {
    text-align: right;
    flex-shrink: 0;
    margin-left: 1rem;
}

.message-time {
    color: #8696a0;
    font-size: 0.75rem;
}

.unread-badge {
    margin-top: 4px;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: 999px;
    background: #25d366;
    color: #111b21;
    font-size: 12px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

/* Chat Area */
.chat-area {
    flex: 1;
    background: #0b141a;
    display: flex;
    flex-direction: column;
    position: relative;
}

/* Welcome Screen */
.welcome-screen {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100%;
    text-align: center;
    color: #8696a0;
}

.welcome-content img {
    width: 320px;
    margin-bottom: 2rem;
    opacity: 0.8;
}

.welcome-content h2 {
    font-size: 2rem;
    font-weight: 300;
    margin-bottom: 1rem;
    color: #e9edef;
}

.welcome-content p {
    font-size: 1rem;
    line-height: 1.5;
    max-width: 500px;
}

/* Chat Window */
.chat-window {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.chat-header {
    background: #202c33;
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #2a3942;
}

.chat-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.contact-details h3 {
    color: #e9edef;
    font-weight: 400;
    font-size: 1.1rem;
    margin-bottom: 0.25rem;
}

.contact-details span {
    color: #8696a0;
    font-size: 0.8rem;
}

.chat-actions {
    display: flex;
    gap: 0.5rem;
}

/* Messages */
.messages-container {
    flex: 1;
    overflow-y: auto;
    background: #0b141a url('data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzQwIiBoZWlnaHQ9IjMwMCIgdmlld0JveD0iMCAwIDM0MCAzMDAiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CjxnIG9wYWNpdHk9IjAuMDMiPgo8cGF0aCBkPSJNMTcwIDEwMEM1OS41IDE3IDEyIDU5LjUgNzAgMTcwUzE0NyAyOTMgMjcwIDI0MFMzMTAgMTQ3IDI0MCAzMlMxNzAgMTAwIDE3MCAzMloiIGZpbGw9IndoaXRlIi8+CjwvZz4KPHN2Zz4K') center/contain no-repeat;
    padding: 1rem;
}

.messages {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    min-height: 100%;
    padding-bottom: 1rem;
}

.message {
    max-width: 65%;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    word-wrap: break-word;
    position: relative;
}

.message.sent {
    align-self: flex-end;
    background: #005c4b;
    color: #e9edef;
    border-bottom-right-radius: 3px;
}

.message.received {
    align-self: flex-start;
    background: #202c33;
    color: #e9edef;
    border-bottom-left-radius: 3px;
}

.message-time {
    font-size: 0.7rem;
    color: #8696a0;
    margin-top: 0.25rem;
    text-align: right;
}

.message.sent .message-time {
    color: #aaa;
}

/* Message Input */
.message-input-container {
    background: #202c33;
    padding: 1rem;
    border-top: 1px solid #2a3942;
    position: relative;
}

.message-input {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: #2a3942;
    border-radius: 24px;
    padding: 0.5rem;
}

.message-input input {
    flex: 1;
    background: none;
    border: none;
    color: #e9edef;
    padding: 0.5rem 1rem;
    font-size: 0.95rem;
}

.message-input input::placeholder {
    color: #8696a0;
}

.message-input input:focus {
    outline: none;
}

.btn-send {
    background: #00a884;
    border: none;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: background 0.2s;
}

.btn-send:hover {
    background: #008f6f;
}

.btn-send:disabled {
    background: #2a3942;
    color: #8696a0;
    cursor: not-allowed;
}

/* File Preview */
.file-preview {
    margin-top: 0.5rem;
    padding: 0.75rem;
    background: #2a3942;
    border-radius: 8px;
}

.file-preview-content {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    position: relative;
}

.file-preview-content img {
    border-radius: 4px;
}

.file-preview-content #previewFile {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
}

.file-preview-content #previewFile i {
    font-size: 2rem;
    color: #00a884;
}

.btn-remove-file {
    background: #374151;
    border: none;
    color: #e9edef;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: background 0.2s;
}

.btn-remove-file:hover {
    background: #4b5563;
}

/* Connection Status */
.connection-status {
    position: fixed;
    top: 10px;
    right: 10px;
    background: #005c4b;
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    z-index: 1000;
}

.connection-status.connected {
    background: #00a884;
}

.connection-status.disconnected {
    background: #d32f2f;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: #2a3942;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: #3c454c;
}

/* Login Screen */
.login-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #111b21;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
}

.login-container {
    background: #1f2937;
    padding: 3rem;
    border-radius: 12px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    width: 400px;
    max-width: 90%;
}

.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.login-header h1 {
    color: #e9edef;
    font-size: 1.8rem;
    font-weight: 400;
    margin-bottom: 0.5rem;
}

.login-header p {
    color: #8696a0;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.input-group {
    display: flex;
    flex-direction: column;
}

.input-group label {
    color: #e9edef;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.input-group input {
    background: #202c33;
    border: 1px solid #2a3942;
    color: #e9edef;
    padding: 0.75rem;
    border-radius: 8px;
    font-size: 1rem;
}

.input-group input:focus {
    outline: none;
    border-color: #00a884;
}

.login-btn {
    background: #00a884;
    color: white;
    border: none;
    padding: 0.75rem;
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.2s;
}

.login-btn:hover {
    background: #008f6f;
}

.login-info {
    background: #202c33;
    padding: 1rem;
    border-radius: 8px;
    text-align: center;
    margin-top: 1rem;
}

.login-info small {
    color: #8696a0;
    line-height: 1.4;
}

/* Admin Panel */
.admin-panel {
    height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Agent-only simplified UI (mobile-first WhatsApp screen) */
body.agent-only .top-nav {
    display: none !important;
}
body.agent-only .main-app {
    height: 100vh; /* no navbar in agent-only */
}

/* Agent-only: show logout icon in chat header actions */
body.agent-only #agentLogoutBtn {
    display: inline-flex !important;
}

body.agent-only #agentSidebarLogoutBtn {
    display: inline-flex !important;
}

/* Top Navigation */
.top-nav {
    background: #202c33;
    border-bottom: 1px solid #2a3942;
    padding: 0 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 60px;
}

.nav-left h2 {
    color: #e9edef;
    font-size: 1.2rem;
    font-weight: 400;
    margin: 0;
}

.user-info-text {
    color: #8696a0;
    font-size: 0.8rem;
    margin-left: 1rem;
}

.nav-tabs {
    display: flex;
    gap: 0;
}

.nav-tab {
    background: none;
    border: none;
    color: #8696a0;
    padding: 1rem 1.5rem;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: all 0.2s;
    font-size: 0.9rem;
}

.nav-tab:hover {
    color: #e9edef;
    background: #2a3942;
}

.nav-tab.active {
    color: #00a884;
    border-bottom-color: #00a884;
}

.logout-btn {
    background: #d32f2f;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: background 0.2s;
}

.logout-btn:hover {
    background: #b71c1c;
}

/* Tab Content */
.tab-content {
    flex: 1;
    overflow: hidden; /* Dış scroll'u engelle */
    height: calc(100vh - 60px); /* navbar height */
}

.tab-panel {
    height: 100%;
    overflow: auto; /* İçeride scroll */
    display: none;
}

.tab-panel.active {
    display: block !important;
}

/* Assignment Panel */
.assignment-container {
    padding: 20px;
    background: transparent;
    max-width: 900px;
    margin: 0 auto;
}

.assignment-header {
    margin-bottom: 2rem;
    text-align: center;
}

.assignment-header h3 {
    color: #333;
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.assignment-header p {
    color: #666;
}

.assignment-form {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 30px;
    border: 1px solid #e9ecef;
}

.form-row {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
}

.form-row:last-child {
    align-items: end;
}

.form-group {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 200px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #333;
    font-size: 0.9rem;
}

.form-group small {
    color: #666;
    font-size: 12px;
    display: block;
    margin-top: 4px;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    background: white;
    color: #333;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #00a884;
}

.assignment-note {
    background: #202c33;
    border: 1px solid #2a3942;
    padding: 1rem;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #8696a0;
    font-size: 0.85rem;
    margin-top: 1rem;
}

.assignment-note i {
    color: #00a884;
    flex-shrink: 0;
}

.add-btn {
    background: #00a884;
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    height: fit-content;
    transition: background 0.2s;
    font-weight: 600;
}

.add-btn:hover {
    background: #008f72;
}

.list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.list-header h4 {
    color: #e9edef;
    margin: 0;
}

.refresh-btn {
    background: #2a3942;
    color: #8696a0;
    border: none;
    padding: 0.5rem;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.refresh-btn:hover {
    background: #3c454c;
    color: #e9edef;
}

.assignments-items {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.assignment-item {
    background: #1f2937;
    border: 1px solid #2a3942;
    padding: 1rem;
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: border-color 0.2s;
}

.assignment-item:hover {
    border-color: #3c454c;
}

.assignment-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.assignment-contact {
    color: #e9edef;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.assignment-contact .contact-type {
    background: #00a884;
    color: white;
    padding: 0.2rem 0.5rem;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 500;
}

.assignment-agent {
    color: #8696a0;
    font-size: 0.9rem;
}

.assignment-details {
    color: #8696a0;
    font-size: 0.8rem;
    display: flex;
    gap: 0.5rem;
}

.assignment-details span {
    background: #202c33;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
}

.assignment-actions {
    display: flex;
    gap: 0.5rem;
}

.edit-assignment,
.delete-assignment {
    border: none;
    padding: 0.5rem;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s;
    color: white;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.edit-assignment {
    background: #2a3942;
}

.edit-assignment:hover {
    background: #00a884;
}

.delete-assignment {
    background: #d32f2f;
}

.delete-assignment:hover {
    background: #b71c1c;
}

.cancel-btn {
    background: #6c757d;
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    height: fit-content;
    transition: background 0.2s;
    margin-left: 0.5rem;
}

.cancel-btn:hover {
    background: #5a6268;
}

/* Config Panel */

/* Config sekmesi arka planı Reporting/Settings ile aynı olacak şekilde ayarlandı */
.config-container {
    background: #111B21;
    min-height: calc(100vh - 60px);
    max-width: 700px;
    margin: 40px auto 0 auto;
    padding: 32px 28px 32px 28px;
    border-radius: 18px;
    box-shadow: 0 4px 24px 0 rgba(60,72,88,0.10), 0 1.5px 4px 0 rgba(60,72,88,0.08);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
}


.config-accounts-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: #1f2937;
  color: #e9edef;
  border-radius: 12px;
  overflow: visible; /* Changed from hidden to allow dropdowns to overflow */
  box-shadow: 0 10px 30px rgba(0,0,0,0.2);
  margin-bottom: 24px;
}

.config-accounts-table thead tr {
  background: #232d3b;
}

.config-accounts-table th,
.config-accounts-table td {
  padding: 14px 16px;
  text-align: left;
}

.config-accounts-table th {
  color: #00a884;
  font-weight: 600;
  border-bottom: 1px solid #2a3942;
}

.config-accounts-table tbody tr {
  background: #232d3b;
  border-bottom: 1px solid #2a3942;
  transition: background 0.2s;
  position: relative;
  z-index: 1;
}

.config-accounts-table tbody tr:hover {
  background: #2a3942;
}

.config-accounts-table td {
  color: #e9edef;
}

/* Agent column - allow dropdown overflow */
.config-accounts-table td:nth-child(4) {
  overflow: visible;
  position: relative;
}

.config-accounts-table td:last-child {
  display: flex;
  gap: 8px;
  align-items: center;
}

.config-accounts-table .edit-btn {
  background: #00a884;
  color: #fff;
  border: none;
  border-radius: 4px;
  padding: 8px 12px;
  cursor: pointer;
  transition: background 0.2s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
}

.config-accounts-table .edit-btn:hover {
  background: #008f72;
}

.config-accounts-table .delete-btn {
  background: #d32f2f;
  color: #fff;
  border: none;
  border-radius: 4px;
  padding: 8px 12px;
  cursor: pointer;
  transition: background 0.2s;
  min-width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.config-accounts-table .delete-btn:hover {
  background: #b71c1c;
}

/* Assignment action buttons */
.assignment-actions .edit-btn,
.assignment-actions .delete-btn {
  min-width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 4px;
  padding: 8px;
  cursor: pointer;
  transition: background 0.2s;
}

.assignment-actions .edit-btn {
  background: #00a884;
  color: #fff;
}

.assignment-actions .edit-btn:hover {
  background: #008f72;
}

.assignment-actions .delete-btn {
  background: #d32f2f;
  color: #fff;
}

.assignment-actions .delete-btn:hover {
  background: #b71c1c;
}


/* Agent atama dropdown modern görünüm */
.agent-assign-select {
    background: #202c33;
    color: #e9edef;
    border: 1px solid #2a3942;
    padding: 10px;
    border-radius: 4px;
    width: 100%;
    font-size: 1rem;
    transition: border 0.2s;
}
.agent-assign-select:focus {
    border: 1.5px solid #00a884;
    outline: none;
}
.agent-assign-select option {
    background: #232d3b;
    color: #e9edef;
}

.delete-wp-account-btn {
  background: #d32f2f;
  color: #fff;
  border: none;
  border-radius: 4px;
  padding: 6px 12px;
  cursor: pointer;
  font-size: 1rem;
  transition: background 0.2s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.delete-wp-account-btn:hover {
  background: #b71c1c;
}
.delete-wp-account-btn i {
  margin-right: 4px;
  font-size: 1.1em;
}





/* Settings Panel */
.settings-container {
    padding: 2rem;
    max-width: 800px;
    margin: 0 auto;
}

.settings-header {
    margin-bottom: 2rem;
    text-align: center;
}

.settings-header h3 {
    color: #e9edef;
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.settings-header p {
    color: #8696a0;
}

.settings-placeholder {
    background: #1f2937;
    padding: 4rem 2rem;
    border-radius: 12px;
    text-align: center;
    color: #8696a0;
}

.settings-placeholder i {
    font-size: 3rem;
    margin-bottom: 1rem;
    color: #2a3942;
}

.settings-placeholder p {
    font-size: 1.1rem;
}

#backToChatsBtn {
    display: none;
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        width: 100%;
    }
    
    /* Mobile behavior: show chat list, then chat view (like WhatsApp) */
    .chat-area {
        display: none;
    }
    .main-app.chat-open .chat-area {
        display: flex;
    }
    .main-app.chat-open .sidebar {
        display: none;
    }

    #backToChatsBtn {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        margin-right: 0.5rem;
    }
    
    .welcome-content img {
        width: 250px;
    }
    
    .welcome-content h2 {
        font-size: 1.5rem;
    }
    
    .qr-content {
        padding: 2rem;
        margin: 1rem;
    }

    .top-nav {
        flex-direction: column;
        height: auto;
        padding: 1rem;
        gap: 1rem;
    }

    .nav-tabs {
        width: 100%;
        justify-content: center;
    }

    .assignment-form {
        flex-direction: column;
    }

    .assignment-form .form-group {
        min-width: auto;
    }

    .login-container {
        padding: 2rem;
        margin: 1rem;
    }
}

/* General Modal Styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(17, 27, 33, 0.85);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    animation: fadeIn 0.2s ease-out;
}

.modal .modal-content {
    background: linear-gradient(145deg, #232d3b 0%, #1f2937 100%);
    border-radius: 20px;
    padding: 32px 36px;
    max-width: 480px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4), 
                0 0 0 1px rgba(255, 255, 255, 0.05);
    position: relative;
    animation: slideIn 0.3s ease-out;
}

.modal .modal-content h3 {
    color: #e9edef;
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 24px;
    text-align: center;
    letter-spacing: -0.02em;
}

.modal .close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    color: #8696a0;
    font-size: 24px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.modal .close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #e9edef;
    transform: rotate(90deg);
}

.modal .form-group {
    margin-bottom: 20px;
}

.modal .form-group label {
    display: block;
    color: #8696a0;
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 8px;
    letter-spacing: 0.01em;
}

.modal .form-group input,
.modal .form-group select {
    width: 100%;
    padding: 14px 16px;
    background: rgba(255, 255, 255, 0.05);
    border: 1.5px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    color: #e9edef;
    font-size: 1rem;
    transition: all 0.2s ease;
    outline: none;
}

.modal .form-group input:focus,
.modal .form-group select:focus {
    background: rgba(255, 255, 255, 0.08);
    border-color: #00a884;
    box-shadow: 0 0 0 3px rgba(0, 168, 132, 0.1);
}

/* Modern WP Account Modal */
#addWpAccountModal.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(17, 27, 33, 0.85);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    animation: fadeIn 0.2s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideIn {
    from {
        transform: translateY(-30px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

#addWpAccountModal .modal-content {
    background: linear-gradient(145deg, #232d3b 0%, #1f2937 100%);
    border-radius: 20px;
    padding: 32px 36px;
    max-width: 480px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4), 
                0 0 0 1px rgba(255, 255, 255, 0.05);
    position: relative;
    animation: slideIn 0.3s ease-out;
}

#addWpAccountModal .modal-content h3 {
    color: #e9edef;
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 24px;
    text-align: center;
    letter-spacing: -0.02em;
}

#addWpAccountModal .close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    color: #8696a0;
    font-size: 24px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

#addWpAccountModal .close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #e9edef;
    transform: rotate(90deg);
}

#addWpAccountModal .form-group {
    margin-bottom: 20px;
}

#addWpAccountModal .form-group label {
    display: block;
    color: #8696a0;
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 8px;
    letter-spacing: 0.01em;
}

#addWpAccountModal .form-group input {
    width: 100%;
    padding: 14px 16px;
    background: rgba(255, 255, 255, 0.05);
    border: 1.5px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    color: #e9edef;
    font-size: 1rem;
    transition: all 0.2s ease;
    outline: none;
}

#addWpAccountModal .form-group input:focus {
    background: rgba(255, 255, 255, 0.08);
    border-color: #00a884;
    box-shadow: 0 0 0 3px rgba(0, 168, 132, 0.1);
}

#addWpAccountModal .form-group input::placeholder {
    color: #5e7077;
}

#addWpAccountModal .add-btn {
    width: 100%;
    padding: 14px 20px;
    background: linear-gradient(135deg, #00a884 0%, #008f72 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 4px 12px rgba(0, 168, 132, 0.25);
}

#addWpAccountModal .add-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 168, 132, 0.35);
    background: linear-gradient(135deg, #00b894 0%, #00a884 100%);
}

#addWpAccountModal .add-btn:active {
    transform: translateY(0);
}

#addWpAccountModal #wpQrSection {
    margin-top: 24px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

#addWpAccountModal #wpQrSection h4 {
    color: #e9edef;
    font-size: 1.1rem;
    margin-bottom: 16px;
    text-align: center;
}

#addWpAccountModal #wpQrLoader {
    text-align: center;
    color: #8696a0;
    padding: 20px;
}

#addWpAccountModal #wpQrLoader i {
    font-size: 2rem;
    color: #00a884;
    margin-bottom: 12px;
    display: block;
}

#addWpAccountModal #wpQrImage {
    display: block;
    margin: 0 auto;
    border-radius: 12px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

/* ==================== CALL MODAL ==================== */
.call-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    backdrop-filter: blur(10px);
}

.call-modal-content {
    background: linear-gradient(135deg, #1f2937 0%, #111827 100%);
    padding: 3rem 2rem;
    border-radius: 24px;
    text-align: center;
    min-width: 320px;
    max-width: 400px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.call-avatar {
    width: 120px;
    height: 120px;
    margin: 0 auto 1.5rem;
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 64px;
    color: white;
}

.call-info h3 {
    color: #e9edef;
    font-size: 1.5rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.call-info p {
    color: #8b949e;
    font-size: 0.95rem;
}

.call-status {
    color: #fbbf24;
    font-size: 1.1rem;
    margin: 1.5rem 0 0.5rem;
    font-weight: 500;
    transition: color 0.3s;
}

.call-status.connected {
    color: #10b981;
}

.call-timer {
    color: #e9edef;
    font-size: 2rem;
    font-weight: 300;
    margin: 0.5rem 0 2rem;
    font-family: 'Courier New', monospace;
}

.call-wave {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    height: 60px;
    margin-bottom: 2rem;
}

.wave-bar {
    width: 4px;
    height: 20px;
    background: #fbbf24;
    border-radius: 4px;
    animation: wave 1.2s ease-in-out infinite;
    transition: background 0.3s;
}

.call-status.connected ~ .call-wave .wave-bar {
    background: #10b981;
    animation: wave-connected 0.8s ease-in-out infinite;
}

.wave-bar:nth-child(1) { animation-delay: 0s; }
.wave-bar:nth-child(2) { animation-delay: 0.1s; }
.wave-bar:nth-child(3) { animation-delay: 0.2s; }
.wave-bar:nth-child(4) { animation-delay: 0.3s; }
.wave-bar:nth-child(5) { animation-delay: 0.4s; }

@keyframes wave {
    0%, 100% { height: 20px; }
    50% { height: 50px; }
}

@keyframes wave-connected {
    0%, 100% { height: 30px; }
    50% { height: 45px; }
}

.call-end-btn {
    background: #dc2626;
    color: white;
    border: none;
    padding: 1rem 2.5rem;
    border-radius: 50px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0 auto;
    transition: all 0.3s;
}

.call-end-btn:hover {
    background: #b91c1c;
    transform: scale(1.05);
}

.call-end-btn i {
    font-size: 1.2rem;
}