html {
    --app-bg: #f4f6f8;
    --app-surface: #ffffff;
    --app-surface-alt: #fafbfc;
    --app-text: #17212b;
    --app-heading: #1a2a33;
    --app-muted: #5f6f79;
    --app-border: #d9e0e7;
    --app-subtle-border: #e5eaee;
    --app-row-border: #eef1f4;
    --app-hover: #edf6fc;
    --app-selected: #d7eafa;
    --app-accent: #075a9c;
    --app-link: #075a9c;
    --app-warning: #d89a16;
    --app-reaction-bg: #f0e6c7;
    --app-reaction-text: #5d4711;
    --app-danger: #b42318;
    --app-danger-text: #7a1d16;
    --app-chat-header-bg: #075a9c;
    --app-chat-header-text: #ffffff;
    --app-chat-header-muted: #d9edff;
    --app-message-sent-bg: #075a9c;
    --app-message-received-bg: #243648;
    --app-message-status-muted: rgba(255, 255, 255, 0.72);
    --app-message-delivered: #ffcc4d;
    --app-message-read: #00e5ff;
    --app-image-zoom-bg: #0f1d2b;
    --app-image-zoom-toolbar-bg: #1d3143;
    --app-recording-bg: #8bd3ff;
    --app-recording-text: #031524;
    --app-attachment-bg: #ffe3b0;
    --app-attachment-text: #3c2505;
    --app-contact-send-bg: #c8f0df;
    --app-contact-send-text: #073522;
    --app-login-bg: linear-gradient(135deg, #eaf4fb 0%, #f8fbfd 56%, #edf2f7 100%);
}

html[data-bs-theme="dark"] {
    --app-bg: #151a1e;
    --app-surface: #20272c;
    --app-surface-alt: #252d33;
    --app-text: #edf2f6;
    --app-heading: #f7fafc;
    --app-muted: #aebbc5;
    --app-border: #35424a;
    --app-subtle-border: #313c44;
    --app-row-border: #2d373f;
    --app-hover: #1d3143;
    --app-selected: #204b6b;
    --app-accent: #075a9c;
    --app-link: #86cff6;
    --app-warning: #d89a16;
    --app-reaction-bg: #4b3d1a;
    --app-reaction-text: #ffe7a3;
    --app-danger: #ef695f;
    --app-danger-text: #ffd3ce;
    --app-chat-header-bg: #075a9c;
    --app-chat-header-text: #ffffff;
    --app-chat-header-muted: #d9edff;
    --app-message-sent-bg: #075a9c;
    --app-message-received-bg: #243648;
    --app-message-status-muted: rgba(255, 255, 255, 0.72);
    --app-message-delivered: #ffcc4d;
    --app-message-read: #00e5ff;
    --app-image-zoom-bg: #0f1d2b;
    --app-image-zoom-toolbar-bg: #1d3143;
    --app-recording-bg: #8bd3ff;
    --app-recording-text: #031524;
    --app-attachment-bg: #f4c66f;
    --app-attachment-text: #2c1a02;
    --app-contact-send-bg: #9bdcc5;
    --app-contact-send-text: #061d16;
    --app-login-bg: linear-gradient(135deg, #101b26 0%, #182531 56%, #111820 100%);
}

html,
body {
    height: 100%;
    margin: 0;
    font-family: "Segoe UI", Arial, sans-serif;
    background: var(--app-bg);
    color: var(--app-text);
}

a {
    color: var(--app-link);
}

.app-shell {
    min-height: 100vh;
}

.page-title {
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: 0;
}

.messenger-page,
.management-page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.messenger-page {
    height: 100vh;
    min-height: 0;
    overflow: hidden;
}

.messenger-appbar.e-appbar,
.management-appbar.e-appbar {
    min-height: 64px;
    padding-inline: 12px;
    background: var(--app-accent);
    color: #ffffff;
}

.appbar-heading {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 190px;
}

.appbar-caption {
    font-size: 0.78rem;
    opacity: 0.88;
}

.ban-selector {
    width: min(320px, 28vw);
    min-width: 220px;
}

.audio-notification-toggle.is-muted.e-btn {
    color: rgba(255, 255, 255, 0.72);
}

.audio-notification-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: "Segoe UI Symbol", "Segoe UI Emoji", sans-serif;
    font-size: 1rem;
    line-height: 1;
}

.audio-notification-on::before {
    content: "\1F50A";
}

.audio-notification-off::before {
    content: "\1F507";
}

.messenger-workspace {
    position: relative;
    flex: 1;
    height: calc(100vh - 64px);
    min-height: 0;
    display: flex;
    overflow: hidden;
}

.messenger-body {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
    min-height: 0;
    height: 100%;
    padding: 12px;
    box-sizing: border-box;
}

.contacts-sidebar.e-sidebar {
    border-right: 1px solid var(--app-border);
    background: var(--app-surface);
}

.contacts-pane {
    height: 100%;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 12px;
    box-sizing: border-box;
}

.contact-search {
    flex: 0 0 auto;
}

.contacts-list {
    flex: 1;
    min-height: 0;
    border: 0;
}

.contacts-list .e-list-parent,
.contacts-list .e-list-container {
    height: auto;
}

.contacts-list .e-list-item {
    height: auto !important;
    min-height: 0;
    padding: 0 !important;
    line-height: normal;
}

.contacts-list .e-list-item .e-list-text {
    display: block;
    padding: 0;
    white-space: normal;
}

.forward-dialog .e-dlg-content {
    padding: 14px;
}

.forward-dialog-content {
    gap: 12px;
}

.forward-summary {
    display: grid;
    grid-template-columns: 36px minmax(0, 1fr);
    gap: 10px;
    align-items: center;
    padding: 10px;
    border: 1px solid var(--app-subtle-border);
    border-radius: 8px;
    background: var(--app-surface-alt);
}

.forward-summary > .e-icons {
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--app-selected);
    color: var(--app-accent);
}

