/* Messaging - Figma aligned screen */
:root {
    --messaging-blue: #0ea5e9;
    --messaging-top-start: #5395bb;
    --messaging-top-end: #0b2535;
    --messaging-surface: #ffffff;
    --messaging-panel: #f9fafb;
    --messaging-chat-bg: #f9fafb;
    --messaging-chat-header: #f1f5f9;
    --messaging-border: #cbd5e1;
    --messaging-border-light: #e5e7eb;
    --messaging-text: #374151;
    --messaging-muted: #6b7280;
    --messaging-soft-muted: #94a3b8;
    --messaging-slate: #475569;
    --messaging-shadow: 0 3.879px 7.758px -2px rgba(23, 23, 23, 0.1), 0 1.939px 3.879px -2px rgba(23, 23, 23, 0.06);
}

.content-wrapper:has(.messaging-page-wrapper) {
    margin-left: 56px !important;
}

.content-wrapper.sidebar-expanded:has(.messaging-page-wrapper) {
    margin-left: 240px !important;
}

.main-container:has(.messaging-page-wrapper) .top-header {
    display: none !important;
}

.main-container:has(.messaging-page-wrapper) .main-content {
    padding: 0 !important;
    margin: 0 !important;
    background: var(--messaging-panel);
    overflow: hidden !important;
}

.messaging-page-wrapper {
    display: grid;
    grid-template-rows: 65px minmax(0, 1fr);
    width: 100%;
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
    background: var(--messaging-panel);
}

.messaging-top-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-width: 0;
    padding: 0 24px;
    color: #ffffff;
    background: linear-gradient(90deg, var(--messaging-top-start) 0%, #3e789f 45%, var(--messaging-top-end) 100%);
}

.top-bar-left {
    display: flex;
    align-items: center;
    min-width: 0;
    gap: 0;
}

.top-bar-left > :not(.top-bar-title):not(.messaging-mobile-menu-btn):not(.top-bar-divider) {
    display: none !important;
}

.messaging-mobile-menu-btn,
.top-bar-divider {
    display: none;
}

.messaging-mobile-menu-btn {
    width: 24px;
    height: 24px;
    padding: 0;
    border: 0;
    background: transparent;
    color: #ffffff;
    cursor: pointer;
    place-items: center;
}

.messaging-mobile-menu-icon {
    position: relative;
    width: 18px;
    height: 18px;
    border: 1.6px solid currentColor;
    border-radius: 4px;
}

.messaging-mobile-menu-icon::before {
    content: "";
    position: absolute;
    top: 1px;
    bottom: 1px;
    left: 6px;
    width: 1.6px;
    background: currentColor;
    border-radius: 99px;
}

.notification-bell-blue,
.filter-btn-blue,
.contact-card,
.action-icon-circle,
.btn-attach,
.btn-mic,
.btn-send-chat,
.btn-exibir-perfil {
    font: inherit;
}

.top-bar-title {
    font-family: 'Work Sans', sans-serif;
    font-size: 20px;
    font-weight: 600;
    line-height: 28px;
    letter-spacing: 0;
}

.notification-bell-blue {
    width: 38px;
    height: 38px;
    border: 0;
    border-radius: 999px;
    color: #ffffff;
    background: var(--messaging-blue);
    display: inline-grid;
    place-items: center;
    position: relative;
    cursor: pointer;
}

.notification-bell-blue i {
    font-size: 18px;
}

.bell-dot {
    position: absolute;
    right: 5px;
    bottom: 5px;
    width: 5px;
    height: 5px;
    border-radius: 999px;
    background: #ef4444;
}

.bell-count {
    position: absolute;
    top: -6px;
    right: -6px;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    border: 1.5px solid #ffffff;
    border-radius: 999px;
    color: #ffffff;
    background: #ef4444;
    font-size: 10px;
    font-weight: 700;
    line-height: 14px;
    text-align: center;
}

.messaging-container {
    display: grid;
    grid-template-columns: 364px minmax(0, 1fr);
    min-height: 0;
    overflow: hidden;
    background: var(--messaging-panel);
}

.messaging-sidebar {
    min-width: 0;
    min-height: 0;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    border-right: 1px solid var(--messaging-border);
    background: var(--messaging-panel);
}

.messaging-sidebar-header {
    padding: 17.4px 20.4px 12.9px 17.6px;
}

.messaging-page-wrapper:has(.search-results-panel) .messaging-sidebar-header {
    padding-bottom: 0;
}

.messaging-sidebar-title {
    display: flex;
    align-items: center;
    gap: 7px;
    margin: 0 0 12.9px;
    color: var(--messaging-text);
    font-family: 'Work Sans', sans-serif;
    font-size: 24px;
    font-weight: 500;
    line-height: 30.017px;
    letter-spacing: -0.288px;
}

.messaging-sidebar-title i {
    font-size: 24px;
    color: #111827;
}

.messaging-sidebar-desc {
    margin: 0 0 12.9px;
    color: var(--messaging-muted);
    font-family: 'Work Sans', sans-serif;
    font-size: 14px;
    font-weight: 400;
    line-height: 21.168px;
    letter-spacing: 0;
}

.search-section {
    display: grid;
    gap: 12.9px;
}

.search-field-label {
    color: var(--messaging-muted);
    font-family: 'Work Sans', sans-serif;
    font-size: 12px;
    font-weight: 500;
    line-height: 28.862px;
    letter-spacing: -0.144px;
}

.search-field-group {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 8px;
    min-height: 33px;
    padding: 5px 5px 5px 10px;
    border: 1.176px solid var(--messaging-border-light);
    border-radius: 10px;
    background: #ffffff;
}

.search-field-input {
    min-width: 0;
    border: 0;
    outline: 0;
    color: var(--messaging-text);
    background: transparent;
    font-family: 'Work Sans', sans-serif;
    font-size: 10px;
    line-height: 18px;
}

