.x-selectable,
.x-selectable * {
    user-select: text !important;
}

.x-grid-dirty-cell,
.x-grid3-dirty-cell {
    background-image: none;
}

td.chat-message-cell,
.chat-message-cell {
    overflow: visible;
}

td.chat-message-cell .x-grid-cell-inner,
.chat-message-cell .x-grid-cell-inner {
    white-space: normal !important;
    line-height: 1.35;
    overflow-wrap: anywhere;
    word-break: break-word;
    padding-top: 2px;
    padding-bottom: 2px;
}

td.chat-message-cell .chat-message-row,
td.chat-message-cell .chat-message-header,
td.chat-message-cell .chat-message-body,
td.chat-message-cell .chat-message-body p,
td.chat-message-cell .chat-message-body span,
td.chat-message-cell .chat-message-body a,
.chat-message-cell .chat-message-row,
.chat-message-cell .chat-message-header,
.chat-message-cell .chat-message-body,
.chat-message-cell .chat-message-body p,
.chat-message-cell .chat-message-body span,
.chat-message-cell .chat-message-body a {
    white-space: normal !important;
    overflow-wrap: anywhere;
    word-break: break-word;
}

td.chat-message-cell .chat-message-row,
.chat-message-cell .chat-message-row {
    margin: 2px 0;
}

td.chat-message-cell .chat-message-header,
.chat-message-cell .chat-message-header {
    display: block;
    margin-bottom: 1px;
    font-weight: 600;
}

td.chat-message-cell .chat-message-ts,
.chat-message-cell .chat-message-ts {
    opacity: 0.78;
    font-weight: 500;
    margin-right: 6px;
}

td.chat-message-cell .chat-message-room,
.chat-message-cell .chat-message-room {
    opacity: 0.9;
    margin-right: 6px;
}

td.chat-message-cell .chat-message-sep,
.chat-message-cell .chat-message-sep {
    opacity: 0.55;
    margin-right: 6px;
}

td.chat-message-cell .chat-message-author,
.chat-message-cell .chat-message-author {
    font-weight: 700;
}

td.chat-message-cell .chat-message-delivery,
.chat-message-cell .chat-message-delivery {
    margin-left: 2px;
    font-size: 0.85em;
    opacity: 0.8;
}

td.chat-message-cell .chat-message-own .chat-message-header,
.chat-message-cell .chat-message-own .chat-message-header {
    font-weight: 700;
}

td.chat-message-cell .chat-message-header,
.chat-message-cell .chat-message-header {
    display: block;
    margin-bottom: 1px;
    font-weight: 600;
}

td.chat-message-cell .chat-message-ts,
.chat-message-cell .chat-message-ts {
    opacity: 0.78;
    font-weight: 500;
    margin-right: 6px;
}

td.chat-message-cell .chat-message-room,
.chat-message-cell .chat-message-room {
    opacity: 0.9;
    margin-right: 6px;
}

td.chat-message-cell .chat-message-sep,
.chat-message-cell .chat-message-sep {
    opacity: 0.55;
    margin-right: 6px;
}

td.chat-message-cell .chat-message-author,
.chat-message-cell .chat-message-author {
    font-weight: 700;
}

td.chat-message-cell .chat-message-delivery,
.chat-message-cell .chat-message-delivery {
    margin-left: 2px;
    font-size: 0.85em;
    opacity: 0.8;
}

td.chat-message-cell .chat-map-zoom-btn,
.chat-message-cell .chat-map-zoom-btn {
    margin-left: 6px;
    border: 1px solid #9fb3c8;
    border-radius: 10px;
    background: #eef5ff;
    color: #1e4d7a;
    font-size: 11px;
    line-height: 1;
    padding: 2px 8px;
    cursor: pointer;
}

td.chat-message-cell .chat-map-zoom-btn:hover,
.chat-message-cell .chat-map-zoom-btn:hover {
    background: #dbe9ff;
}

td.chat-message-cell .chat-message-delivery-failed,
.chat-message-cell .chat-message-delivery-failed {
    color: #cc0000;
}

td.chat-message-cell .chat-message-body,
.chat-message-cell .chat-message-body {
    margin-left: 2px;
}

td.chat-message-cell .chat-message-body p,
.chat-message-cell .chat-message-body p {
    margin: 0;
}

.chat-grid-panel {
    position: relative;
}