.forward-summary-body {
    min-width: 0;
}

.forward-summary-title {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--app-heading);
}

.forward-summary-text {
    margin-top: 2px;
    color: var(--app-muted);
    font-size: 0.8rem;
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.forward-contact-list {
    max-height: min(380px, 52vh);
    overflow: auto;
    border: 1px solid var(--app-subtle-border);
    border-radius: 8px;
}

.forward-contact-row {
    display: grid;
    grid-template-columns: 20px 42px minmax(0, 1fr);
    gap: 10px;
    align-items: center;
    min-height: 62px;
    padding: 9px 10px;
    border-bottom: 1px solid var(--app-row-border);
    cursor: pointer;
}

.forward-contact-row:last-child {
    border-bottom: 0;
}

.forward-contact-row:hover {
    background: var(--app-hover);
}

.forward-contact-row:has(input:disabled) {
    cursor: default;
    opacity: 0.72;
}

.forward-contact-row:has(input:disabled):hover {
    background: transparent;
}

.forward-contact-row input {
    width: 16px;
    height: 16px;
    margin: 0;
    accent-color: var(--app-accent);
}

.forward-contact-details {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 3px;
}

.forward-contact-name {
    overflow: hidden;
    color: var(--app-heading);
    font-size: 0.9rem;
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.forward-contact-phone {
    overflow: hidden;
    color: var(--app-muted);
    font-size: 0.76rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.forward-contact-empty {
    padding: 18px;
    color: var(--app-muted);
    text-align: center;
}

.forward-dialog-sending {
    position: relative;
    min-height: 36px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--app-muted);
    font-size: 0.84rem;
}

.forward-dialog-sending .e-spinner-pane {
    position: relative;
    width: 24px;
    min-height: 24px;
    background: transparent;
}

.contact-item {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr);
    column-gap: 10px;
    align-items: center;
    padding: 10px 12px 11px;
    border-bottom: 1px solid var(--app-row-border);
    cursor: pointer;
    min-height: 82px;
    overflow: hidden;
}

.contact-item:hover {
    background: var(--app-hover);
}

.contact-item.selected {
    background: var(--app-selected);
    border-left: 4px solid var(--app-accent);
}

.contact-avatar.e-avatar {
    width: 42px;
    height: 42px;
    min-width: 42px;
    color: #ffffff;
    font-size: 0.92rem;
    font-weight: 700;
    letter-spacing: 0;
}

.contact-avatar.avatar-color-0,
.message-audio-avatar.avatar-color-0 {
    background: var(--app-accent);
}

.contact-avatar.avatar-color-1,
.message-audio-avatar.avatar-color-1 {
    background: #3b6ea8;
}

.contact-avatar.avatar-color-2,
.message-audio-avatar.avatar-color-2 {
    background: #8b5a9f;
}

.contact-avatar.avatar-color-3,
.message-audio-avatar.avatar-color-3 {
    background: #c05a4b;
}

.contact-avatar.avatar-color-4,
.message-audio-avatar.avatar-color-4 {
    background: #b7791f;
}

.contact-avatar.avatar-color-5,
.message-audio-avatar.avatar-color-5 {
    background: #2f74a8;
}

.contact-avatar.avatar-color-6,
.message-audio-avatar.avatar-color-6 {
    background: #4a5568;
}

.contact-avatar.avatar-color-7,
.message-audio-avatar.avatar-color-7 {
    background: #6b46c1;
}

.contact-avatar.avatar-color-8,
.message-audio-avatar.avatar-color-8 {
    background: #b83280;
}

.contact-avatar.avatar-color-9,
.message-audio-avatar.avatar-color-9 {
    background: #226c9d;
}

.contact-details {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 5px;
}

.contact-name {
    font-weight: 700;
    font-size: 0.96rem;
    line-height: 1.25;
    color: var(--app-heading);
    overflow-wrap: anywhere;
}

.contact-company,
.contact-company-action {
    font-size: 0.78rem;
    line-height: 1.25;
}

.contact-company {
    color: var(--app-text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.contact-company-action.e-btn.e-link {
    align-self: flex-start;
    height: auto;
    min-height: 0;
    padding: 0;
}

.contact-meta {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 8px;
    font-size: 0.74rem;
    line-height: 1.2;
    color: var(--app-muted);
}

.contact-meta span:first-child {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.unread-badge {
    flex: 0 0 auto;
    min-width: 24px;
    height: 24px;
    padding: 0 7px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--app-warning);
    color: #ffffff;
    font-weight: 700;
}

.chat-surface {
    flex: 1;
    height: 100%;
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 0;
    position: relative;
    overflow: hidden;
    background: var(--app-surface);
    border: 1px solid var(--app-border);
}

.chat-context {
    min-height: 58px;
    padding: 10px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    border-bottom: 1px solid var(--app-subtle-border);
    background: var(--app-chat-header-bg);
    color: var(--app-chat-header-text);
}

.chat-contact-name {
    font-size: 1rem;
    font-weight: 700;
    color: var(--app-chat-header-text);
}

.chat-contact-caption,
.policy-link {
    font-size: 0.78rem;
    color: var(--app-chat-header-muted);
}

.chat-tools {
    position: absolute;
    left: 22px;
    right: 66px;
    bottom: 14px;
    z-index: 5;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 0;
    pointer-events: none;
}

.chat-tools-start,
.chat-tools-end {
    display: flex;
    align-items: center;
    gap: 8px;
    pointer-events: auto;
}

.composer-attachment-input {
    display: none;
}

.composer-attachment-button,
.composer-icon-button.e-btn {
    width: 42px;
    min-width: 42px;
    height: 42px;
    padding: 0;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    line-height: 1;
}

.composer-attachment-button {
    border: 1px solid var(--app-attachment-bg);
    background: var(--app-attachment-bg);
    color: var(--app-attachment-text);
    font-size: 1.75rem;
    font-weight: 300;
    cursor: pointer;
    box-sizing: border-box;
}

.composer-attachment-button:hover,
.composer-attachment-button:focus {
    border-color: var(--app-attachment-bg);
    background: var(--app-attachment-bg);
    color: var(--app-attachment-text);
}

.composer-recording-button.e-btn,
.composer-recording-button.e-btn:hover,
.composer-recording-button.e-btn:focus {
    border-color: var(--app-recording-bg);
    background: var(--app-recording-bg);
    color: var(--app-recording-text);
}

.composer-recording-button.e-btn.is-recording,
.composer-recording-button.e-btn.is-recording:hover,
.composer-recording-button.e-btn.is-recording:focus {
    border-color: var(--app-accent);
    background: var(--app-accent);
    color: #ffffff;
}

.composer-cancel-button.e-btn,
.composer-cancel-button.e-btn:hover,
.composer-cancel-button.e-btn:focus {
    border-color: var(--app-danger);
    background: var(--app-danger);
    color: #ffffff;
}

.composer-contact-button.e-btn,
.composer-contact-button.e-btn:hover,
.composer-contact-button.e-btn:focus {
    border-color: var(--app-contact-send-bg);
    background: var(--app-contact-send-bg);
    color: var(--app-contact-send-text);
}

.whatsapp-chat {
    flex: 1;
    min-height: 0;
    border: 0;
}

.whatsapp-chat.e-chat-ui .e-footer {
    padding-left: 118px;
    padding-right: 118px;
}

.chat-surface.is-recording .whatsapp-chat.e-chat-ui .e-footer {
    padding-right: 168px;
}

.whatsapp-chat.e-chat-ui .e-right .e-message-content {
    background: var(--app-message-sent-bg);
    color: #ffffff;
}

.whatsapp-chat.e-chat-ui .e-left .e-message-content,
.whatsapp-chat.e-chat-ui .e-left .e-message-content:hover,
.whatsapp-chat.e-chat-ui .e-left .e-message-content:focus,
.whatsapp-chat.e-chat-ui .e-left .e-message-content:active {
    background: var(--app-message-received-bg);
    color: #ffffff;
}

.whatsapp-chat.e-chat-ui .e-right .e-time,
.whatsapp-chat.e-chat-ui .e-left .e-time,
.whatsapp-chat.e-chat-ui .e-status-text,
.whatsapp-chat.e-chat-ui .e-status-icon {
    color: var(--app-message-status-muted);
}

.whatsapp-chat.e-chat-ui .e-status-icon.wa-message-status-icon {
    display: none;
}

.whatsapp-chat.e-chat-ui .e-status-icon.wa-status-sent ~ .e-status-text {
    color: var(--app-message-status-muted);
    letter-spacing: 0;
}

.whatsapp-chat.e-chat-ui .e-status-icon.wa-status-delivered ~ .e-status-text {
    color: var(--app-message-delivered);
    letter-spacing: 0;
}

.whatsapp-chat.e-chat-ui .e-status-icon.wa-status-read ~ .e-status-text {
    color: var(--app-message-read);
    letter-spacing: 0;
}

.message-content {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-width: min(520px, 74vw);
    padding: 7px 38px 7px 9px;
    border-radius: 8px;
    color: #ffffff;
    overflow-wrap: anywhere;
}

.message-content.sent {
    align-items: flex-end;
    background: var(--app-message-sent-bg);
    border-top-right-radius: 2px;
}

.message-content.received {
    align-items: flex-start;
    background: var(--app-message-received-bg);
    border-top-left-radius: 2px;
}

.message-origin {
    font-size: 0.72rem;
    font-weight: 700;
    color: #ffffff;
}

.message-forward-button {
    position: absolute;
    top: 4px;
    right: 5px;
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.78);
    cursor: pointer;
}

.message-forward-button:hover,
.message-forward-button:focus {
    background: rgba(255, 255, 255, 0.18);
    color: #ffffff;
    outline: none;
}

.message-text {
    white-space: pre-wrap;
    line-height: 1.36;
}

.message-media-shell {
    position: relative;
    display: inline-block;
    width: fit-content;
    max-width: 100%;
    line-height: 0;
}

.message-image {
    display: block;
    width: min(340px, 68vw);
    max-height: 360px;
    object-fit: contain;
    border-radius: 6px;
}

.message-image.zoomable {
    cursor: zoom-in;
}

.message-image.zoomable:focus {
    outline: 2px solid rgba(83, 189, 235, 0.95);
    outline-offset: 3px;
}

.image-zoom-dialog.e-dialog {
    max-width: 1120px;
    max-height: 820px;
}

.image-zoom-dialog .e-dlg-content {
    padding: 0;
    background: var(--app-image-zoom-bg);
}

.image-zoom-shell {
    --image-zoom-max: 100%;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    height: 100%;
    min-height: 0;
    background: var(--app-image-zoom-bg);
}

.image-zoom-toolbar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    background: var(--app-image-zoom-toolbar-bg);
}

.image-zoom-action.e-btn {
    width: 34px;
    min-width: 34px;
    height: 34px;
    font-size: 1.1rem;
    font-weight: 700;
}

.image-zoom-reset.e-btn {
    min-width: 46px;
    height: 34px;
    padding: 0 10px;
}

.image-zoom-value {
    min-width: 50px;
    color: #ffffff;
    font-size: 0.86rem;
    font-weight: 700;
    text-align: center;
}

.image-zoom-viewport {
    display: grid;
    place-items: center;
    min-height: 0;
    padding: 14px;
    overflow: auto;
}

.image-zoom-preview {
    display: block;
    width: auto;
    height: auto;
    max-width: var(--image-zoom-max);
    max-height: var(--image-zoom-max);
    object-fit: contain;
}

.image-zoom-50 {
    --image-zoom-max: 50%;
}

.image-zoom-75 {
    --image-zoom-max: 75%;
}

.image-zoom-100 {
    --image-zoom-max: 100%;
}

.image-zoom-125 {
    --image-zoom-max: 125%;
}

.image-zoom-150 {
    --image-zoom-max: 150%;
}

.image-zoom-175 {
    --image-zoom-max: 175%;
}

.image-zoom-200 {
    --image-zoom-max: 200%;
}

.image-zoom-225 {
    --image-zoom-max: 225%;
}

.image-zoom-250 {
    --image-zoom-max: 250%;
}

.image-zoom-275 {
    --image-zoom-max: 275%;
}

.image-zoom-300 {
    --image-zoom-max: 300%;
}

.message-video {
    display: block;
    width: min(360px, 70vw);
    max-height: 360px;
    border-radius: 6px;
}

.message-media-download {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 30px;
    height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(17, 27, 33, 0.82);
    color: #ffffff;
    text-decoration: none;
    cursor: pointer;
    line-height: 1;
}

.message-media-download:hover,
.message-media-download:focus {
    background: rgba(32, 44, 51, 0.96);
    color: #ffffff;
    outline: 2px solid rgba(83, 189, 235, 0.78);
    outline-offset: 2px;
}

.message-audio-player {
    display: grid;
    grid-template-columns: 30px minmax(112px, 1fr) 38px 30px;
    align-items: center;
    gap: 8px;
    width: min(360px, 74vw);
    min-height: 54px;
}

.message-audio-button,
.message-audio-download {
    width: 30px;
    height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: #ffffff;
    cursor: pointer;
    text-decoration: none;
}

.message-audio-button:hover,
.message-audio-button:focus,
.message-audio-download:hover,
.message-audio-download:focus {
    background: rgba(255, 255, 255, 0.12);
    outline: none;
    color: #ffffff;
}

.message-audio-track {
    min-width: 0;
    cursor: pointer;
}

.message-audio-waveform {
    --audio-progress: 0%;
    position: relative;
    height: 26px;
    display: grid;
    grid-template-columns: repeat(28, minmax(2px, 1fr));
    align-items: center;
    gap: 2px;
    overflow: hidden;
}

.message-audio-waveform::after {
    content: "";
    position: absolute;
    inset: 0;
    width: var(--audio-progress);
    background: rgba(83, 189, 235, 0.42);
    pointer-events: none;
}

.message-audio-waveform span {
    width: 100%;
    height: 14px;
    border-radius: 2px;
    background: rgba(233, 237, 239, 0.42);
}

.message-audio-waveform span:nth-child(2n) {
    height: 18px;
}

.message-audio-waveform span:nth-child(3n) {
    height: 10px;
}

.message-audio-waveform span:nth-child(5n) {
    height: 22px;
}

.message-audio-waveform span:nth-child(7n) {
    height: 7px;
}

.message-audio-meta {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    color: rgba(233, 237, 239, 0.72);
    font-size: 0.72rem;
    line-height: 1;
}

.message-audio-avatar {
    width: 38px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: #ffffff;
    font-size: 0.74rem;
    font-weight: 700;
    line-height: 1;
    text-transform: uppercase;
}

.message-audio-native {
    display: none;
}

.message-document {
    display: inline-grid;
    grid-template-columns: minmax(0, 1fr) 30px;
    align-items: center;
    gap: 10px;
    width: min(340px, 70vw);
    min-height: 38px;
    padding: 6px 8px 6px 12px;
    border-radius: 6px;
    background: rgba(17, 27, 33, 0.34);
}

.message-document-link {
    min-width: 0;
    overflow: hidden;
    color: #ffffff;
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.message-document-download {
    position: static;
    flex: 0 0 auto;
}

.message-reaction {
    align-self: flex-end;
    padding: 2px 7px;
    border-radius: 10px;
    background: var(--app-reaction-bg);
    color: var(--app-reaction-text);
    font-size: 0.78rem;
}

.message-failed {
    color: #ffb4ab;
    font-weight: 700;
    font-size: 0.78rem;
}

.message-meta {
    align-self: flex-end;
    margin-top: -2px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    min-height: 16px;
    white-space: nowrap;
}

.message-event-time {
    color: rgba(255, 255, 255, 0.68);
    font-size: 0.68rem;
    line-height: 1;
}

.message-whatsapp-status {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    min-height: 16px;
    color: var(--app-message-status-muted);
    font-size: 0.76rem;
    line-height: 1;
    white-space: nowrap;
}

.message-whatsapp-status .wa-message-status-icon {
    display: none;
}

.message-whatsapp-status.sent {
    color: var(--app-message-status-muted);
}

.message-whatsapp-status.delivered {
    color: var(--app-message-delivered);
}

.message-whatsapp-status.read {
    color: var(--app-message-read);
}

.message-whatsapp-status.failed {
    color: #ffb4ab;
}

.empty-chat {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--app-muted);
    text-align: center;
    padding: 24px;
}

.empty-chat.full {
    flex: 1;
}

.login-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
    background: var(--app-login-bg);
}

