:root {
    --primary: #075e54;
    --primary-dark: #054c44;
    --primary-light: #128c7e;
    --accent: #25d366;
    --chat-bg: #efeae2;
    --sent-bubble: #d9fdd3;
    --received-bubble: #ffffff;
    --sidebar-bg: #ffffff;
    --sidebar-hover: #f5f6f6;
    --sidebar-active: #e9edef;
    --header-bg: #f0f2f5;
    --border-color: #e9edef;
    --text-primary: #111b21;
    --text-secondary: #667781;
    --text-light: #8696a0;
    --danger: #dc3545;
    --success: #25d366;
    --warning: #ffc107;
}

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

html, body {
    height: 100%;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--chat-bg);
    color: var(--text-primary);
}

/* Login Page */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
}

.login-card {
    background: white;
    border-radius: 12px;
    padding: 40px;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
}

.login-card h1 {
    color: var(--primary);
    margin-bottom: 8px;
    font-size: 24px;
}

.login-card p {
    color: var(--text-secondary);
    margin-bottom: 24px;
}

.login-card .form-control {
    border-radius: 8px;
    padding: 12px 16px;
    border: 1px solid var(--border-color);
    font-size: 15px;
}

.login-card .form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 0.2rem rgba(7, 94, 84, 0.15);
}

.login-card .btn-primary {
    background-color: var(--primary);
    border-color: var(--primary);
    border-radius: 8px;
    padding: 12px;
    font-size: 16px;
    font-weight: 500;
}

.login-card .btn-primary:hover {
    background-color: var(--primary-dark);
    border-color: var(--primary-dark);
}

/* Main App Layout */
.app-container {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

/* Sidebar */
.sidebar {
    width: 380px;
    min-width: 380px;
    background: var(--sidebar-bg);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    height: 100%;
}

.sidebar-header {
    background: var(--header-bg);
    padding: 12px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border-color);
    min-height: 60px;
}

.sidebar-header h5 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: var(--primary);
}

.sidebar-header .header-actions {
    display: flex;
    gap: 8px;
}

.sidebar-header .btn-icon {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 18px;
    padding: 8px;
    border-radius: 50%;
    cursor: pointer;
    transition: background 0.2s;
}

.sidebar-header .btn-icon:hover {
    background: rgba(0,0,0,0.05);
}

/* Sidebar Search */
.sidebar-search {
    padding: 8px 12px;
    background: var(--sidebar-bg);
    border-bottom: 1px solid var(--border-color);
}

.sidebar-search .form-control {
    border-radius: 8px;
    padding: 8px 14px;
    font-size: 14px;
    background: var(--header-bg);
    border: 1px solid var(--border-color);
}

.sidebar-search .form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 0.15rem rgba(7, 94, 84, 0.12);
    background: white;
}

.sidebar-search-results {
    flex: 1;
    overflow-y: auto;
    background: white;
}

.search-result-item {
    display: flex;
    align-items: center;
    padding: 10px 14px;
    gap: 10px;
    cursor: pointer;
    border-bottom: 1px solid var(--border-color);
    transition: background 0.15s;
}

.search-result-item:hover {
    background: var(--sidebar-hover);
}

.search-result-item:last-child {
    border-bottom: none;
}

.search-result-info {
    flex: 1;
    min-width: 0;
}

.search-result-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.search-result-detail {
    font-size: 12px;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Conversation List */
.conversation-list {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
}

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

.conversation-item:hover {
    background: var(--sidebar-hover);
}

.conversation-item.active {
    background: var(--sidebar-active);
}

.conversation-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--primary-light);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 20px;
    font-weight: 600;
    flex-shrink: 0;
}

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

.conversation-info-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2px;
}