.chat-jump-latest-badge {
    position: absolute;
    right: 18px;
    bottom: 18px;
    z-index: 40;
    border: 1px solid #0f5ea8;
    border-radius: 18px;
    background: linear-gradient(180deg, #2f89dc 0%, #1565b7 100%);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    line-height: 1;
    padding: 10px 14px;
    cursor: pointer;
    box-shadow: 0 8px 20px rgba(8, 46, 86, 0.25);
}

.chat-jump-latest-badge:hover {
    background: linear-gradient(180deg, #4598e4 0%, #1d71c4 100%);
}

.bigger-font {
    font-size: 30px !important;
}

.buddy-online {
    background-image: var(--icon-available) !important;
}

.buddy-offline {
    background-image: var(--icon-person) !important;
}

.buddy-away {
    background-image: var(--icon-away) !important;
}

.chatroom-icon {
    background-image: var(--icon-chat) !important;
}

.muc-owner {
    background-image: var(--icon-owner) !important;
}

.muc-admin {
    background-image: var(--icon-admin) !important;
}

.muc-participant {
    background-image: var(--icon-participant) !important;
}

.x-tree-icon.muc-owner,
.x-tree-node-icon.muc-owner,
.muc-owner-node .x-tree-icon,
.muc-owner-node .x-tree-node-icon {
    background-image: var(--icon-owner) !important;
    background-repeat: no-repeat !important;
    background-position: center center !important;
    background-size: contain !important;
}

.x-tree-icon.muc-admin,
.x-tree-node-icon.muc-admin,
.muc-admin-node .x-tree-icon,
.muc-admin-node .x-tree-node-icon {
    background-image: var(--icon-admin) !important;
    background-repeat: no-repeat !important;
    background-position: center center !important;
    background-size: contain !important;
}

.x-tree-icon.muc-participant,
.x-tree-node-icon.muc-participant,
.muc-participant-node .x-tree-icon,
.muc-participant-node .x-tree-node-icon {
    background-image: var(--icon-participant) !important;
    background-repeat: no-repeat !important;
    background-position: center center !important;
    background-size: contain !important;
}

.new-tab {
    background-image: var(--icon-new-tab) !important;
}

.typing-tab {
    background-image: var(--icon-typing) !important;
    color: #FF0000 !important;
}

.paused-tab {
    color: #A99C0D !important;
}

.author-me {
    font-weight: bold;
}

.author-chatpartner {
    font-weight: bold;
}

.author-nws {
    font-weight: bold;
}

.author-default {
    font-weight: bold;
}

/* Login Panel Styles */
.login-panel-wrapper .x-panel-body {
    background: #eef2f6;
}

.login-shell {
    min-height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
}

.login-panel {
    width: 100%;
    max-width: 500px;
    margin: 0;
    padding: 20px;
    border-radius: 10px;
    background: #ffffff;
    border: 1px solid #d8dee6;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
    box-sizing: border-box;
}

.login-header {
    text-align: center;
    margin-bottom: 20px;
}

.login-status {
    margin: 0 0 14px 0;
    padding: 10px 12px;
    border: 1px solid #d8a700;
    background: #fff8db;
    color: #6b5500;
    border-radius: 6px;
    font-size: 14px;
}

.login-header img {
    display: block;
    margin: 0 auto 10px;
}

.login-header h2 {
    margin: 0;
    color: #333;
    font-size: 26px;
    font-weight: 500;
}

.login-section {
    background: #f7f9fc;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 16px;
    margin-bottom: 14px;
}

.login-section.primary-section {
    background: #fff;
    border: 2px solid #0066cc;
}

.login-section h3 {
    margin: 0 0 15px 0;
    color: #333;
    font-size: 18px;
    font-weight: 500;
}

.welcome-text {
    margin: 6px 0 0 0;
    color: #666;
    font-size: 14px;
}

.login-copy {
    margin: 0 0 14px 0;
    color: #666;
    font-size: 14px;
    line-height: 1.45;
}

.login-form {
    margin: 0;
}

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

.form-group label {
    display: block;
    margin-bottom: 5px;
    color: #333;
    font-weight: 500;
    font-size: 14px;
}

.form-control {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 14px;
    box-sizing: border-box;
}

.form-control:focus {
    outline: none;
    border-color: #0066cc;
    box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.1);
}

.form-actions {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.btn {
    padding: 10px 16px;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    text-align: center;
    transition: background-color 0.2s;
}

.btn-primary {
    background: #0066cc;
    color: white;
    flex: 1;
}

.btn-primary:hover {
    background: #0052a3;
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
}

.btn-block {
    display: block;
    width: 100%;
    box-sizing: border-box;
}

.form-footer {
    text-align: center;
}

.form-footer a {
    color: #0066cc;
    font-size: 14px;
    text-decoration: none;
}

.form-footer a:hover {
    text-decoration: underline;
}

.login-section p {
    margin: 0 0 15px 0;
    color: #666;
    font-size: 14px;
    line-height: 1.5;
}

.login-section p:last-child {
    margin-bottom: 0;
}
