:root {
    --app-bg: #f5f8fc;
    --app-surface: #ffffff;
    --app-surface-soft: #f8fafc;
    --app-primary: #0f766e;
    --app-primary-dark: #0b5f59;
    --app-success: #15803d;
    --app-danger: #dc2626;
    --app-warning: #b45309;
    --app-info: #0369a1;
    --app-text: #172033;
    --app-text-soft: #475569;
    --app-muted: #64748b;
    --app-border: #d9e2ec;
    --app-border-strong: #c8d4e0;
    --app-shadow: 0 10px 26px rgba(15, 23, 42, 0.055);
    --app-radius: 16px;
    --app-radius-sm: 10px;
    --app-input-height: 38px;
    --app-font-size: 13px;
}

@font-face {
    font-family: "Zook";
    src: url("fonts/Zook.ttf") format("truetype");
    font-display: swap;
}

html {
    font-size: 14px;
}

body {
    background:
        linear-gradient(180deg, rgba(15, 118, 110, 0.07), transparent 240px),
        var(--app-bg);
    color: var(--app-text);
    font-family: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
    font-size: var(--app-font-size);
    line-height: 1.42;
    overflow-x: hidden;
}

body.page-inbox {
    height: 100vh;
    overflow: hidden;
    padding-top: 0;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    color: var(--app-text);
    letter-spacing: 0;
}

a {
    color: var(--app-primary);
}

.app-navbar {
    background: rgba(255, 255, 255, 0.84);
    backdrop-filter: blur(14px);
    border: 1px solid rgba(217, 226, 239, 0.92);
    border-radius: 14px;
    box-shadow: 0 10px 26px rgba(15, 23, 42, 0.075);
    left: 50%;
    min-height: 50px;
    position: fixed !important;
    top: 8px;
    transform: translateX(-50%);
    width: min(1360px, calc(100% - 36px));
    z-index: 1030;
}

.app-navbar > .container-fluid {
    min-height: 50px;
    padding-left: 8px !important;
    padding-right: 8px !important;
}

.navbar-brand {
    flex-shrink: 0;
    font-size: 0.9rem;
    font-weight: 800;
    min-width: 150px;
}