.conversation-name {
    font-size: 16px;
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.conversation-time {
    font-size: 12px;
    color: var(--text-light);
    white-space: nowrap;
    margin-left: 8px;
}

.conversation-item.unread .conversation-time {
    color: var(--accent);
}

.conv-brand-tag {
    font-size: 10px;
    font-weight: 600;
    background: #fff3e0;
    color: #e65100;
    padding: 1px 5px;
    border-radius: 3px;
    vertical-align: middle;
    letter-spacing: 0.2px;
    white-space: nowrap;
}

.conversation-preview {
    font-size: 14px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.conversation-preview > span:first-child {
    flex: 1;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.conversation-item.unread .conversation-name {
    font-weight: 700;
}

.conversation-item.unread .conversation-preview {
    color: var(--text-primary);
    font-weight: 500;
}

.unread-badge {
    background: var(--accent);
    color: white;
    border-radius: 50%;
    min-width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    padding: 0 5px;
    flex-shrink: 0;
    margin-left: 8px;
}

/* Chat Area */
.chat-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: var(--chat-bg);
    height: 100%;
}

.chat-header {
    background: var(--header-bg);
    padding: 12px 16px;
    display: flex;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    min-height: 60px;
    gap: 12px;
}

.chat-header .conversation-avatar {
    width: 40px;
    height: 40px;
    font-size: 16px;
}

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

.chat-header-name {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    cursor: pointer;
    overflow-wrap: break-word;
    word-break: break-word;
}

.chat-header-name:hover {
    text-decoration: none;
    opacity: 0.8;
}

.chat-header-phone {
    font-size: 13px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    overflow-wrap: break-word;
    word-break: break-word;
}

.btn-copy {
    background: none;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    padding: 1px 5px;
    color: var(--text-secondary);
    transition: background 0.15s, color 0.15s, border-color 0.15s;
    vertical-align: middle;
    line-height: 1.2;
    margin-left: 4px;
}

.btn-copy:hover {
    background: rgba(7, 94, 84, 0.08);
    color: var(--primary);
    border-color: var(--primary-light);
}

.btn-copy.copied {
    color: var(--success);
    border-color: var(--success);
}

.chat-header-note {
    font-size: 12px;
    color: var(--text-light);
    font-style: italic;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 400px;
    display: block;
}

.chat-header-sender {
    font-size: 11px;
    color: var(--text-secondary);
    margin-left: 6px;
    opacity: 0.7;
}

.chat-header-actions {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-left: auto;
    flex-shrink: 0;
}

.chat-header-actions .btn-icon {
    color: var(--text-secondary);
    padding: 4px 6px;
    border: none;
    background: none;
    cursor: pointer;
    border-radius: 4px;
}

.chat-header-actions .btn-icon:hover {
    background: var(--hover-bg);
    color: var(--text-primary);
}

.archived-link {
    padding: 10px 16px;
    font-size: 13px;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    border-top: 1px solid var(--border-color);
    flex-shrink: 0;
}

.archived-link:hover {
    background: var(--hover-bg);
    color: var(--text-primary);
}

.archived-header {
    padding: 12px 16px;
    font-size: 14px;
    font-weight: 600;
    color: var(--primary);
    cursor: pointer;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 8px;
}

.archived-header:hover {
    background: var(--hover-bg);
}

.chat-header-email {
    font-size: 12px;
    color: var(--text-secondary);
    overflow-wrap: break-word;
    word-break: break-all;
    max-width: 250px;
    display: inline-block;
    vertical-align: middle;
    line-height: 1.2;
}

.contact-badge {
    display: inline-block;
    font-size: 10px;
    font-weight: 600;
    padding: 1px 6px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.badge-line-type {
    background: #e3f2fd;
    color: #1565c0;
}

.badge-carrier {
    background: #f3e5f5;
    color: #7b1fa2;
    text-transform: none;
}

.badge-caller-type {
    background: #e8f5e9;
    color: #2e7d32;
}

.badge-brand {
    background: #fff3e0;
    color: #e65100;
    font-weight: 700;
}

/* Chat Messages */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px 60px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    background: var(--chat-bg);
    background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23c8c8c8' fill-opacity='0.08'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

.message-date-divider {
    text-align: center;
    margin: 16px 0;
}

.message-date-divider span {
    background: #e1f2fb;
    color: var(--text-secondary);
    padding: 5px 12px;
    border-radius: 8px;
    font-size: 12px;
    box-shadow: 0 1px 1px rgba(0,0,0,0.05);
}

.message-sent-by {
    font-size: 11px;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 2px;
}

.message-bubble {
    max-width: 65%;
    padding: 6px 12px 8px;
    border-radius: 8px;
    position: relative;
    word-wrap: break-word;
    box-shadow: 0 1px 1px rgba(0,0,0,0.08);
}

.message-bubble.sent {
    background: var(--sent-bubble);
    align-self: flex-end;
    border-top-right-radius: 0;
}

.message-bubble.received {
    background: var(--received-bubble);
    align-self: flex-start;
    border-top-left-radius: 0;
}

.message-body {
    font-size: 14.2px;
    line-height: 1.4;
    color: var(--text-primary);
    padding-right: 60px;
    white-space: pre-wrap;
}

.message-meta {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 4px;
    margin-top: -14px;
    float: right;
    position: relative;
    top: 8px;
}

.message-time {
    font-size: 11px;
    color: var(--text-light);
}

.message-status {
    font-size: 14px;
    color: var(--text-light);
    letter-spacing: -3px;
}

.message-status.delivered {
    color: #53bdeb;
}

.message-status.failed {
    color: var(--danger);
}

.message-error {
    font-size: 12px;
    color: var(--danger);
    margin-top: 4px;
}

.message-retry {
    font-size: 12px;
    color: var(--primary);
    cursor: pointer;
    text-decoration: underline;
    margin-left: 8px;
}

.message-attachments {
    margin-top: 4px;
}

.message-attachment-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    background: rgba(0,0,0,0.04);
    border-radius: 4px;
    font-size: 13px;
    color: var(--primary);
    text-decoration: none;
    margin: 2px 0;
}

.message-attachment-link:hover {
    background: rgba(0,0,0,0.08);
}

.attachment-image {
    display: block;
    max-width: 280px;
    max-height: 280px;
    border-radius: 6px;
    cursor: pointer;
    margin-bottom: 4px;
}

/* Load More */
.load-more-container {
    text-align: center;
    padding: 16px;
    display: flex;
    justify-content: center;
}

/* Media Preview */
.media-preview {
    background: var(--header-bg);
    padding: 8px 16px;
    display: flex;
    gap: 8px;
    overflow-x: auto;
    border-top: 1px solid var(--border-color);
}

.media-preview-item {
    position: relative;
    flex-shrink: 0;
}

.media-preview-item img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.media-preview-item.file {
    display: flex;
    align-items: center;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 8px 28px 8px 10px;
    height: 80px;
}

.media-preview-filename {
    font-size: 13px;
    color: var(--text-primary);
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.media-preview-remove {
    position: absolute;
    top: -6px;
    right: -6px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--danger);
    color: white;
    border: 2px solid var(--header-bg);
    font-size: 14px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

/* Quick Text Popover */
.quick-text-wrapper {
    position: relative;
    flex-shrink: 0;
}

.quick-text-popover {
    position: absolute;
    bottom: 50px;
    left: -40px;
    width: 300px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.18);
    display: flex;
    flex-direction: column;
    z-index: 100;
    overflow: hidden;
}

.qt-popover-header {
    padding: 10px;
    border-bottom: 1px solid var(--border-color);
}

.qt-popover-header .form-control {
    border-radius: 8px;
    font-size: 13px;
}

.qt-popover-list {
    max-height: 260px;
    overflow-y: auto;
}

.qt-popover-item {
    padding: 10px 14px;
    cursor: pointer;
    border-bottom: 1px solid var(--border-color);
    transition: background 0.15s;
}

.qt-popover-item:last-child {
    border-bottom: none;
}

.qt-popover-item:hover {
    background: var(--sidebar-hover);
}

.qt-item-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.qt-item-preview {
    font-size: 13px;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.qt-popover-footer {
    padding: 6px 10px;
    border-top: 1px solid var(--border-color);
    text-align: center;
}

.qt-popover-footer .btn-link {
    color: var(--primary);
    text-decoration: none;
    font-size: 13px;
}

.qt-empty {
    padding: 20px;
    text-align: center;
    color: var(--text-light);
    font-size: 13px;
}

/* Manage Templates Modal */
.qt-add-form h6 {
    font-size: 14px;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 8px;
}

.qt-manage-item {
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
}

.qt-manage-item:last-child {
    border-bottom: none;
}

.qt-manage-display {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.qt-manage-info {
    flex: 1;
    min-width: 0;
}

.qt-manage-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.qt-manage-body {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.4;
}

.qt-manage-actions {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}

.qt-manage-edit {
    padding: 4px 0;
}

/* Chat Composer */
.chat-composer {
    background: var(--header-bg);
    padding: 10px 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    border-top: 1px solid var(--border-color);
}

.chat-composer .btn-attach {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.2s;
}

.chat-composer .btn-attach:hover {
    background: rgba(0,0,0,0.05);
}

.chat-composer .form-control {
    border-radius: 20px;
    padding: 10px 16px;
    border: 1px solid var(--border-color);
    font-size: 15px;
    resize: none;
    max-height: 120px;
    background: white;
}

.chat-composer .form-control:focus {
    border-color: var(--border-color);
    box-shadow: none;
}

.chat-composer .btn-send {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--primary);
    border: none;
    color: white;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.2s;
}

.chat-composer .btn-send:hover {
    background: var(--primary-dark);
}

.chat-composer .btn-send:disabled {
    background: var(--text-light);
    cursor: not-allowed;
}

/* Empty State */
.empty-state {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    text-align: center;
    padding: 40px;
}

.empty-state-icon {
    font-size: 80px;
    margin-bottom: 16px;
    opacity: 0.3;
}

.empty-state h3 {
    font-size: 24px;
    font-weight: 300;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.empty-state p {
    font-size: 14px;
    max-width: 400px;
}

/* New Message Modal */
.new-message-form .form-control {
    border-radius: 8px;
}

/* Settings Page */
.settings-container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 20px;
}

.settings-columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    align-items: start;
}

@media (max-width: 900px) {
    .settings-columns {
        grid-template-columns: 1fr;
    }
}

.settings-card {
    background: white;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.settings-card h5 {
    color: var(--primary);
    margin-bottom: 16px;
    font-size: 16px;
    font-weight: 600;
}

.number-item {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-color);
    gap: 8px;
}

.number-item:last-child {
    border-bottom: none;
}

.number-info {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
}

.number-phone {
    font-weight: 600;
    font-size: 14px;
}

.number-friendly {
    font-size: 12px;
    color: var(--text-secondary);
}

.number-top-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.brand-label {
    font-size: 12px;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 1px 6px;
    border-radius: 4px;
    border: 1px dashed transparent;
    transition: all 0.15s;
}

.brand-label:hover {
    border-color: var(--primary-light);
    background: rgba(7, 94, 84, 0.04);
    color: var(--primary);
}

.brand-placeholder {
    color: var(--text-light);
    font-style: italic;
}

.brand-inline-edit {
    display: flex;
    align-items: center;
    gap: 2px;
}

.brand-inline-input {
    width: 130px;
    font-size: 12px !important;
    padding: 2px 8px !important;
    height: 26px !important;
    border-radius: 4px !important;
}

.brand-inline-save,
.brand-inline-cancel {
    padding: 0 4px !important;
    font-size: 14px;
    line-height: 1;
    text-decoration: none !important;
}

.brand-inline-save {
    color: var(--success) !important;
}

.brand-inline-cancel {
    color: var(--text-light) !important;
}

.number-badges {
    display: flex;
    gap: 3px;
    margin-top: 4px;
    flex-wrap: wrap;
}

.number-actions {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
    flex-direction: column;
    align-items: flex-end;
}

/* Connection Status */
.ws-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--text-light);
}