.search-field-input::placeholder {
    color: var(--messaging-text);
    opacity: 1;
}

.search-field-icons {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--messaging-muted);
}

.search-field-icons > i {
    font-size: 12px;
}

.filter-btn-blue {
    width: 20px;
    height: 20px;
    border: 0;
    border-radius: 5px;
    color: #ffffff;
    background: var(--messaging-blue);
    display: inline-grid;
    place-items: center;
    cursor: pointer;
}

.filter-btn-blue i {
    font-size: 10px;
}

.tabs-container {
    display: grid;
    grid-template-columns: 88.819px 89.806px 105.596px;
    gap: 6.9px;
    width: max-content;
    margin: 0 0 10px 13px;
}

.tab-btn {
    width: 100%;
    min-width: 0;
    min-height: 23.814px;
    padding: 4.104px 8.207px;
    border: 0;
    border-radius: 10.767px;
    color: rgba(27, 26, 87, 0.5);
    background: #ffffff;
    box-shadow: 0 4.104px 32.83px rgba(70, 96, 135, 0.1);
    font-family: 'Work Sans', sans-serif;
    font-size: 10.333px;
    font-weight: 500;
    line-height: 18.467px;
    letter-spacing: 0;
    cursor: pointer;
}

.tab-btn.active {
    color: #ffffff;
    background: var(--messaging-blue);
}

.contacts-scroll-area {
    min-height: 0;
    overflow-y: auto;
    padding: 0 20.4px 12px 17.6px;
}

.contacts-scroll-area::-webkit-scrollbar {
    width: 6px;
}

.contacts-scroll-area::-webkit-scrollbar-thumb {
    border-radius: 999px;
    background: rgba(148, 163, 184, 0.45);
}

.status-msg,
.loading-messages {
    padding: 18px 8px;
    color: var(--messaging-muted);
    font-family: 'Work Sans', sans-serif;
    font-size: 12px;
    text-align: center;
}

.search-results-panel {
    margin-bottom: 12px;
    padding: 16px 0 8px;
    border: 1.176px solid var(--messaging-border-light);
    border-radius: 9px;
    background: #fdfdfd;
}

.search-results-panel .tabs-container {
    margin: 0 0 18px 13px;
}

.list-section-title {
    margin: 12px 0 6px;
    color: var(--messaging-muted);
    font-family: 'Work Sans', sans-serif;
    font-size: 10px;
    font-weight: 600;
    line-height: 14px;
    letter-spacing: 0;
    text-transform: uppercase;
}

.contact-card {
    width: 100%;
    min-width: 0;
    min-height: 54px;
    display: grid;
    grid-template-columns: 48px minmax(0, 1fr);
    align-items: center;
    gap: 10px;
    padding: 7px 0;
    border: 0;
    border-bottom: 1px solid rgba(229, 231, 235, 0.72);
    color: inherit;
    background: transparent;
    text-align: left;
    cursor: pointer;
}

.contact-card:hover,
.contact-card.active {
    background: rgba(14, 165, 233, 0.06);
}

.contact-card.search-card {
    grid-template-columns: 48px minmax(0, 1fr) auto;
    min-height: 56px;
    padding: 6px 7px 6px 12px;
    border-bottom: 0;
}

.avatar-container {
    position: relative;
    display: block;
    width: 47px;
    height: 47px;
    flex-shrink: 0;
}

.avatar-img,
.contact-avatar,
.first-contact-avatar-large img {
    width: 100%;
    height: 100%;
    border-radius: 999px;
    object-fit: cover;
    display: block;
}

.status-dot {
    position: absolute;
    right: 0;
    bottom: 1px;
    width: 10px;
    height: 10px;
    border: 2px solid #ffffff;
    border-radius: 999px;
    background: #94a3b8;
}

.status-dot.online {
    background: #22c55e;
}

.contact-details {
    min-width: 0;
    display: grid;
    gap: 1px;
}

.name-row,
.id-row,
.msg-row {
    min-width: 0;
    display: flex;
    align-items: center;
}

.name-row {
    justify-content: space-between;
    gap: 6px;
}