.login-panel {
    width: min(420px, 100%);
    display: flex;
    flex-direction: column;
    gap: 22px;
    padding: 28px;
    background: var(--app-surface);
    border: 1px solid var(--app-border);
}

.login-brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    text-align: center;
}

.login-logo {
    width: min(100%, 340px);
    height: auto;
    display: block;
    padding: 10px 12px;
    border: 1px solid var(--app-subtle-border);
    border-radius: 6px;
    background: #ffffff;
    object-fit: contain;
}

.login-subtitle {
    color: var(--app-muted);
    font-size: 0.88rem;
}

.login-fields,
.login-actions,
.dialog-stack {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.management-content {
    flex: 1;
    min-height: 0;
    padding: 16px;
}

.template-name {
    font-weight: 700;
    color: var(--app-accent);
}

.company-selector {
    padding: 16px;
    max-width: 420px;
}

.e-toast-container {
    width: min(360px, calc(100vw - 32px)) !important;
}

.e-toast-container .e-toast {
    position: relative;
    width: 100% !important;
    min-height: 76px;
    overflow: hidden;
    border: 1px solid color-mix(in srgb, var(--toast-accent, var(--app-accent)) 28%, var(--app-border));
    border-left: 4px solid var(--toast-accent, var(--app-accent));
    border-radius: 8px;
    background: var(--app-surface);
    color: var(--app-text);
    box-shadow: 0 16px 36px rgba(15, 23, 42, 0.16), 0 2px 8px rgba(15, 23, 42, 0.08);
}

.e-toast-container .e-toast::before {
    content: "i";
    position: absolute;
    top: 15px;
    left: 14px;
    z-index: 1;
    width: 30px;
    height: 30px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: color-mix(in srgb, var(--toast-accent, var(--app-accent)) 14%, transparent);
    color: var(--toast-accent, var(--app-accent));
    font-size: 0.88rem;
    font-weight: 800;
    line-height: 1;
}

.e-toast-container .e-toast .e-toast-message {
    min-height: 0;
    margin: 0;
    padding: 14px 44px 14px 58px;
    color: var(--app-text);
}

.e-toast-container .e-toast .e-toast-title {
    margin: 0 0 4px;
    color: var(--app-heading);
    font-size: 0.92rem;
    font-weight: 700;
    line-height: 1.25;
    letter-spacing: 0;
}

.e-toast-container .e-toast .e-toast-content {
    color: var(--app-muted);
    font-size: 0.84rem;
    line-height: 1.35;
}

.e-toast-container .e-toast .e-toast-close-icon {
    top: 12px;
    right: 12px;
    width: 28px;
    height: 28px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    color: var(--app-muted);
}

.e-toast-container .e-toast .e-toast-close-icon:hover {
    background: var(--app-hover);
    color: var(--app-heading);
}

.e-toast-container .e-toast .e-toast-progress {
    height: 3px;
    background: var(--toast-accent, var(--app-accent));
}

.e-toast-container .e-toast.e-toast-success {
    --toast-accent: #16845b;
}

.e-toast-container .e-toast.e-toast-success::before {
    content: "OK";
    font-size: 0.66rem;
}

.e-toast-container .e-toast.e-toast-info {
    --toast-accent: #0b6f84;
}

.e-toast-container .e-toast.e-toast-warning {
    --toast-accent: var(--app-warning);
}

.e-toast-container .e-toast.e-toast-warning::before {
    content: "!";
}

.e-toast-container .e-toast.e-toast-danger {
    --toast-accent: var(--app-danger);
}

.e-toast-container .e-toast.e-toast-danger::before {
    content: "!";
}

.e-toast-container .e-toast.e-toast-danger .e-toast-title {
    color: var(--app-danger-text);
}

#blazor-error-ui {
    background: var(--app-danger);
    bottom: 0;
    color: #ffffff;
    display: none;
    left: 0;
    padding: 0.75rem 1rem;
    position: fixed;
    width: 100%;
    z-index: 10000;
}