.ws-status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--text-light);
}

.ws-status-dot.connected {
    background: var(--accent);
}

.ws-status-dot.connecting {
    background: var(--warning);
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

/* Toast notifications */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
}

.toast-notification {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border-radius: 8px;
    background: #323232;
    color: #fff;
    font-size: 14px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.25);
    pointer-events: auto;
    opacity: 0;
    transform: translateX(40px);
    transition: opacity 0.3s, transform 0.3s;
    max-width: 380px;
}

.toast-notification.show {
    opacity: 1;
    transform: translateX(0);
}

.toast-success { background: #2e7d32; }
.toast-error { background: #c62828; }
.toast-info { background: #1565c0; }

.toast-icon {
    font-size: 16px;
    flex-shrink: 0;
}

.toast-message {
    flex: 1;
    line-height: 1.3;
}

.toast-close {
    background: none;
    border: none;
    color: rgba(255,255,255,0.7);
    font-size: 20px;
    cursor: pointer;
    padding: 0 0 0 8px;
    line-height: 1;
    flex-shrink: 0;
}

.toast-close:hover {
    color: #fff;
}

/* Settings nav */
.settings-nav {
    background: var(--primary);
    padding: 12px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.settings-nav a {
    color: white;
    text-decoration: none;
    font-weight: 500;
}

.settings-nav h5 {
    color: white;
    margin: 0;
}

/* User Management */
.user-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-color);
    gap: 12px;
}

.user-item:last-child {
    border-bottom: none;
}

.user-item-info {
    flex: 1;
    min-width: 0;
}

.user-item-name {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.user-item-email {
    font-size: 13px;
    color: var(--text-secondary);
}

.user-item-actions {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}

.user-edit-row {
    flex-direction: column;
    align-items: stretch;
    background: var(--sidebar-hover);
    padding: 12px;
    border-radius: 8px;
    margin: 4px 0;
}

/* Scrollbar styling */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-thumb {
    background: rgba(0,0,0,0.2);
    border-radius: 3px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .sidebar {
        width: 100%;
        min-width: 100%;
        display: flex;
    }

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

    .app-container.chat-open .sidebar {
        display: none;
    }

    .app-container.chat-open .chat-area {
        display: flex;
    }

    .chat-messages {
        padding: 12px 16px;
    }

    .message-bubble {
        max-width: 85%;
    }

    .chat-header .back-btn {
        display: inline-flex;
    }
}

@media (min-width: 769px) {
    .chat-header .back-btn {
        display: none;
    }
}