.contact-display-name {
    min-width: 0;
    overflow: hidden;
    color: #3e3e3e;
    font-family: 'Work Sans', sans-serif;
    font-size: 12px;
    font-weight: 600;
    line-height: 16px;
    letter-spacing: 0;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.verified-icon {
    flex-shrink: 0;
    position: relative;
    display: inline-grid;
    place-items: center;
    width: 16px;
    height: 16px;
    margin-left: 4px;
    color: #64748b;
    vertical-align: middle;
}

.verified-icon::before,
.verified-icon::after {
    font-family: "Font Awesome 5 Free";
    font-weight: 900;
    line-height: 1;
}

.verified-icon::before {
    content: "\f0a3";
    color: #64748b;
    font-size: 16px;
}

.verified-icon::after {
    content: "\f00c";
    position: absolute;
    color: #ffffff;
    font-size: 7px;
}

.msg-timestamp,
.contact-id-text,
.contact-preview-text {
    min-width: 0;
    overflow: hidden;
    color: var(--messaging-muted);
    font-family: 'Manrope', sans-serif;
    font-size: 10px;
    line-height: 15px;
    letter-spacing: 0;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.msg-timestamp {
    flex-shrink: 0;
    opacity: 0.72;
}

.contact-id-text {
    font-size: 8px;
    opacity: 0.7;
}

.contact-preview-text {
    opacity: 0.9;
}

.unread-count-dot {
    min-width: 16px;
    height: 16px;
    margin-right: 5px;
    padding: 0 4px;
    border-radius: 999px;
    color: #ffffff;
    background: #22c55e;
    font-size: 10px;
    font-weight: 700;
    line-height: 16px;
    text-align: center;
}

.action-btn-send {
    min-width: 76px;
    padding: 3px 8px;
    border: 0.369px solid var(--messaging-blue);
    border-radius: 5px;
    color: var(--messaging-text);
    background: #ffffff;
    font-family: 'Work Sans', sans-serif;
    font-size: 8px;
    font-weight: 500;
    line-height: 12px;
    letter-spacing: 0;
    text-align: center;
    white-space: nowrap;
}

.chat-content {
    min-width: 0;
    min-height: 0;
    display: flex;
    flex-direction: column;
    background: var(--messaging-chat-bg);
}

.empty-state {
    min-height: 0;
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding: 92.5px 24px 40px;
    color: var(--messaging-muted);
    text-align: center;
}

.empty-state-illustration {
    width: 375px;
    max-width: 76%;
    height: auto;
    margin-bottom: 26px;
}

.empty-state-title {
    margin: 0 0 18px;
    color: var(--messaging-text);
    font-family: 'Work Sans', sans-serif;
    font-size: 36px;
    font-weight: 600;
    line-height: 32.156px;
    letter-spacing: -0.432px;
}

.empty-state-text {
    max-width: none;
    margin: 0;
    font-family: 'Work Sans', sans-serif;
    font-size: 18px;
    line-height: 28.977px;
    letter-spacing: -0.216px;
    white-space: nowrap;
}

.empty-state-footer {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 180px;
    color: var(--messaging-muted);
    font-size: 18px;
    line-height: 28.977px;
    opacity: 0.72;
}

.chat-view {
    position: relative;
    min-height: 0;
    height: 100%;
    display: grid;
    grid-template-rows: 117px minmax(0, 1fr);
    background: var(--messaging-chat-bg);
}

.chat-view:has(.profile-view) {
    grid-template-rows: minmax(0, 1fr);
}

.chat-view:has(.profile-view) .chat-header,
.chat-view:has(.profile-view) .chat-input-area {
    display: none;
}

.chat-view:has(.profile-view) .chat-messages-container {
    padding-bottom: 0;
}

.chat-header {
    position: relative;
    min-width: 0;
    display: grid;
    grid-template-columns: 56px minmax(0, 1fr) auto;
    align-items: center;
    gap: 16px;
    padding: 16px 30px;
    border-bottom: 1px solid var(--messaging-border);
    border-top-right-radius: 31px;
    background: var(--messaging-chat-header);
}

.contact-avatar-wrap {
    width: 55px;
    height: 55px;
}

.chat-header-info {
    min-width: 0;
    display: grid;
    grid-template-columns: max-content auto;
    grid-template-rows: auto auto;
    align-items: center;
    column-gap: 8px;
}

.chat-header-name {
    min-width: 0;
    margin: 0;
    color: var(--messaging-text);
    font-family: 'Work Sans', sans-serif;
    font-size: 24px;
    font-weight: 700;
    line-height: 28px;
    letter-spacing: 0;
    white-space: nowrap;
}

.chat-header-name .verified-icon {
    margin-left: 6px;
    width: 28px;
    height: 28px;
}

.chat-header-name .verified-icon::before {
    font-size: 28px;
}

.chat-header-name .verified-icon::after {
    font-size: 12px;
}

.first-contact-name .verified-icon,
.profile-name .verified-icon {
    margin-left: 8px;
    width: 22px;
    height: 22px;
}

.first-contact-name .verified-icon::before,
.profile-name .verified-icon::before {
    font-size: 22px;
}

.first-contact-name .verified-icon::after,
.profile-name .verified-icon::after {
    font-size: 9px;
}

.chat-header-id {
    grid-column: 1 / -1;
    color: var(--messaging-muted);
    font-family: 'Work Sans', sans-serif;
    font-size: 11px;
    font-weight: 400;
    line-height: 15px;
    letter-spacing: 0;
}

.chat-header-status {
    grid-column: 1 / -1;
    overflow: hidden;
    color: var(--messaging-slate);
    font-family: 'Work Sans', sans-serif;
    font-size: 18px;
    font-weight: 400;
    line-height: 22px;
    letter-spacing: 0;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.chat-header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.action-icon-circle {
    width: 44px;
    height: 44px;
    border: 0.92px solid var(--messaging-border);
    border-radius: 999px;
    color: var(--messaging-slate);
    background: transparent;
    display: inline-grid;
    place-items: center;
    cursor: pointer;
}

.action-icon-circle:hover {
    color: var(--messaging-blue);
    background: #ffffff;
}

.more-menu-wrap,
.attachment-menu-wrap {
    position: relative;
}

.more-options-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    z-index: 20;
    width: 140px;
    padding: 7px;
    border-radius: 6px;
    border: 1px solid var(--messaging-border);
    background: #ffffff;
    box-shadow: 0 12px 32px rgba(15, 23, 42, 0.16);
}

.more-options-menu button {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 23px;
    padding: 6px 8px;
    border: 0;
    border-radius: 4px;
    color: var(--messaging-text);
    background: transparent;
    font-family: 'Work Sans', sans-serif;
    font-size: 13px;
    line-height: 18px;
    text-align: left;
    cursor: pointer;
    transition: background-color 0.2s;
}

.more-options-menu button:hover {
    color: var(--messaging-blue);
}

.more-options-menu i {
    width: 12px;
    color: var(--messaging-slate);
    font-size: 10px;
}

.chat-messages-container {
    min-height: 0;
    overflow-y: auto;
    padding-bottom: 132px;
    background: var(--messaging-chat-bg);
}

.chat-messages {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: min(928px, 100%);
    margin: 0 auto;
    padding: 22px 16px 120px;
}

.chat-date-separator {
    width: 100%;
    margin: 0 0 2px;
    color: var(--messaging-soft-muted);
    font-family: 'Work Sans', sans-serif;
    font-size: 13px;
    font-weight: 600;
    line-height: 16px;
    letter-spacing: 0;
    text-align: center;
}

.message-row {
    width: 100%;
    min-width: 0;
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.message-row.me {
    justify-content: flex-end;
}

.message-row.other {
    justify-content: flex-start;
}

.message-avatar {
    width: 39px;
    height: 39px;
    border-radius: 999px;
    object-fit: cover;
    flex-shrink: 0;
}

.message-bubble {
    min-width: 0;
    min-height: 44px;
    display: flex;
    align-items: flex-end;
    gap: 10px;
    padding: 11px 12px;
    border-radius: 16px;
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 13.82px;
    font-weight: 500;
    line-height: 19.74px;
    letter-spacing: 0;
}

.message-bubble.me {
    max-width: min(511px, calc(100% - 48px));
    color: #ffffff;
    background: #374151;
}

.message-bubble.other {
    max-width: min(454px, calc(100% - 48px));
    color: #1e293b;
    background: #ffffff;
    border: 1px solid #e2e8f0;
}

.message-bubble.has-attachments {
    flex-direction: column;
    align-items: stretch;
    padding: 6px;
    gap: 6px;
}

.message-bubble.has-attachments .message-attachment {
    margin-bottom: 0 !important;
}

.message-bubble.has-attachments .message-attachment audio {
    width: 320px;
    max-width: 100%;
    display: block;
}

.message-bubble.has-attachments .message-attachment video,
.message-bubble.has-attachments .message-attachment img {
    max-width: 100%;
    display: block;
}

.message-bubble.has-attachments .message-text {
    padding: 2px 6px 0px;
}

.message-bubble.has-attachments .message-meta {
    align-self: flex-end;
    padding: 0 6px 2px;
}

.message-text {
    min-width: 0;
    overflow-wrap: anywhere;
}

.message-meta {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
    color: #475569;
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 11.84px;
    font-weight: 500;
    line-height: 15.79px;
}

.message-bubble.me .message-meta {
    color: #a5b4fc;
}

.message-row.other .message-meta i {
    display: none;
}

.message-meta i {
    font-size: 12px;
}

.message-meta i.read,
.message-bubble.me .message-meta i {
    color: #a5b4fc;
}

.first-contact-view {
    min-height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding: 132px 32px 124px;
    color: var(--messaging-muted);
    text-align: center;
}

.profile-view {
    position: relative;
    min-height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 65.5px 40px 78px;
    color: var(--messaging-muted);
    text-align: center;
}

.profile-back-btn {
    position: absolute;
    top: 17.5px;
    left: 20.8px;
    width: 114px;
    min-height: 25.414px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9.827px;
    padding: 3.931px 7.862px;
    border: 0.569px solid var(--messaging-border);
    border-radius: 7.061px;
    color: var(--messaging-text);
    background: #ffffff;
    font-family: 'Work Sans', sans-serif;
    font-size: 12.707px;
    font-weight: 500;
    line-height: 17.689px;
    cursor: pointer;
}

.profile-back-btn i {
    margin-right: 0;
    font-size: 11px;
}

.profile-avatar-large {
    position: relative;
    width: 216.696px;
    height: 216.696px;
    margin-top: 0;
}

.profile-avatar-large img {
    width: 100%;
    height: 100%;
    display: block;
    border-radius: 999px;
    object-fit: cover;
}

.profile-play-btn {
    position: absolute;
    right: 18px;
    bottom: 10px;
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 999px;
    color: #ffffff;
    background: var(--messaging-blue);
    display: inline-grid;
    place-items: center;
    cursor: pointer;
}

.profile-name {
    margin: 3px 0 0;
    color: var(--messaging-text);
    font-family: 'Work Sans', sans-serif;
    font-size: 28px;
    font-weight: 600;
    line-height: 32.156px;
    letter-spacing: -0.336px;
}

.profile-id {
    color: var(--messaging-muted);
    font-family: 'Work Sans', sans-serif;
    font-size: 11.005px;
    line-height: 17.716px;
    letter-spacing: -0.132px;
}

.profile-primary-action {
    min-width: 146px;
    min-height: 22.711px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8.782px;
    margin-top: 6.7px;
    padding: 3.513px 7.026px;
    border: 0;
    border-radius: 6.31px;
    color: #ffffff;
    background: var(--messaging-blue);
    font-family: 'Work Sans', sans-serif;
    font-size: 11.356px;
    font-weight: 500;
    line-height: 15.808px;
}

.profile-primary-action i {
    margin-right: 0;
    font-size: 14.513px;
}

.profile-section-title {
    margin: 8.3px 0 0;
    color: var(--messaging-text);
    font-family: 'Work Sans', sans-serif;
    font-size: 28px;
    font-weight: 600;
    line-height: 32.156px;
    letter-spacing: -0.336px;
}

.profile-tags {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8.782px;
    margin-top: 15.8px;
    margin-bottom: 0;
}

.profile-tags span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8.782px;
    min-height: 23px;
    padding: 3.513px 7.026px;
    border: 0.509px solid var(--messaging-border-light);
    border-radius: 6.31px;
    color: #ffffff;
    background: var(--messaging-text);
    font-family: 'Work Sans', sans-serif;
    font-size: 11.356px;
    font-weight: 500;
    line-height: 15.808px;
}

.profile-tags span i {
    font-size: 14px;
}

.profile-bio {
    max-width: 663px;
    margin: 31px 0 0;
    color: var(--messaging-muted);
    font-family: 'Work Sans', sans-serif;
    font-size: 16px;
    line-height: 28.977px;
    letter-spacing: -0.192px;
}

.profile-link {
    margin-top: 19px;
    border: 0;
    color: var(--messaging-blue);
    background: transparent;
    font-family: 'Work Sans', sans-serif;
    font-size: 16px;
    line-height: 20.158px;
    letter-spacing: -0.192px;
    cursor: pointer;
}

.first-contact-date {
    margin-bottom: 18px;
    color: var(--messaging-soft-muted);
    font-family: 'Work Sans', sans-serif;
    font-size: 16px;
    font-weight: 600;
    line-height: 20px;
    letter-spacing: 0;
}

.first-contact-avatar-large {
    width: clamp(150px, 18vw, 217px);
    height: clamp(150px, 18vw, 217px);
    margin-bottom: 0;
}

.first-contact-name {
    margin: 0;
    color: var(--messaging-text);
    font-family: 'Work Sans', sans-serif;
    font-size: 28px;
    font-weight: 600;
    line-height: 32px;
    letter-spacing: 0;
}

.first-contact-id {
    margin: 0;
    color: var(--messaging-muted);
    font-family: 'Work Sans', sans-serif;
    font-size: 11px;
    font-weight: 400;
    line-height: 18px;
    letter-spacing: 0;
}

.btn-exibir-perfil {
    margin: 0 0 8px;
    padding: 0;
    border: 0;
    color: var(--messaging-blue);
    background: transparent;
    font-family: 'Work Sans', sans-serif;
    font-size: 16px;
    font-weight: 400;
    line-height: 22px;
    letter-spacing: 0;
    text-decoration: underline;
    cursor: pointer;
}

.first-contact-text {
    width: min(444px, 90%);
    margin: 0;
    color: var(--messaging-muted);
    font-family: 'Work Sans', sans-serif;
    font-size: 18px;
    font-weight: 400;
    line-height: 29px;
    letter-spacing: 0;
}

.pending-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-top: 20px;
}

.btn-accept-large,
.btn-deny-large {
    min-height: 40px;
    padding: 0 18px;
    border-radius: 8px;
    font-family: 'Work Sans', sans-serif;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}

.btn-accept-large {
    border: 1px solid var(--messaging-blue);
    color: #ffffff;
    background: var(--messaging-blue);
}

.btn-deny-large {
    border: 1px solid var(--messaging-border);
    color: var(--messaging-muted);
    background: transparent;
}

.connection-request-banner,
.connection-action-error {
    width: min(560px, calc(100% - 24px));
    margin: 0 auto 18px;
    border-radius: 12px;
    font-family: 'Work Sans', sans-serif;
}

.connection-request-banner {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 16px;
    padding: 14px 16px;
    border: 1px solid rgba(14, 165, 233, 0.24);
    color: var(--messaging-slate);
    background: rgba(14, 165, 233, 0.08);
}

.connection-request-banner.muted {
    grid-template-columns: 1fr;
    border-color: var(--messaging-border-light);
    background: rgba(148, 163, 184, 0.12);
}

.connection-request-banner strong,
.connection-request-banner span {
    display: block;
    letter-spacing: 0;
}

.connection-request-banner strong {
    margin-bottom: 3px;
    color: var(--messaging-text);
    font-size: 13px;
    font-weight: 600;
}

.connection-request-banner span {
    color: var(--messaging-muted);
    font-size: 12px;
    line-height: 18px;
}

.connection-request-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-accept-small,
.btn-deny-small {
    min-height: 30px;
    padding: 0 12px;
    border-radius: 8px;
    font-family: 'Work Sans', sans-serif;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
}

.btn-accept-small {
    border: 1px solid var(--messaging-blue);
    color: #ffffff;
    background: var(--messaging-blue);
}

.btn-deny-small {
    border: 1px solid var(--messaging-border);
    color: var(--messaging-muted);
    background: #ffffff;
}

.connection-action-error {
    padding: 10px 14px;
    border: 1px solid rgba(239, 68, 68, 0.28);
    color: #b91c1c;
    background: rgba(239, 68, 68, 0.08);
    font-size: 12px;
    line-height: 18px;
    text-align: center;
}

.chat-input-area {
    position: absolute;
    left: 50%;
    right: auto;
    bottom: 56px;
    width: min(867px, calc(100% - 96px));
    transform: translateX(-50%);
    z-index: 2;
}

.chat-input-group {
    min-height: 45px;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 8px;
    padding: 3px 12px;
    border: 1px solid var(--messaging-border);
    border-radius: 999px;
    background: #ffffff;
    box-shadow: var(--messaging-shadow);
}

.chat-input-group.disabled {
    opacity: 0.72;
    background: #f8fafc;
}

.chat-input-group.disabled .btn-attach,
.chat-input-group.disabled .btn-mic,
.chat-input-group.disabled .btn-send-chat,
.chat-input-group.disabled .chat-input-field {
    cursor: not-allowed;
}

.chat-input-field {
    min-width: 0;
    border: 0;
    outline: 0;
    color: var(--messaging-slate);
    background: transparent;
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 15px;
    font-weight: 500;
    line-height: 22px;
    letter-spacing: 0;
}

.chat-input-field::placeholder {
    color: var(--messaging-slate);
    opacity: 1;
}

.btn-attach,
.btn-mic,
.btn-send-chat {
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 999px;
    display: inline-grid;
    place-items: center;
    color: var(--messaging-soft-muted);
    background: transparent;
    cursor: pointer;
}

.btn-attach i,
.btn-mic i,
.btn-send-chat i {
    font-size: 18px;
}

.btn-send-chat {
    color: var(--messaging-blue);
}

.chat-input-icons {
    display: flex;
    align-items: center;
    gap: 2px;
}

.attachment-options-menu {
    top: auto;
    right: auto;
    bottom: calc(100% + 10px);
    left: 0;
}

.filters-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1500;
    display: grid;
    place-items: center;
    padding: 20px;
    background: rgba(0, 0, 0, 0.42);
}