.brand-mark {
    align-items: center;
    background: linear-gradient(135deg, var(--app-primary), #2563eb);
    border-radius: 10px;
    box-shadow: 0 6px 14px rgba(37, 99, 235, 0.16);
    color: #fff;
    display: inline-flex;
    font-size: 0.9rem;
    height: 32px;
    justify-content: center;
    padding-right: 0;
    width: 32px;
}

.brand-text {
    color: var(--app-text);
    font-size: 0.86rem;
    font-weight: 800;
}

.app-nav-list {
    flex-wrap: nowrap;
    gap: 4px;
    margin-left: 6px;
    overflow: visible;
    white-space: nowrap;
}

.chat-thread-list::-webkit-scrollbar,
.chat-messages::-webkit-scrollbar {
    display: none;
}

.app-navbar .nav-link {
    align-items: center;
    background: transparent;
    border-bottom: 0;
    border-radius: 9px;
    color: #64748b;
    display: inline-flex;
    font-size: 0.82rem;
    font-weight: 700;
    gap: 6px;
    margin: 0;
    min-height: 34px;
    padding: 7px 9px;
    position: relative;
    white-space: nowrap;
}

.app-navbar .dropdown-toggle::after {
    font-size: 0.68rem;
    margin-left: 6px;
    vertical-align: middle;
}

.app-navbar .nav-link i {
    font-size: 0.96rem;
}

.app-navbar .nav-link:hover {
    background: rgba(15, 118, 110, 0.08);
    color: var(--app-primary);
    transform: translateY(-1px);
}

.app-navbar .dropdown:hover > .dropdown-menu,
.app-navbar .dropdown:focus-within > .dropdown-menu {
    display: block;
    margin-top: 0;
}

.app-navbar .nav-link.active {
    background: #e8f4f2;
    color: var(--app-primary);
}

.app-navbar .nav-link.active::after {
    background: var(--app-primary);
    border-radius: 999px;
    bottom: 4px;
    content: "";
    height: 2px;
    left: 12px;
    position: absolute;
    right: 12px;
}

.org-pill {
    background: #fff;
    border: 1px solid var(--app-border);
    border-radius: 999px;
    color: #475569;
    font-size: 0.8rem;
    font-weight: 800;
    max-width: 210px;
    overflow: hidden;
    padding: 7px 11px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.logout-btn {
    background: #fff;
    border-color: var(--app-border);
    border-radius: 999px;
    color: #0f172a;
    font-size: 0.8rem;
    font-weight: 800;
    min-height: 34px;
    padding: 7px 11px;
}

.logout-btn:hover {
    background: #fff;
    color: var(--app-primary);
}

.app-navbar-toggler {
    background: #fff;
    border: 1px solid var(--app-border);
    border-radius: 12px;
    padding: 0.3rem 0.48rem;
}

.app-navbar .navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%2851,65,85,0.85%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

.app-nav-user {
    flex-shrink: 0;
    margin-left: 8px;
}

.app-more-menu {
    background: rgba(255, 255, 255, 0.97);
    border: 1px solid var(--app-border);
    border-radius: 14px;
    box-shadow: 0 18px 36px rgba(15, 23, 42, 0.10);
    min-width: 220px;
    padding: 8px;
}

.app-more-menu .dropdown-item {
    align-items: center;
    border-radius: 10px;
    color: #475569;
    display: flex;
    font-size: 0.82rem;
    font-weight: 700;
    gap: 10px;
    min-height: 38px;
    padding: 8px 10px;
}

.app-more-menu .dropdown-item i {
    font-size: 0.9rem;
}

.app-more-menu .dropdown-item:hover,
.app-more-menu .dropdown-item.active {
    background: #edf7f5;
    color: var(--app-primary);
}

main.container-fluid {
    max-width: 1600px;
    padding-top: 78px !important;
    overflow-x: hidden;
}

.main-inbox {
    height: calc(100vh - 72px);
    margin-top: 72px;
    max-height: calc(100vh - 72px);
    overflow: hidden;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
}

main.container-fluid.main-inbox {
    padding-top: 0 !important;
}

.page-title {
    font-size: clamp(1.45rem, 1.7vw, 2rem);
    font-weight: 800;
    line-height: 1.08;
    margin-bottom: 5px;
}

.page-subtitle {
    color: var(--app-muted);
    font-size: 0.88rem;
    margin-bottom: 0;
}

.section-title {
    font-size: 0.92rem;
    font-weight: 800;
}

.app-card {
    background: rgba(255, 255, 255, 0.88);
    border: 1px solid var(--app-border);
    border-radius: var(--app-radius);
    box-shadow: var(--app-shadow);
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.app-card:hover {
    border-color: rgba(15, 118, 110, 0.24);
    box-shadow: 0 16px 34px rgba(15, 23, 42, 0.08);
}

.stat-card {
    min-height: 132px;
    padding: 15px;
}

.stat-card-head {
    align-items: center;
    display: flex;
    gap: 10px;
    justify-content: space-between;
}

.stat-icon {
    align-items: center;
    background: linear-gradient(135deg, var(--app-primary), #2563eb);
    border-radius: 12px;
    color: #fff;
    display: inline-flex;
    font-size: 1.02rem;
    height: 36px;
    justify-content: center;
    width: 36px;
}

.stat-status {
    background: #e8f4f2;
    border-radius: 999px;
    color: var(--app-primary);
    font-size: 0.68rem;
    font-weight: 850;
    padding: 4px 8px;
}

.stat-label {
    color: var(--app-muted);
    font-size: 0.78rem;
    font-weight: 750;
    margin-top: 8px;
}

.stat-value {
    font-size: 1.9rem;
    font-weight: 900;
    line-height: 1;
    margin-top: 12px;
}

.stat-note {
    color: var(--app-muted);
    font-size: 0.78rem;
    margin-top: 4px;
}

.alert {
    border-radius: var(--app-radius);
    font-size: 0.88rem;
}

.form-label {
    color: var(--app-text-soft);
    font-size: 0.82rem;
    font-weight: 700;
    margin-bottom: 0.38rem;
}

.form-control,
.form-select {
    background: #fff;
    border: 1px solid var(--app-border);
    border-radius: var(--app-radius-sm);
    color: var(--app-text);
    font-size: 0.86rem;
    min-height: var(--app-input-height);
    padding: 0.44rem 0.7rem;
}

.form-control::placeholder {
    color: #94a3b8;
}

.form-control:focus,
.form-select:focus {
    border-color: rgba(15, 118, 110, 0.46);
    box-shadow: 0 0 0 0.16rem rgba(15, 118, 110, 0.1);
}

textarea.form-control {
    min-height: 96px;
}

.form-control-lg,
.form-select-lg {
    border-radius: var(--app-radius);
    font-size: 0.88rem;
    min-height: 42px;
    padding: 0.5rem 0.78rem;
}

.btn {
    border-radius: var(--app-radius-sm);
    font-size: 0.8rem;
    font-weight: 800;
    min-height: 32px;
    padding: 0.36rem 0.68rem;
    transition: transform 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease, border-color 0.18s ease;
}

.btn-sm {
    font-size: 0.72rem;
    min-height: 26px;
    padding: 0.24rem 0.5rem;
}

.btn-primary {
    background: var(--app-primary);
    border-color: var(--app-primary);
}

.btn-primary:hover,
.btn-primary:focus {
    background: var(--app-primary-dark);
    border-color: var(--app-primary-dark);
    box-shadow: 0 12px 22px rgba(15, 118, 110, 0.16);
    transform: translateY(-1px);
}

.btn-outline-primary {
    color: var(--app-primary);
    border-color: rgba(15, 118, 110, 0.3);
}

.btn-outline-primary:hover {
    background: rgba(15, 118, 110, 0.08);
    border-color: var(--app-primary);
    color: var(--app-primary-dark);
    transform: translateY(-1px);
}

.btn-light.border,
.border.rounded-2 {
    border-color: var(--app-border) !important;
}

.table {
    font-size: 0.84rem;
    margin-bottom: 0;
}

.table thead th {
    border-bottom-color: var(--app-border-strong);
    color: #334155;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0;
    padding: 0.74rem 0.68rem;
    text-transform: uppercase;
    white-space: nowrap;
}

.table td {
    border-color: #edf2f7;
    padding: 0.72rem 0.68rem;
    vertical-align: middle;
}

.table-hover tbody tr:hover {
    background: rgba(15, 118, 110, 0.035);
}

.badge {
    border-radius: 999px;
    font-size: 0.68rem;
    font-weight: 800;
    padding: 0.32rem 0.5rem;
}

.badge-soft {
    background: #e8f7ee;
    color: #166534;
}

.bg-primary {
    background-color: #1d4ed8 !important;
}

.bg-success {
    background-color: #15803d !important;
}

.bg-danger {
    background-color: #dc2626 !important;
}

.bg-secondary {
    background-color: #64748b !important;
}

.bg-info {
    background-color: #67e8f9 !important;
}

.pagination .page-link {
    background: #fff;
    border-color: var(--app-border);
    color: var(--app-primary);
    font-size: 0.8rem;
    min-width: 32px;
    text-align: center;
}

.pagination .page-item.active .page-link {
    background: var(--app-primary) !important;
    border-color: var(--app-primary) !important;
    color: #ffffff !important;
    font-weight: 700;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.pagination .page-item.active .page-link:hover,
.pagination .page-item.active .page-link:focus {
    background: var(--app-primary) !important;
    border-color: var(--app-primary) !important;
    color: #ffffff !important;
}

.pagination .page-item.disabled .page-link {
    background: #f8fafc;
    color: #94a3b8;
}

.progress {
    background: #e7edf4;
    border-radius: 999px;
}

.message-preview {
    background: #f4faf8;
    border: 1px solid #d5ebe1;
    border-radius: var(--app-radius);
    color: var(--app-text);
    font-size: 0.86rem;
    min-height: 80px;
    padding: 12px;
    white-space: pre-wrap;
}

.config-panel {
    background: #f8fcf9;
}

.config-panel .form-label {
    color: #334155;
}

.login-screen {
    align-items: center;
    background: linear-gradient(135deg, #eaf4f3, #f7f9fc 52%, #eef6ff);
    display: flex;
    min-height: 100vh;
}

.login-card {
    border: 1px solid var(--app-border);
    border-radius: 10px;
    box-shadow: 0 20px 48px rgba(15, 23, 42, 0.1);
}

.inbox-shell {
    background: #e8ddd2;
    border: 1px solid var(--app-border);
    border-radius: var(--app-radius);
    box-shadow: var(--app-shadow);
    display: flex;
    height: 100%;
    max-height: 100%;
    min-height: 0;
    overflow: hidden;
    width: 100%;
}

.inbox-sidebar {
    background: #fff;
    border-right: 1px solid #dde5ed;
    display: flex;
    flex: 0 0 312px;
    flex-direction: column;
    height: 100%;
    min-height: 0;
    min-width: 0;
    overflow: hidden;
}

.inbox-sidebar-header {
    align-items: center;
    background: #f0f2f5;
    display: flex;
    min-height: 58px;
    padding: 10px 12px;
    position: sticky;
    top: 0;
    z-index: 3;
}

.inbox-title {
    font-size: 1.05rem;
    font-weight: 800;
    margin: 0;
}

.inbox-subtitle {
    color: var(--app-muted);
    font-size: 0.74rem;
    margin: 0;
}

.inbox-search {
    background: #fff;
    border-bottom: 1px solid #edf0f3;
    padding: 8px 10px;
    position: sticky;
    top: 58px;
    z-index: 2;
}

.inbox-search .form-control {
    background: #f0f2f5;
    border: 0;
    min-height: 34px;
}

.chat-thread-list {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    scrollbar-width: none;
}

.chat-thread {
    color: inherit;
    display: flex;
    gap: 10px;
    min-width: 0;
    padding: 10px 12px;
    text-decoration: none;
    transition: background 0.15s ease;
}

.chat-thread:hover,
.chat-thread.active {
    background: #e9edef;
}

.chat-avatar {
    align-items: center;
    background: #d8f3dc;
    border-radius: 50%;
    color: #166534;
    display: flex;
    flex: 0 0 36px;
    font-size: 0.84rem;
    font-weight: 800;
    height: 36px;
    justify-content: center;
    width: 36px;
}

.chat-avatar.large {
    flex-basis: 40px;
    height: 40px;
    width: 40px;
}

.chat-thread-main {
    border-bottom: 1px solid #edf0f3;
    min-width: 0;
    padding-bottom: 9px;
    width: 100%;
}

.chat-thread-name,
.chat-header-name,
.chat-document-name {
    font-weight: 750;
}

.chat-thread-name,
.chat-header-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.chat-thread-time {
    flex: 0 0 auto;
    white-space: nowrap;
}

.chat-thread-time,
.chat-thread-preview,
.chat-thread-phone,
.chat-header-phone,
.message-meta {
    color: #667085;
    font-size: 0.72rem;
}

.chat-thread-preview,
.chat-thread-phone,
.chat-document-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.unread-badge {
    align-items: center;
    background: #25d366;
    border-radius: 999px;
    color: #063b1f;
    display: inline-flex;
    font-size: 0.7rem;
    font-weight: 800;
    height: 19px;
    justify-content: center;
    min-width: 19px;
    padding: 0 6px;
}

.inbox-conversation {
    display: flex;
    flex: 1;
    flex-direction: column;
    height: 100%;
    min-height: 0;
    min-width: 0;
    overflow: hidden;
}

.chat-header {
    align-items: flex-start;
    background: #f0f2f5;
    border-bottom: 1px solid #d8dee6;
    display: flex;
    gap: 10px;
    min-height: 58px;
    padding: 10px 12px;
    position: sticky;
    top: 0;
    z-index: 3;
}

.chat-messages {
    background-color: #efe7dc;
    background-image: linear-gradient(rgba(255, 255, 255, 0.34), rgba(255, 255, 255, 0.34));
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 16px 18px;
    scrollbar-width: none;
}

.message-row {
    display: flex;
    margin-bottom: 8px;
}

.message-row.incoming {
    justify-content: flex-start;
}

.message-row.outgoing {
    justify-content: flex-end;
}

.message-bubble {
    border-radius: 8px;
    box-shadow: 0 1px 1px rgba(15, 23, 42, 0.08);
    max-width: min(560px, 72%);
    padding: 6px 8px 5px;
}

.message-row.incoming .message-bubble {
    background: #fff;
}

.message-row.outgoing .message-bubble {
    background: #d9fdd3;
}

.message-text {
    font-size: 0.84rem;
    line-height: 1.42;
    white-space: normal;
    word-break: break-word;
}

.message-meta {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    margin-top: 4px;
}

.bot-label {
    background: #e0f2fe;
    border-radius: 999px;
    color: #075985;
    display: inline-block;
    font-size: 0.64rem;
    font-weight: 800;
    margin-bottom: 6px;
    padding: 2px 7px;
}

.form-check-input:checked {
    background-color: var(--app-primary);
    border-color: var(--app-primary);
}

.chat-media-image {
    border-radius: 7px;
    display: block;
    max-height: 260px;
    max-width: 100%;
    object-fit: cover;
}

.chat-media-video {
    border-radius: 7px;
    display: block;
    max-height: 260px;
    max-width: 100%;
    width: 300px;
}

.chat-media-audio {
    display: block;
    max-width: 100%;
    width: 260px;
}

.chat-audio-label {
    color: #344054;
    font-size: 0.76rem;
    font-weight: 750;
    margin-bottom: 6px;
}

.chat-document {
    align-items: center;
    display: flex;
    gap: 10px;
    min-width: 220px;
}

.chat-document-icon {
    align-items: center;
    background: #eef2ff;
    border-radius: 8px;
    color: #3730a3;
    display: flex;
    flex: 0 0 42px;
    font-size: 0.72rem;
    font-weight: 900;
    height: 42px;
    justify-content: center;
}

.chat-inline-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.chat-inline-button {
    align-items: center;
    background: #f8fbff;
    border: 1px solid #c8dafd;
    border-radius: 999px;
    color: #31559c;
    display: inline-flex;
    font-size: 0.74rem;
    font-weight: 700;
    line-height: 1;
    min-height: 24px;
    padding: 0.24rem 0.62rem;
}

.chat-compose {
    align-items: center;
    background: #f0f2f5;
    display: flex;
    flex-shrink: 0;
    gap: 0;
    min-height: 70px;
    position: sticky;
    bottom: 0;
    padding: 12px 14px;
    width: 100%;
    z-index: 3;
}

.chat-compose::before {
    background: #fff;
    border-radius: 999px;
    box-shadow: 0 1px 4px rgba(15, 23, 42, 0.08);
    content: "";
    inset: 12px 14px;
    position: absolute;
    z-index: 0;
}

.chat-compose > * {
    position: relative;
    z-index: 1;
}

.chat-compose.is-disabled {
    background: #f6f7f9;
    opacity: 0.96;
}

.chat-compose .form-control {
    background: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    color: #374151;
    flex: 1 1 auto;
    min-width: 0;
    min-height: 44px;
    padding-left: 12px;
    padding-right: 12px;
}

.chat-compose .form-control:focus {
    box-shadow: none;
}

.chat-compose.is-disabled .form-control,
.chat-compose.is-disabled .btn,
.chat-compose.is-disabled .attach-button,
.chat-compose.is-disabled .emoji-button,
.chat-compose.is-disabled .voice-record-button {
    cursor: not-allowed;
}

.chat-compose .btn {
    border-radius: 999px;
    min-height: 44px;
    padding-left: 0;
    padding-right: 0;
}

.chat-compose.is-recording-voice {
    background: #f0f2f5;
    gap: 8px;
    min-height: 70px;
}

.chat-compose.is-recording-voice::before {
    display: none;
}

.attach-button {
    align-items: center;
    background: transparent;
    border: 0;
    border-radius: 999px;
    color: #0b141a;
    cursor: pointer;
    display: flex;
    flex: 0 0 46px;
    font-size: 2rem;
    font-weight: 400;
    height: 54px;
    justify-content: center;
    margin: 0;
    padding-bottom: 3px;
    width: 46px;
}

.attach-button input {
    display: none;
}

.emoji-button {
    align-items: center;
    background: transparent;
    border: 0;
    color: #0b141a;
    cursor: pointer;
    display: flex;
    flex: 0 0 38px;
    height: 54px;
    justify-content: center;
    padding: 0;
    position: relative;
    width: 38px;
}

.emoji-button::before {
    border: 3px solid currentColor;
    border-radius: 999px;
    box-shadow: inset -5px -7px 0 -6px currentColor, inset 5px -7px 0 -6px currentColor;
    content: "";
    display: block;
    height: 24px;
    width: 24px;
}

.emoji-button::after {
    border-bottom: 3px solid currentColor;
    border-radius: 0 0 999px 999px;
    content: "";
    height: 8px;
    position: absolute;
    top: 27px;
    width: 11px;
}

.voice-record-button {
    align-items: center;
    background: transparent;
    border: 0;
    border-radius: 999px;
    box-shadow: none;
    color: #0b141a;
    cursor: pointer;
    display: flex;
    flex: 0 0 54px;
    height: 54px;
    justify-content: center;
    padding: 0;
    width: 54px;
}

.chat-compose.is-recording-voice .attach-button,
.chat-compose.is-recording-voice .emoji-button,
.chat-compose.is-recording-voice .form-control,
.chat-compose.is-recording-voice .voice-record-button {
    display: none;
}

.chat-compose:not(.has-send-content):not(.is-recording-voice) .btn[type="submit"] {
    display: none;
}

.chat-compose.has-send-content:not(.is-recording-voice) .voice-record-button {
    display: none;
}

.chat-compose.has-send-content:not(.is-recording-voice) .form-control {
    border-radius: 0 999px 999px 0;
}

.chat-compose.has-send-content:not(.is-recording-voice) .btn[type="submit"] {
    align-items: center;
    background: #128c7e;
    border: 0;
    border-color: #128c7e;
    display: flex;
    flex: 0 0 54px;
    font-size: 0;
    height: 54px;
    justify-content: center;
    min-height: 54px;
    width: 54px;
}

.chat-compose.has-send-content:not(.is-recording-voice) .btn[type="submit"]::before {
    border-bottom: 8px solid transparent;
    border-left: 17px solid #fff;
    border-top: 8px solid transparent;
    content: "";
    display: block;
    margin-left: 4px;
}

.chat-compose.is-recording-voice .btn[type="submit"] {
    align-items: center;
    background: #1daa61;
    border-color: #1daa61;
    border-radius: 999px;
    display: flex;
    flex: 0 0 52px;
    font-size: 0;
    height: 52px;
    justify-content: center;
    min-height: 52px;
    padding: 0;
    width: 52px;
}

.chat-compose.is-recording-voice .btn[type="submit"]::before {
    border-bottom: 9px solid transparent;
    border-left: 18px solid #fff;
    border-top: 9px solid transparent;
    content: "";
    display: block;
    margin-left: 4px;
}

.voice-record-button:disabled {
    opacity: 0.6;
}

.voice-record-button:hover {
    background: transparent;
    color: #0b141a;
}

.voice-record-icon {
    background: currentColor;
    border-radius: 8px 8px 10px 10px;
    display: block;
    height: 16px;
    position: relative;
    width: 10px;
}

.voice-record-icon::before {
    border: 2px solid currentColor;
    border-top: 0;
    border-radius: 0 0 10px 10px;
    bottom: -5px;
    content: "";
    height: 9px;
    left: 50%;
    position: absolute;
    transform: translateX(-50%);
    width: 18px;
}

.voice-record-icon::after {
    background: currentColor;
    bottom: -8px;
    content: "";
    height: 2px;
    left: 50%;
    position: absolute;
    transform: translateX(-50%);
    width: 14px;
}

.voice-record-button.is-recording {
    animation: micButtonPulse 1.1s ease-in-out infinite;
    background: transparent;
    border-color: transparent;
    box-shadow: 0 0 0 6px rgba(220, 38, 38, 0.14);
    color: #dc2626;
}

.voice-recording-panel {
    align-items: center;
    background: #fff;
    border: 0;
    border-radius: 999px;
    box-shadow: 0 1px 4px rgba(15, 23, 42, 0.12);
    color: #111827;
    display: flex;
    flex: 1 1 auto;
    gap: 14px;
    height: 54px;
    min-height: 54px;
    min-width: 0;
    padding: 0 18px;
    white-space: nowrap;
}

.voice-recording-delete,
.voice-recording-stop {
    align-items: center;
    border: 0;
    border-radius: 999px;
    cursor: pointer;
    display: flex;
    flex: 0 0 44px;
    height: 44px;
    justify-content: center;
    padding: 0;
    position: relative;
    width: 44px;
}

.voice-recording-delete {
    background: #f5f6f6;
    color: #111827;
}

.voice-recording-delete::before {
    border: 3px solid currentColor;
    border-top-width: 4px;
    border-radius: 2px;
    content: "";
    height: 18px;
    width: 14px;
}

.voice-recording-delete::after {
    background: currentColor;
    border-radius: 999px;
    content: "";
    height: 3px;
    left: 14px;
    position: absolute;
    top: 10px;
    width: 16px;
}

.voice-recording-dot {
    animation: voicePulse 1s ease-in-out infinite;
    background: #c70d3a;
    border-radius: 999px;
    flex: 0 0 14px;
    height: 14px;
    width: 14px;
}

.voice-recording-panel [data-voice-status] {
    color: #111827;
    flex: 0 0 auto;
    font-size: 1.35rem;
    font-weight: 500;
    letter-spacing: 0;
}

.voice-recording-waveform {
    align-items: center;
    display: flex;
    flex: 1 1 auto;
    gap: 2px;
    justify-content: flex-end;
    min-width: 80px;
    overflow: hidden;
}

.voice-recording-waveform span {
    animation: voiceWave 1.05s ease-in-out infinite;
    background: #6b7280;
    border-radius: 999px;
    display: block;
    flex: 0 0 3px;
    height: 13px;
    opacity: 0.9;
}

.voice-recording-waveform span:nth-child(2n) {
    height: 18px;
}

.voice-recording-waveform span:nth-child(3n) {
    height: 23px;
}

.voice-recording-waveform span:nth-child(4n) {
    height: 8px;
}

.voice-recording-waveform span:nth-child(5n) {
    height: 16px;
}

.voice-recording-waveform span:nth-child(1) { animation-delay: -0.05s; }
.voice-recording-waveform span:nth-child(2) { animation-delay: -0.18s; }
.voice-recording-waveform span:nth-child(3) { animation-delay: -0.31s; }
.voice-recording-waveform span:nth-child(4) { animation-delay: -0.44s; }
.voice-recording-waveform span:nth-child(5) { animation-delay: -0.57s; }
.voice-recording-waveform span:nth-child(6) { animation-delay: -0.7s; }

.voice-recording-stop {
    background: transparent;
    color: #c70d3a;
}

.voice-recording-stop::before,
.voice-recording-stop::after {
    background: currentColor;
    border-radius: 999px;
    content: "";
    height: 21px;
    width: 6px;
}

.voice-recording-stop::before {
    margin-right: 6px;
}

@keyframes voicePulse {
    0%, 100% {
        opacity: 0.45;
        transform: scale(0.85);
    }
    50% {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes voiceWave {
    0%, 100% {
        transform: scaleY(0.55);
    }
    50% {
        transform: scaleY(1);
    }
}

@keyframes micButtonPulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.06);
    }
}

.chat-window-alert {
    align-items: center;
    background: #fff7ed;
    border-top: 1px solid #fed7aa;
    color: #9a3412;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: space-between;
    padding: 10px 14px;
}

.empty-chat-state {
    align-items: center;
    background: #f8fafc;
    color: var(--app-muted);
    display: flex;
    flex: 1;
    flex-direction: column;
    justify-content: center;
    text-align: center;
}

.empty-chat-icon {
    align-items: center;
    background: #d9fdd3;
    border-radius: 999px;
    color: #166534;
    display: flex;
    font-size: 0.96rem;
    font-weight: 900;
    height: 78px;
    justify-content: center;
    margin-bottom: 16px;
    width: 78px;
}

@media (max-width: 991.98px) {
    .app-navbar .nav-link {
        border-bottom: 0;
        border-radius: 8px;
        min-height: 40px;
        padding: 9px 10px;
    }

    .org-pill,
    .logout-btn {
        width: 100%;
    }

    .org-pill {
        border-radius: var(--app-radius-sm);
        max-width: none;
        text-align: center;
    }

    .app-nav-list {
        flex-wrap: wrap;
        margin-left: 0;
        overflow: visible;
        padding-top: 8px;
        white-space: normal;
    }

    .brand-mark {
        border-right: 0;
        padding-right: 0;
    }

    .inbox-shell {
        flex-direction: column;
        height: 100%;
        max-height: 100%;
        min-height: 0;
    }

    .inbox-sidebar {
        flex: none;
        max-height: 280px;
    }

    .inbox-conversation {
        min-height: 0;
    }

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

    .chat-header {
        align-items: flex-start;
        flex-wrap: wrap;
    }

    .chat-header-actions {
        align-items: stretch;
        flex: 1 1 100%;
        margin-left: 0;
        max-width: none;
        width: 100%;
    }

    .chat-assignment-form.compact {
        grid-template-columns: 1fr;
        width: 100%;
    }

    .chat-header-badges {
        justify-content: flex-start;
    }
}

.permission-grid {
    display: grid;
    gap: 10px;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
}

.permission-item {
    align-items: flex-start;
    background: #f8fbff;
    border: 1px solid #d6dfef;
    border-radius: 12px;
    color: #244066;
    display: flex;
    font-size: 13px;
    gap: 8px;
    padding: 10px 12px;
}

.permission-item input {
    margin-top: 3px;
}

.inbox-filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding: 8px 14px 14px;
}

.inbox-filter-pill {
    align-items: center;
    background: #fff;
    border: 1px solid #d7dee9;
    border-radius: 999px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03);
    color: #526581;
    display: inline-flex;
    font-size: 12px;
    font-weight: 600;
    min-height: 34px;
    padding: 6px 14px;
    text-decoration: none;
    transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
    white-space: nowrap;
}

.inbox-filter-pill.active {
    background: #d9f7d7;
    border-color: #a9d7a4;
    box-shadow: 0 4px 12px rgba(47, 133, 90, 0.10);
    color: #1f7a44;
}

.inbox-filter-pill:hover {
    border-color: #bdd0e6;
    color: #27466f;
    text-decoration: none;
}

.inbox-filter-bar .dropdown-toggle::after {
    font-size: 10px;
    margin-left: 6px;
    vertical-align: middle;
}

.inbox-filter-menu {
    border: 1px solid #d7dee9;
    border-radius: 16px;
    box-shadow: 0 14px 28px rgba(15, 23, 42, 0.10);
    padding: 8px;
}

.inbox-filter-menu .dropdown-item {
    border-radius: 12px;
    color: #526581;
    font-size: 13px;
    font-weight: 600;
    padding: 9px 12px;
}

.inbox-filter-menu .dropdown-item.active,
.inbox-filter-menu .dropdown-item:active {
    background: #d9f7d7;
    color: #1f7a44;
}

.chat-assignee-mini {
    background: #eef4ff;
    border-radius: 999px;
    color: #2455d7;
    font-size: 11px;
    line-height: 1;
    padding: 4px 8px;
    white-space: nowrap;
}

.chat-assignee-unassigned {
    background: #f1f5f9;
    color: #64748b;
}

.app-notification-dropdown .dropdown-toggle::after {
    display: none;
}

.notification-bell-btn {
    align-items: center;
    background: #fff;
    border: 1px solid #d9e4f2;
    border-radius: 14px;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.04);
    color: #20324a;
    display: inline-flex;
    font-size: 16px;
    height: 38px;
    justify-content: center;
    transition: background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, color 0.2s ease;
    width: 42px;
}

.notification-bell-btn:hover,
.notification-bell-btn:focus {
    background: #f8fbff;
    border-color: #c8d7eb;
    box-shadow: 0 10px 24px rgba(36, 85, 215, 0.08);
    color: #1847c7;
}

.notification-count-badge {
    align-items: center;
    background: #ef4444;
    border: 2px solid #fff;
    border-radius: 999px;
    color: #fff;
    display: inline-flex;
    font-size: 10px;
    font-weight: 800;
    height: 19px;
    justify-content: center;
    min-width: 19px;
    padding: 0 5px;
    position: absolute;
    right: -5px;
    top: -6px;
}

.app-notification-menu {
    background: #fff;
    border: 1px solid #d9e4f2;
    border-radius: 20px;
    box-shadow: 0 24px 48px rgba(15, 23, 42, 0.14);
    margin-top: 12px;
    min-width: 360px;
    max-width: 380px;
    overflow: hidden;
    padding: 0 0 6px;
}

.app-notification-header {
    align-items: center;
    border-bottom: 1px solid #edf2f8;
    display: flex;
    font-size: 15px;
    font-weight: 700;
    justify-content: space-between;
    padding: 14px 16px 12px;
    color: #16263d;
}

.app-notification-empty {
    color: #64748b;
    font-size: 13px;
    padding: 18px 16px 14px;
}

.app-notification-item {
    border-bottom: 1px solid #f1f5f9;
    margin: 6px 8px 0;
    border-radius: 16px;
    padding: 12px 12px 11px;
    white-space: normal;
    transition: background 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
    position: relative;
    white-space: normal;
}

.app-notification-item:last-child {
    border-bottom: 0;
}

.app-notification-item.unread {
    background: #f8fbff;
    box-shadow: inset 3px 0 0 #2455d7;
}

.app-notification-item:hover,
.app-notification-item:focus {
    background: #f8fbff;
    transform: translateY(-1px);
}

.app-notification-item::after {
    content: '';
    position: absolute;
    left: 12px;
    top: 14px;
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: #dbe4f2;
}

.app-notification-item.unread::after {
    background: #2455d7;
}

.app-notification-title {
    color: #16263d;
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 5px;
    padding-left: 16px;
}

.app-notification-message {
    color: #526581;
    font-size: 12px;
    line-height: 1.4;
    margin-bottom: 8px;
    padding-left: 16px;
}

.app-notification-meta {
    align-items: center;
    color: #7b8798;
    display: flex;
    font-size: 11px;
    justify-content: space-between;
    padding-left: 16px;
}

.app-notification-open {
    color: #2455d7;
    font-weight: 700;
    padding: 5px 8px;
    border-radius: 999px;
    background: #eef4ff;
    line-height: 1;
}

.chat-assignment-bar {
    background: #f7fbff;
    border-bottom: 1px solid #d9e3f1;
    padding: 10px 16px;
}

.chat-assignment-form {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.chat-header-actions {
    align-items: center;
    display: flex;
    flex: 0 0 auto;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: flex-end;
    margin-left: auto;
    max-width: 760px;
    width: auto;
}

.chat-header-badges {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-end;
}

.chat-thread-toggle-form {
    align-items: center;
    display: flex;
    flex: 0 0 auto;
}

.chat-thread-toggle-form .btn {
    white-space: nowrap;
}

.chat-assignment-form.compact {
    display: grid;
    gap: 8px;
    grid-template-columns: minmax(0, 1fr) 112px auto;
    justify-content: flex-end;
    width: 440px;
}

.chat-assignment-form.compact .form-select {
    background: #fff;
    max-width: none;
    min-width: 0;
}

.chat-assignment-form.compact .btn {
    min-height: 34px;
    padding: 7px 12px;
}

.chat-assignment-form .form-select {
    max-width: 320px;
    min-width: 180px;
}

.chat-header > .flex-grow-1 {
    min-width: 0;
    padding-top: 4px;
}

.campaign-progress-wrap {
    min-width: min(460px, 100%);
}

.campaign-progress {
    height: 12px;
}

.metric-card {
    background: #f8fbff;
    border: 1px solid #d9e4f2;
    border-radius: 16px;
    height: 100%;
    padding: 14px 16px;
}

.stat-card-link {
    color: inherit;
    display: block;
    text-decoration: none;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.stat-card-link:hover,
.stat-card-link:focus {
    border-color: #bfd3f2;
    box-shadow: 0 16px 30px rgba(36, 85, 215, 0.08);
    color: inherit;
    text-decoration: none;
    transform: translateY(-2px);
}

.metric-label {
    color: #64748b;
    font-size: 12px;
    font-weight: 700;
    margin-bottom: 4px;
    text-transform: uppercase;
}

.metric-value {
    color: #16324f;
    font-size: 24px;
    font-weight: 800;
    line-height: 1.1;
}

.campaign-meta-line {
    color: #475569;
    font-size: 13px;
    margin-bottom: 4px;
}

.app-toast-stack {
    bottom: 18px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
    position: fixed;
    left: 18px;
    width: min(340px, calc(100vw - 24px));
    z-index: 1400;
}

.app-toast {
    align-items: center;
    backdrop-filter: blur(10px);
    background: rgba(255, 255, 255, 0.98);
    border: 1px solid #d9e4f2;
    border-left: 5px solid #2455d7;
    border-radius: 18px;
    box-shadow: 0 14px 28px rgba(31, 41, 55, 0.12);
    display: flex;
    gap: 10px;
    min-height: 58px;
    opacity: 1;
    padding: 12px 14px;
    pointer-events: auto;
    transform: translateX(0);
    transition: opacity 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}

.app-toast.is-entering {
    opacity: 0;
    transform: translateX(-24px);
}

.app-toast.is-hiding {
    opacity: 0;
    transform: translateX(-24px);
}

.app-toast-icon {
    align-items: center;
    border-radius: 999px;
    display: inline-flex;
    flex: 0 0 34px;
    font-size: 16px;
    height: 34px;
    justify-content: center;
    width: 34px;
}

.app-toast-body {
    color: #233754;
    flex: 1;
    font-size: 15px;
    font-weight: 600;
    letter-spacing: 0;
    line-height: 1.35;
}

.app-toast-close {
    align-items: center;
    background: transparent;
    border: 0;
    border-radius: 999px;
    color: #7a8ba6;
    display: inline-flex;
    flex: 0 0 28px;
    font-size: 13px;
    height: 28px;
    justify-content: center;
    padding: 0;
    transition: background 0.2s ease, color 0.2s ease;
    width: 28px;
}

.app-toast-close:hover {
    background: rgba(15, 23, 42, 0.05);
    color: #12253f;
}

.app-toast-success {
    border-left-color: #1fb35d;
}

.app-toast-success .app-toast-icon {
    background: #d9f7e4;
    color: #15803d;
}

.app-toast-danger {
    border-left-color: #dc2626;
}

.app-toast-danger .app-toast-icon {
    background: #fee2e2;
    color: #dc2626;
}

.app-toast-warning {
    border-left-color: #f59e0b;
}

.app-toast-warning .app-toast-icon {
    background: #fef3c7;
    color: #d97706;
}

.app-toast-info {
    border-left-color: #2563eb;
}

.app-toast-info .app-toast-icon {
    background: #dbeafe;
    color: #2563eb;
}

@media (max-width: 575.98px) {
    body.page-inbox {
        height: 100dvh;
        min-height: 100dvh;
    }

    .main-inbox {
        height: calc(100dvh - 72px);
        margin-top: 72px;
        max-height: calc(100dvh - 72px);
        padding: 0 !important;
    }

    .inbox-shell {
        border: 0;
        border-radius: 0;
        box-shadow: none;
    }

    .inbox-sidebar {
        border-bottom: 1px solid #dde5ed;
        border-right: 0;
        max-height: clamp(196px, 35dvh, 250px);
        width: 100%;
    }

    .inbox-sidebar-header {
        min-height: 48px;
        padding: 8px 10px;
    }

    .inbox-title {
        font-size: 0.98rem;
    }

    .inbox-search {
        padding: 7px 10px;
        top: 48px;
    }

    .inbox-filter-bar {
        flex-wrap: nowrap;
        gap: 8px;
        overflow-x: auto;
        padding: 7px 10px 9px;
        scrollbar-width: none;
    }

    .inbox-filter-bar::-webkit-scrollbar {
        display: none;
    }

    .inbox-filter-pill {
        min-height: 30px;
        padding: 5px 12px;
    }

    .chat-thread {
        gap: 8px;
        padding: 8px 10px;
    }

    .chat-avatar {
        flex-basis: 32px;
        height: 32px;
        width: 32px;
    }

    .chat-avatar.large {
        flex-basis: 34px;
        height: 34px;
        width: 34px;
    }

    .chat-thread-main {
        padding-bottom: 7px;
    }

    .chat-thread-main .d-flex {
        min-width: 0;
    }

    .chat-thread-preview,
    .chat-thread-phone {
        min-width: 0;
    }

    .chat-assignee-mini {
        max-width: 92px;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .inbox-conversation {
        flex: 1 1 auto;
        min-height: 0;
    }

    .chat-header {
        gap: 8px;
        min-height: 50px;
        padding: 8px 10px;
    }

    .chat-header-actions {
        gap: 8px;
        min-width: 0;
    }

    .chat-header-badges {
        gap: 6px;
    }

    .chat-header-badges .badge {
        max-width: 100%;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .chat-thread-toggle-form,
    .chat-thread-toggle-form .btn,
    .chat-assignment-form.compact .btn {
        width: 100%;
    }

    .chat-assignment-form.compact {
        gap: 6px;
    }

    .chat-assignment-form.compact .form-select,
    .chat-assignment-form .form-select {
        max-width: none;
        min-width: 0;
        width: 100%;
    }

    .chat-messages {
        padding: 10px;
    }

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

    .chat-media-audio,
    .chat-media-video {
        width: min(260px, 100%);
    }

    .chat-document {
        min-width: 0;
    }

    .chat-window-alert {
        align-items: stretch;
        display: block;
        padding: 9px 10px;
    }

    .chat-window-alert .btn {
        max-width: 100%;
        white-space: normal;
    }

    .chat-compose {
        gap: 0;
        min-height: 66px;
        padding: 8px;
    }

    .chat-compose::before {
        inset: 8px;
    }

    .attach-button {
        flex-basis: 44px;
        height: 50px;
        width: 44px;
    }

    .emoji-button {
        flex-basis: 36px;
        height: 50px;
        width: 36px;
    }

    .chat-compose .btn {
        min-height: 50px;
        padding-left: 12px;
        padding-right: 12px;
    }
}

@media (max-width: 767.98px) {
    .app-toast-stack {
        bottom: 16px;
        left: 16px;
        right: auto;
        width: auto;
    }

    .app-toast {
        border-radius: 16px;
        min-height: 54px;
        padding: 11px 13px;
    }

    .app-toast-body {
        font-size: 14px;
    }
}

@media (max-width: 767.98px) {
    html,
    body.page-inbox {
        max-width: 100%;
        overflow: hidden;
        width: 100%;
    }

    body.page-inbox {
        height: 100dvh;
        min-height: 100dvh;
    }

    .main-inbox {
        height: calc(100dvh - 72px);
        margin-top: 72px;
        max-height: calc(100dvh - 72px);
        max-width: 100vw;
        overflow: hidden;
        padding: 0 !important;
        width: 100vw;
    }

    .inbox-shell,
    .inbox-sidebar,
    .inbox-conversation,
    .chat-header,
    .chat-messages,
    .chat-compose {
        box-sizing: border-box;
        max-width: 100%;
        min-width: 0;
        width: 100%;
    }

    .inbox-shell,
    .inbox-conversation,
    .chat-header,
    .chat-messages {
        overflow-x: hidden;
    }

    .inbox-shell {
        border: 0;
        border-radius: 0;
        box-shadow: none;
        height: 100%;
    }

    .inbox-sidebar {
        border-bottom: 1px solid #dde5ed;
        border-right: 0;
        flex: 0 0 auto;
        max-height: 34dvh;
        min-height: 185px;
    }

    .page-inbox .inbox-sidebar {
        border-bottom: 0;
        flex: 1 1 auto;
        height: 100%;
        max-height: none;
        min-height: 0;
    }

    .page-inbox .chat-thread-list {
        flex: 1 1 auto;
        min-height: 0;
    }

    .page-inbox .inbox-conversation {
        display: none;
    }

    .chat-thread,
    .chat-thread-main,
    .chat-thread-main .d-flex,
    .chat-thread-preview,
    .chat-thread-phone,
    .chat-thread-name {
        max-width: 100%;
        min-width: 0;
    }

    .chat-thread-name,
    .chat-thread-preview,
    .chat-thread-phone {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .chat-header {
        align-items: center;
        display: grid;
        gap: 8px;
        grid-template-columns: 34px minmax(0, 1fr);
        min-height: 50px;
        padding: 8px 10px;
    }

    .chat-header > .flex-grow-1 {
        max-width: 100%;
        min-width: 0;
        padding-top: 0;
    }

    .chat-header-actions {
        display: grid;
        flex: none;
        gap: 7px;
        grid-column: 1 / -1;
        grid-template-columns: minmax(0, 1fr);
        margin-left: 0;
        max-width: 100%;
        min-width: 0;
        width: 100%;
    }

    .chat-header-badges {
        justify-content: flex-start;
        max-width: 100%;
        min-width: 0;
    }

    .chat-header-badges .badge {
        max-width: 100%;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .chat-thread-toggle-form,
    .chat-assignment-form.compact {
        display: grid;
        flex: none;
        grid-template-columns: minmax(0, 1fr);
        max-width: 100%;
        min-width: 0;
        width: 100%;
    }

    .chat-thread-toggle-form .btn,
    .chat-assignment-form.compact .btn,
    .chat-assignment-form.compact .form-select,
    .chat-assignment-form .form-select {
        display: block;
        max-width: 100%;
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        width: 100%;
    }

    .chat-messages {
        padding: 10px;
    }

    .message-row,
    .message-bubble,
    .message-text,
    .message-meta,
    .chat-document,
    .chat-document > div,
    .chat-document-name,
    .chat-inline-buttons {
        max-width: 100%;
        min-width: 0;
    }

    .message-bubble {
        overflow: hidden;
        width: fit-content;
    }

    .message-row.incoming .message-bubble,
    .message-row.outgoing .message-bubble {
        max-width: calc(100vw - 34px);
    }

    .chat-document {
        align-items: flex-start;
        gap: 8px;
    }

    .chat-document-icon {
        flex: 0 0 34px;
        height: 34px;
        width: 34px;
    }

    .chat-document-name {
        white-space: normal;
        word-break: break-word;
    }

    .chat-inline-button {
        max-width: 100%;
        white-space: normal;
    }

    .chat-media-image,
    .chat-media-video,
    .chat-media-audio {
        max-width: 100%;
        width: 100%;
    }

    .message-meta {
        flex-wrap: wrap;
    }

    .chat-window-alert {
        align-items: stretch;
        display: grid;
        gap: 7px;
        grid-template-columns: minmax(0, 1fr);
        max-width: 100%;
        overflow-x: hidden;
        padding: 9px 10px;
    }

    .chat-window-alert .btn {
        max-width: 100%;
        white-space: normal;
        width: 100%;
    }

    .chat-compose {
        gap: 0;
        min-height: 66px;
        overflow-x: hidden;
        padding: 8px;
    }

    .chat-compose::before {
        inset: 8px;
    }

    .chat-compose .form-control {
        flex: 1 1 auto;
        min-width: 0;
    }

    .attach-button {
        flex: 0 0 42px;
        height: 50px;
        width: 42px;
    }

    .emoji-button {
        flex: 0 0 34px;
        height: 50px;
        width: 34px;
    }

    .voice-record-button {
        flex: 0 0 48px;
        height: 50px;
        width: 48px;
    }

    .voice-recording-panel {
        order: 5;
        width: 100%;
    }

    .chat-compose.is-recording-voice .voice-recording-panel {
        order: 0;
        width: auto;
    }

    .chat-compose.is-recording-voice .btn[type="submit"] {
        flex: 0 0 48px;
        height: 48px;
        min-height: 48px;
        width: 48px;
    }

    .chat-compose.has-send-content:not(.is-recording-voice) .btn[type="submit"] {
        flex: 0 0 50px;
        height: 50px;
        min-height: 50px;
        width: 50px;
    }

    .chat-compose .btn {
        flex: 0 0 auto;
        min-height: 50px;
        padding-left: 12px;
        padding-right: 12px;
    }
}

.global-page-loader {
    align-items: center;
    background:
        radial-gradient(circle at 50% 45%, rgba(15, 118, 110, 0.16), transparent 24rem),
        rgba(245, 248, 252, 0.72);
    backdrop-filter: blur(10px);
    display: flex;
    inset: 0;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    position: fixed;
    transition: opacity 0.18s ease, visibility 0.18s ease;
    visibility: hidden;
    z-index: 3000;
}

.global-page-loader.is-visible {
    opacity: 1;
    pointer-events: auto;
    visibility: visible;
}

.global-loader-card {
    align-items: center;
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid rgba(217, 226, 239, 0.95);
    border-radius: 18px;
    box-shadow: 0 22px 60px rgba(15, 23, 42, 0.14);
    display: flex;
    gap: 13px;
    min-width: 250px;
    padding: 16px 18px;
    transform: translateY(8px) scale(0.98);
    transition: transform 0.18s ease;
}

.global-page-loader.is-visible .global-loader-card {
    transform: translateY(0) scale(1);
}

.global-loader-mark {
    align-items: center;
    background:
        radial-gradient(circle at 30% 20%, rgba(255, 255, 255, 0.34), transparent 34%),
        linear-gradient(135deg, var(--app-primary), #2563eb);
    border-radius: 14px;
    color: #fff;
    display: flex;
    flex: 0 0 42px;
    height: 42px;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.global-loader-mark::after {
    animation: global-loader-spin 0.8s linear infinite;
    border: 2px solid rgba(255, 255, 255, 0.34);
    border-top-color: #fff;
    border-radius: 999px;
    content: "";
    inset: -5px;
    position: absolute;
}

.global-loader-mark::before {
    animation: global-loader-shine 1.2s ease-in-out infinite;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.48), transparent);
    content: "";
    height: 100%;
    left: -70%;
    position: absolute;
    top: 0;
    transform: skewX(-18deg);
    width: 52%;
}

.global-loader-letter {
    animation: global-loader-letter-pulse 0.9s ease-in-out infinite;
    font-family: "Zook", Georgia, "Times New Roman", serif;
    font-size: 1.95rem;
    font-style: normal;
    font-weight: 400;
    line-height: 1;
    position: relative;
    text-shadow: 0 4px 12px rgba(0, 0, 0, 0.18);
    z-index: 1;
}

.global-loader-copy {
    display: grid;
    gap: 2px;
}

.global-loader-copy strong {
    color: var(--app-text);
    font-family: "Zook", Georgia, "Times New Roman", serif;
    font-size: 1rem;
    font-style: normal;
    font-weight: 400;
    letter-spacing: 0.04em;
    line-height: 1.1;
}

.global-loader-copy span {
    color: var(--app-muted);
    font-size: 0.78rem;
}

@keyframes global-loader-spin {
    to {
        transform: rotate(360deg);
    }
}

@keyframes global-loader-shine {
    0% {
        left: -70%;
    }
    55%,
    100% {
        left: 120%;
    }
}

@keyframes global-loader-letter-pulse {
    0%,
    100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.08);
    }
}