#blazor-error-ui .reload {
    color: #ffffff;
    font-weight: 700;
    margin-left: 1rem;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 1rem;
}

@media (max-width: 760px) {
    .messenger-appbar.e-appbar {
        gap: 6px;
        flex-wrap: wrap;
        min-height: 112px;
    }

    .ban-selector {
        width: 100%;
        min-width: 100%;
        order: 5;
    }

    .contacts-pane {
        height: 100%;
        max-width: 100vw;
        padding-top: 0;
        overflow-x: hidden;
    }

    .messenger-workspace {
        height: calc(100vh - 112px);
        width: 100vw;
        max-width: 100vw;
        background: var(--app-surface);
    }

    .messenger-body {
        min-height: 0;
        height: 100%;
        width: 100%;
        padding: 0;
    }

    .contacts-sidebar.e-sidebar {
        width: 100vw !important;
        max-width: 100vw;
        border-right: 0;
    }

    .contacts-sidebar.e-sidebar .e-sidebar-content {
        width: 100%;
        max-width: 100vw;
        overflow-x: hidden;
    }

    .chat-surface {
        height: 100%;
        border: 0;
    }

    .chat-context {
        align-items: flex-start;
        flex: 0 0 auto;
        flex-direction: column;
        min-height: 0;
    }

    .chat-tools {
        left: 16px;
        right: 58px;
        bottom: 12px;
    }

    .composer-attachment-button,
    .composer-icon-button.e-btn {
        width: 38px;
        min-width: 38px;
        height: 38px;
    }

    .whatsapp-chat.e-chat-ui .e-footer {
        padding-left: 58px;
        padding-right: 108px;
    }

    .whatsapp-chat.e-chat-ui {
        flex: 1 1 auto;
        height: auto !important;
        min-height: 0;
    }

    .whatsapp-chat.e-chat-ui .e-message-wrapper {
        min-height: 0;
    }

    .chat-surface.is-recording .whatsapp-chat.e-chat-ui .e-footer {
        padding-right: 150px;
    }

    .message-content {
        max-width: 82vw;
    }

    .image-zoom-dialog.e-dialog {
        width: 96vw !important;
        height: 88vh !important;
    }

    .image-zoom-toolbar {
        gap: 6px;
        padding: 8px;
    }

    .image-zoom-viewport {
        padding: 8px;
    }
}