.filters-modal {
    position: relative;
    width: min(372px, calc(100vw - 40px));
    max-height: min(80vh, 520px);
    overflow-y: auto;
    padding: 22px 24px 28px;
    border-radius: 18px;
    color: #1f2937;
    background: #ffffff;
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.26);
}

.filters-close {
    position: absolute;
    top: 18px;
    right: 18px;
    border: 0;
    color: #9ca3af;
    background: transparent;
    font-size: 16px;
    cursor: pointer;
}

.filters-modal h2 {
    margin: 0 0 22px;
    color: #1f2937;
    font-family: 'Work Sans', sans-serif;
    font-size: 24px;
    font-weight: 500;
    line-height: 30px;
}

.filters-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    column-gap: 28px;
    row-gap: 14px;
}

.filters-grid h3 {
    margin: 0 0 10px;
    color: #374151;
    font-family: 'Work Sans', sans-serif;
    font-size: 13px;
    font-weight: 600;
}

.filters-grid label,
.filters-grid button {
    min-height: 22px;
    display: flex;
    align-items: center;
    gap: 7px;
    color: #6b7280;
    background: transparent;
    border: 0;
    font-family: 'Work Sans', sans-serif;
    font-size: 10px;
    text-align: left;
}

.filters-grid input {
    width: 13px;
    height: 13px;
    accent-color: var(--messaging-blue);
}

.filters-grid button {
    color: #374151;
    cursor: pointer;
}

[data-theme="dark"] {
    --messaging-surface: #1f2937;
    --messaging-panel: #111827;
    --messaging-chat-bg: #111827;
    --messaging-chat-header: #1f2937;
    --messaging-border: #374151;
    --messaging-border-light: #374151;
    --messaging-text: #f3f4f6;
    --messaging-muted: #9ca3af;
    --messaging-soft-muted: #94a3b8;
    --messaging-slate: #cbd5e1;
}

[data-theme="dark"] .messaging-sidebar-title i,
[data-theme="dark"] .contact-display-name {
    color: var(--messaging-text);
}

[data-theme="dark"] .search-field-group,
[data-theme="dark"] .search-results-panel,
[data-theme="dark"] .tab-btn,
[data-theme="dark"] .action-btn-send,
[data-theme="dark"] .chat-input-group,
[data-theme="dark"] .btn-deny-small,
[data-theme="dark"] .action-icon-circle:hover,
[data-theme="dark"] .message-bubble.other,
[data-theme="dark"] .more-options-menu,
[data-theme="dark"] .profile-back-btn,
[data-theme="dark"] .profile-tags span {
    background: #1f2937;
}

[data-theme="dark"] .search-field-input,
[data-theme="dark"] .search-field-input::placeholder {
    color: var(--messaging-text);
}

[data-theme="dark"] .status-dot {
    border-color: #1f2937;
}

[data-theme="dark"] .message-bubble.me {
    background: #374151;
}

[data-theme="dark"] .message-bubble.other {
    border-color: #374151;
    color: var(--messaging-text);
}

[data-theme="dark"] .profile-tags span {
    border-color: #4b5563;
    color: #ffffff;
    background: #374151;
}

[data-theme="dark"] .connection-request-banner {
    border-color: rgba(14, 165, 233, 0.3);
    background: rgba(14, 165, 233, 0.12);
}

[data-theme="dark"] .connection-request-banner.muted {
    border-color: var(--messaging-border);
    background: rgba(148, 163, 184, 0.12);
}

[data-theme="dark"] .connection-action-error {
    color: #fecaca;
    background: rgba(239, 68, 68, 0.14);
}

[data-theme="dark"] .filters-modal {
    color: var(--messaging-text);
    background: #1f2937;
}

[data-theme="dark"] .filters-modal h2,
[data-theme="dark"] .filters-grid h3,
[data-theme="dark"] .filters-grid button {
    color: var(--messaging-text);
}

@media (max-width: 1100px) {
    .messaging-container {
        grid-template-columns: 326px minmax(0, 1fr);
    }

    .chat-header {
        padding-inline: 22px;
    }

    .chat-header-name {
        font-size: 24px;
        line-height: 28px;
    }

    .chat-header-status {
        font-size: 18px;
        line-height: 22px;
    }

    .action-icon-circle {
        width: 38px;
        height: 38px;
    }
}

@media (max-width: 768px) {
    .content-wrapper:has(.messaging-page-wrapper),
    .content-wrapper.sidebar-expanded:has(.messaging-page-wrapper) {
        margin-left: 0 !important;
    }

    .messaging-page-wrapper {
        grid-template-rows: 52px minmax(0, 1fr);
    }

    .messaging-top-bar {
        min-height: 52px;
        padding: 12px 6px;
        background: linear-gradient(90deg, #5395bb 49.94%, #245878 95.22%, #050a0c 138.5%);
    }

    .top-bar-left {
        gap: 12px;
    }

    .messaging-mobile-menu-btn {
        display: inline-grid;
        flex: 0 0 auto;
    }

    .messaging-page-wrapper.has-selected-conversation .messaging-mobile-menu-icon {
        width: 18px;
        height: 18px;
        border: 0;
        border-radius: 0;
    }

    .messaging-page-wrapper.has-selected-conversation .messaging-mobile-menu-icon::before {
        top: 8px;
        left: 3px;
        width: 14px;
        height: 1.6px;
        background: currentColor;
        transform: none;
    }

    .messaging-page-wrapper.has-selected-conversation .messaging-mobile-menu-icon::after {
        content: "";
        position: absolute;
        top: 4px;
        left: 3px;
        width: 8px;
        height: 8px;
        border-left: 1.6px solid currentColor;
        border-bottom: 1.6px solid currentColor;
        transform: rotate(45deg);
        transform-origin: center;
    }

    .top-bar-divider {
        display: block;
        flex: 0 0 auto;
        width: 1px;
        height: 20px;
        background: rgba(255, 255, 255, 0.75);
    }

    .top-bar-title {
        font-size: 20px;
        line-height: 28px;
    }

    .notification-bell-blue {
        width: 28px;
        height: 28px;
    }

    .notification-bell-blue i {
        font-size: 13px;
    }

    .messaging-container {
        grid-template-columns: 1fr;
        grid-template-rows: minmax(0, 1fr);
    }

    .messaging-page-wrapper:not(.has-selected-conversation) .chat-content {
        display: none;
    }

    .messaging-page-wrapper.has-selected-conversation .messaging-container {
        grid-template-rows: minmax(0, 1fr);
    }

    .messaging-page-wrapper.has-selected-conversation .messaging-sidebar {
        display: none;
    }

    .messaging-sidebar {
        border-right: 0;
        border-bottom: 1px solid var(--messaging-border);
    }

    .messaging-sidebar-header {
        padding: 14px 18px 0;
    }

    .messaging-page-wrapper:has(.search-results-panel) .messaging-sidebar-header {
        padding-bottom: 0;
    }

    .messaging-sidebar-title {
        font-size: 17px;
        line-height: 22px;
    }

    .messaging-sidebar-desc {
        display: none;
    }

    .tabs-container {
        margin: 9px auto 16px;
    }

    .search-results-panel {
        margin-bottom: 12px;
        padding-top: 12px;
    }

    .search-results-panel .tabs-container {
        margin: 0 auto 16px;
    }

    .contacts-scroll-area {
        padding: 0 18px 12px;
    }

    .contact-card {
        min-height: 50px;
    }

    .chat-view {
        grid-template-rows: 74px minmax(0, 1fr);
    }

    .chat-header {
        grid-template-columns: 46px minmax(0, 1fr) auto;
        gap: 10px;
        padding: 10px 14px;
        border-top-right-radius: 0;
    }

    .contact-avatar-wrap {
        width: 44px;
        height: 44px;
    }

    .chat-header-name {
        font-size: 16px;
        line-height: 20px;
    }

    .chat-header-status {
        font-size: 12px;
        line-height: 15px;
    }

    .chat-header-actions {
        gap: 4px;
    }

    .message-search-panel {
        left: 12px;
        right: 12px;
        bottom: -48px;
        width: auto;
        grid-template-columns: auto minmax(0, 1fr) auto auto auto auto;
    }

    .message-search-input {
        font-size: 13px;
    }

    .action-icon-circle {
        width: 34px;
        height: 34px;
    }

    .chat-messages {
        width: 100%;
        padding: 18px 14px 96px;
    }

    .profile-view {
        padding: 34px 20px 78px;
    }

    .profile-back-btn {
        display: none;
    }

    .profile-avatar-large {
        width: 132px;
        height: 132px;
    }

    .profile-play-btn {
        right: 6px;
        bottom: 6px;
        width: 28px;
        height: 28px;
    }

    .profile-play-btn i {
        font-size: 11px;
    }

    .profile-name {
        font-size: 20px;
        line-height: 25px;
    }

    .profile-id {
        font-size: 8px;
        line-height: 13px;
    }

    .profile-primary-action {
        min-width: 105px;
        min-height: 21px;
        gap: 6px;
        margin-top: 4px;
        font-size: 8px;
        line-height: 12px;
    }

    .profile-primary-action i {
        font-size: 10px;
    }

    .profile-section-title {
        margin-top: 8px;
        font-size: 18px;
        line-height: 23px;
    }

    .profile-tags {
        gap: 6px;
        margin-top: 8px;
    }

    .profile-tags span {
        min-height: 19px;
        gap: 5px;
        padding: 3px 6px;
        font-size: 7.5px;
        line-height: 11px;
    }

    .profile-tags span i {
        font-size: 9px;
    }

    .profile-bio {
        max-width: 270px;
        margin-top: 18px;
        font-size: 10px;
        line-height: 19px;
    }

    .profile-link {
        margin-top: 14px;
        font-size: 11px;
        line-height: 16px;
    }

    .message-bubble {
        max-width: calc(100% - 48px);
        font-size: 12px;
        line-height: 18px;
    }

    .message-bubble.me,
    .message-bubble.other {
        max-width: calc(100% - 48px);
    }

    .message-avatar {
        width: 34px;
        height: 34px;
    }

    .first-contact-view {
        padding: 34px 18px 104px;
    }

    .first-contact-date {
        font-size: 13px;
        margin-bottom: 14px;
    }

    .first-contact-name {
        font-size: 22px;
        line-height: 28px;
    }

    .first-contact-name .verified-icon,
    .profile-name .verified-icon {
        margin-left: 5px;
        width: 16px;
        height: 16px;
    }

    .first-contact-name .verified-icon::before,
    .profile-name .verified-icon::before {
        font-size: 16px;
    }

    .first-contact-name .verified-icon::after,
    .profile-name .verified-icon::after {
        font-size: 7px;
    }

    .first-contact-text {
        font-size: 14px;
        line-height: 22px;
    }

    .empty-state-text {
        max-width: 90%;
        white-space: normal;
    }

    .chat-input-area {
        left: 14px;
        right: 14px;
        bottom: 16px;
        width: auto;
        transform: none;
    }

}

/* Audio Recording Mode Styles */
.chat-input-group.recording-mode {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background-color: var(--card-bg, #ffffff);
    border: 1px solid var(--messaging-border);
    border-radius: 999px;
    padding: 10px 24px;
    min-height: 45px;
    width: 100%;
    box-shadow: var(--messaging-shadow);
}

.recording-indicator {
    display: flex;
    align-items: center;
    gap: 10px;
}

.recording-dot {
    width: 10px;
    height: 10px;
    background-color: #ef4444;
    border-radius: 50%;
    animation: blink-red 1s infinite alternate;
}

@keyframes blink-red {
    0% { opacity: 0.3; }
    100% { opacity: 1; }
}

.recording-time {
    font-size: 14px;
    font-weight: 600;
    color: #ef4444;
    font-family: monospace;
}

.recording-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.btn-cancel-recording,
.btn-send-recording {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 18px;
    padding: 4px;
    transition: transform 0.2s, color 0.2s;
    display: inline-grid;
    place-items: center;
}

.btn-cancel-recording {
    color: var(--messaging-soft-muted);
}

.btn-cancel-recording:hover {
    color: #ef4444;
    transform: scale(1.1);
}

.btn-send-recording {
    color: var(--messaging-blue);
}

.btn-send-recording:hover {
    color: #0284c7;
    transform: scale(1.1);
}

[data-theme="dark"] .chat-input-group.recording-mode {
    background: #1f2937;
    border-color: #374151;
}

/* Camera Modal Styles */
.camera-backdrop {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: grid;
    place-items: center;
    background: rgba(0, 0, 0, 0.5);
    padding: 20px;
}

.camera-modal {
    width: min(500px, calc(100% - 24px));
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    animation: modal-fade-in 0.25s ease-out;
}

@keyframes modal-fade-in {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

.camera-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--messaging-border, #e2e8f0);
    padding-bottom: 10px;
}

.camera-modal-header h3 {
    margin: 0;
    font-family: 'Work Sans', sans-serif;
    font-size: 18px;
    font-weight: 600;
    color: var(--messaging-text, #1e293b);
}

.camera-close-btn {
    border: none;
    background: none;
    font-size: 24px;
    line-height: 1;
    color: var(--messaging-muted, #64748b);
    cursor: pointer;
    padding: 4px;
}

.camera-close-btn:hover {
    color: #ef4444;
}

.camera-viewport {
    width: 100%;
    aspect-ratio: 4 / 3;
    background: #000000;
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: inset 0 0 10px rgba(0,0,0,0.5);
}

.camera-viewport video,
.camera-viewport img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.camera-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding-top: 10px;
}

.camera-btn {
    min-height: 38px;
    padding: 0 16px;
    border-radius: 8px;
    font-family: 'Work Sans', sans-serif;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
    background: #ffffff;
    border: 1px solid var(--messaging-border, #cbd5e1);
    color: var(--messaging-slate, #334155);
}

.camera-btn:hover {
    background: #f8fafc;
    border-color: #94a3b8;
}

.camera-btn.btn-capture {
    background: var(--messaging-blue, #0ea5e9);
    border-color: var(--messaging-blue, #0ea5e9);
    color: #ffffff;
}

.camera-btn.btn-capture:hover {
    background: #0284c7;
}

.camera-btn.btn-send {
    background: #10b981;
    border-color: #10b981;
    color: #ffffff;
}

.camera-btn.btn-send:hover {
    background: #059669;
}

.camera-btn.btn-cancel {
    border-color: #f1f5f9;
    background: #f1f5f9;
    color: #64748b;
}

.camera-btn.btn-cancel:hover {
    background: #e2e8f0;
}

/* Dark mode support */
[data-theme="dark"] .camera-modal {
    background: #1f2937;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
}

[data-theme="dark"] .camera-modal-header {
    border-color: #374151;
}

[data-theme="dark"] .camera-btn {
    background: #374151;
    border-color: #4b5563;
    color: #f3f4f6;
}

[data-theme="dark"] .camera-btn:hover {
    background: #4b5563;
}

[data-theme="dark"] .camera-btn.btn-cancel {
    background: #374151;
    border-color: #4b5563;
    color: #9ca3af;
}

[data-theme="dark"] .camera-btn.btn-cancel:hover {
    background: #4b5563;
    color: #ffffff;
}

/* ── Message Search Panel ── */
.action-icon-circle.active {
    color: var(--messaging-on-accent);
    border-color: var(--messaging-blue);
    background: var(--messaging-blue);
}

.message-search-panel {
    position: absolute;
    right: 30px;
    bottom: -52px;
    z-index: 6;
    width: min(430px, calc(100vw - 48px));
    min-height: 42px;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto auto auto auto;
    align-items: center;
    gap: 8px;
    padding: 6px 8px 6px 12px;
    border: 1px solid var(--messaging-border);
    border-radius: 999px;
    color: var(--messaging-slate);
    background: var(--messaging-surface-raised);
    box-shadow: var(--messaging-shadow);
}

.message-search-input {
    min-width: 0;
    border: 0;
    outline: 0;
    color: var(--messaging-text);
    background: transparent;
    font-family: var(--messaging-font);
    font-size: 14px;
    line-height: 20px;
}

.message-search-counter {
    color: var(--messaging-muted);
    font-family: var(--messaging-font);
    font-size: 12px;
    line-height: 16px;
    white-space: nowrap;
}

.message-search-nav,
.message-search-close {
    width: 28px;
    height: 28px;
    border: 0;
    border-radius: 999px;
    color: var(--messaging-slate);
    background: transparent;
    display: inline-grid;
    place-items: center;
    cursor: pointer;
}

.message-search-nav:hover,
.message-search-close:hover {
    color: var(--messaging-blue);
    background: var(--messaging-hover);
}

.message-search-nav:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.message-row.message-search-match .message-bubble {
    outline: 2px solid rgba(14, 165, 233, 0.42);
    outline-offset: 3px;
}

.message-row.message-search-current .message-bubble {
    outline-color: var(--messaging-blue);
    box-shadow: 0 0 0 5px rgba(14, 165, 233, 0.16);
}
