@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700&display=swap');

:root {
    --messenger-ink: #17212b;
    --messenger-muted: #72808d;
    --messenger-line: #e8edf1;
    --messenger-surface: #ffffff;
    --messenger-canvas: #f3f6f8;
    --messenger-primary: #167c80;
    --messenger-primary-dark: #0f6265;
    --messenger-outgoing: #d9f4e8;
    --messenger-incoming: #ffffff;
    --messenger-shadow: 0 12px 35px rgba(28, 52, 65, 0.08);
}

html,
body {
    font-family: 'Poppins', sans-serif;
    color: var(--messenger-ink);
    background: var(--messenger-canvas);
}

body {
    letter-spacing: 0;
}

.login-page-body {
    box-sizing: border-box;
    display: grid;
    min-height: 100vh;
    margin: 0;
    place-items: center;
    padding: 24px;
    background:
        radial-gradient(ellipse at 12% 10%, rgba(74, 159, 139, 0.12), transparent 35%),
        radial-gradient(ellipse at 94% 92%, rgba(22, 124, 128, 0.1), transparent 32%),
        #edf3f2;
}

.login-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 0.92fr);
    width: min(1080px, 100%);
    min-height: 560px;
    overflow: hidden;
    border: 1px solid rgba(23, 55, 57, 0.08);
    border-radius: 18px;
    background: var(--messenger-surface);
    box-shadow: 0 26px 70px rgba(27, 66, 66, 0.13);
}

.login-story {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 0;
    padding: 30px 42px 24px;
    overflow: hidden;
    background-color: #105f5e;
    background-image:
        radial-gradient(circle at 87% 12%, rgba(119, 198, 163, 0.2) 0 1px, transparent 1.5px),
        linear-gradient(145deg, #105f5e 0%, #124f50 55%, #173e46 100%);
    background-size: 24px 24px, auto;
    color: #ffffff;
}

.login-story__brand {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.95rem;
    font-weight: 600;
}

.login-story__logo {
    display: block;
    flex: 0 0 auto;
    width: 88px;
    height: 42px;
    object-fit: contain;
}

.login-story__content {
    position: relative;
    z-index: 1;
    width: min(420px, 100%);
    margin: 38px auto 0;
}

.login-story__eyebrow,
.login-heading__eyebrow {
    margin: 0 0 14px;
    font-size: 0.69rem;
    font-weight: 700;
    line-height: 1.4;
    letter-spacing: 0.12em;
}

.login-story__eyebrow {
    color: #a7ddc6;
}

.login-story h1 {
    max-width: 390px;
    margin: 0;
    color: #ffffff;
    font-size: 2.15rem;
    font-weight: 600;
    line-height: 1.18;
}

.login-story__description {
    max-width: 390px;
    margin: 12px 0 20px;
    color: rgba(240, 250, 246, 0.78);
    font-size: 0.84rem;
    line-height: 1.6;
}

.login-preview {
    width: min(360px, 100%);
    padding: 14px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 10px;
    background: rgba(11, 48, 49, 0.42);
    box-shadow: 0 14px 32px rgba(5, 30, 33, 0.12);
    box-sizing: border-box;
}

.login-preview__topline {
    display: flex;
    align-items: center;
    gap: 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.login-preview__avatar {
    display: grid;
    flex: 0 0 32px;
    width: 32px;
    height: 32px;
    place-items: center;
    border-radius: 50%;
    background: #b5e5ca;
    color: #185c51;
    font-size: 0.8rem;
    font-weight: 700;
}

.login-preview__name {
    flex: 1;
    min-width: 0;
    color: #f2faf6;
    font-size: 0.76rem;
    font-weight: 500;
}

.login-preview__status {
    color: #a7ddc6;
    font-size: 0.59rem;
    font-weight: 700;
    letter-spacing: 0.08em;
}

.login-preview__message {
    width: fit-content;
    max-width: 88%;
    margin: 0;
    padding: 8px 10px;
    border-radius: 8px;
    font-size: 0.68rem;
    line-height: 1.5;
    animation: login-preview-message-in 0.24s ease-out;
}

.login-preview__messages {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    gap: 10px;
    min-height: 132px;
    padding-top: 12px;
}

.login-preview__message--incoming {
    background: rgba(255, 255, 255, 0.95);
    color: #263c3d;
}

.login-preview__message--outgoing {
    margin-left: auto;
    background: #c8efd9;
    color: #21483d;
}

.login-preview__typing {
    display: flex;
    gap: 4px;
    width: fit-content;
    margin: 0;
    padding: 8px 10px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.95);
    animation: login-preview-message-in 0.2s ease-out;
}

.login-preview__typing span {
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: #64807a;
    animation: login-preview-dot 1s ease-in-out infinite;
}

.login-preview__typing span:nth-child(2) {
    animation-delay: 0.15s;
}

.login-preview__typing span:nth-child(3) {
    animation-delay: 0.3s;
}

@keyframes login-preview-message-in {
    from {
        transform: translateY(5px);
    }

    to {
        transform: translateY(0);
    }
}

@keyframes login-preview-dot {
    0%, 60%, 100% {
        opacity: 0.4;
        transform: translateY(0);
    }

    30% {
        opacity: 1;
        transform: translateY(-3px);
    }
}

.login-panel {
    display: grid;
    min-width: 0;
    place-items: center;
    padding: 32px 40px 24px;
    background: #ffffff;
}

.login-form-wrap {
    width: min(370px, 100%);
}

.login-heading {
    margin-bottom: 18px;
}

.login-heading__eyebrow {
    margin-bottom: 9px;
    color: var(--messenger-primary);
}

.login-heading h2 {
    margin: 0;
    color: var(--messenger-ink);
    font-size: 1.75rem;
    font-weight: 600;
    line-height: 1.25;
}

.login-heading > p:last-child {
    margin: 10px 0 0;
    color: var(--messenger-muted);
    font-size: 0.84rem;
    line-height: 1.6;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.login-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.login-field label {
    color: #34464c;
    font-size: 0.77rem;
    font-weight: 600;
}

.login-field input {
    box-sizing: border-box;
    width: 100%;
    min-height: 42px;
    padding: 0 14px;
    border: 1px solid #dce5e5;
    border-radius: 6px;
    outline: none;
    background: #ffffff;
    color: var(--messenger-ink);
    font: inherit;
    font-size: 0.84rem;
    transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.login-field input::placeholder {
    color: #a1adb0;
}

.login-field input:focus {
    border-color: var(--messenger-primary);
    box-shadow: 0 0 0 3px rgba(22, 124, 128, 0.12);
}

.login-captcha__challenge {
    display: flex;
    align-items: center;
    gap: 10px;
}

.login-captcha__image {
    display: block;
    flex: 0 1 172px;
    width: 172px;
    max-width: 48%;
    height: auto;
    border: 1px solid #dce5e5;
    border-radius: 4px;
    background: #ffffff;
}

.login-captcha__challenge input {
    flex: 1 1 auto;
    width: 0;
    min-width: 0;
}

.login-submit {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 43px;
    margin-top: 0;
    padding: 0 17px;
    border: 0;
    border-radius: 6px;
    background: var(--messenger-primary);
    color: #ffffff;
    cursor: pointer;
    font: inherit;
    font-size: 0.85rem;
    font-weight: 600;
    transition: background 0.18s ease, transform 0.18s ease;
}

.login-submit:hover {
    transform: translateY(-1px);
    background: var(--messenger-primary-dark);
}

.login-submit:focus-visible {
    outline: 3px solid rgba(22, 124, 128, 0.24);
    outline-offset: 3px;
}

.login-submit__arrow {
    font-size: 1.2rem;
    font-weight: 400;
    line-height: 1;
}

.login-credit {
    margin: 20px 0 0;
    color: #98a4a8;
    font-size: 0.7rem;
    text-align: center;
}

.login-credit a {
    color: #50716f;
    font-weight: 600;
    text-decoration: none;
}

.login-credit a:hover {
    color: var(--messenger-primary-dark);
    text-decoration: underline;
}

.login-page-body .toast-container {
    position: fixed;
    z-index: 999999;
    top: 12px;
    right: 12px;
    width: min(360px, calc(100vw - 24px));
    pointer-events: none;
}

.login-page-body .toast-container > div {
    margin-bottom: 8px;
    padding: 14px 16px;
    border-radius: 6px;
    background: #b64036;
    box-shadow: 0 10px 30px rgba(29, 44, 47, 0.18);
    color: #ffffff;
    font-size: 0.82rem;
    pointer-events: auto;
}

.login-page-body .toast-title {
    display: block;
    margin-bottom: 3px;
    font-weight: 700;
}

.login-page-body .toast-close-button {
    float: right;
    border: 0;
    background: transparent;
    color: #ffffff;
    cursor: pointer;
    font-size: 1.1rem;
}

/* Toasts are also used on the authenticated dashboard, not only on login. */
.toast-container {
    position: fixed;
    z-index: 999999;
    top: 12px;
    right: 12px;
    width: min(360px, calc(100vw - 24px));
    pointer-events: none;
}

.toast-container > div {
    margin-bottom: 8px;
    padding: 14px 16px;
    border-radius: 6px;
    box-shadow: 0 10px 30px rgba(29, 44, 47, 0.18);
    color: #ffffff;
    font-size: 0.82rem;
    pointer-events: auto;
}

.toast-container > .toast-success { background: #13deb9 !important; }
.toast-container > .toast-error { background: #fa896b !important; }
.toast-container > .toast-info { background: #539bff !important; }
.toast-container > .toast-warning { background: #ffae1f !important; }

.toast-container .toast-title {
    display: block;
    margin-bottom: 3px;
    font-weight: 700;
}

.toast-container .toast-close-button {
    float: right;
    border: 0;
    background: transparent;
    color: #ffffff;
    cursor: pointer;
    font-size: 1.1rem;
}

@media (max-width: 760px) {
    .login-page-body {
        padding: 12px;
    }

    .login-layout {
        grid-template-columns: 1fr;
        width: min(480px, 100%);
        min-height: 0;
        border-radius: 12px;
    }

    .login-story {
        min-height: 0;
        padding: 18px 22px 16px;
    }

    .login-story__content {
        margin: 22px 0 0;
    }

    .login-story h1 {
        max-width: 340px;
        margin-top: 8px;
        font-size: 1.45rem;
    }

    .login-story__description {
        margin: 8px 0 14px;
        font-size: 0.76rem;
    }

    .login-preview {
        width: 100%;
        margin-top: 16px;
        padding: 10px;
    }
    .login-preview__messages {
        box-sizing: border-box;
        height: 123px;
        min-height: 0;
        gap: 7px;
        padding-top: 9px;
        overflow: hidden;
    }

    .login-preview__message {
        padding: 7px 8px;
        font-size: 0.64rem;
    }

    .login-panel {
        padding: 26px 22px 18px;
    }

    .login-heading {
        margin-bottom: 20px;
    }

    .login-heading h2 {
        font-size: 1.5rem;
    }

    .login-credit {
        margin-top: 18px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .login-field input,
    .login-submit,
    .login-preview__message,
    .login-preview__typing,
    .login-preview__typing span {
        transition: none;
        animation: none;
    }
}

.page-loader {
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(12, 18, 22, 0.46);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
}

.page-loader .spinner-grow {
    width: 2.15rem;
    height: 2.15rem;
    color: var(--messenger-primary);
    background-color: currentColor;
    box-shadow: 0 0 0 10px rgba(22, 124, 128, 0.12);
}

.welcome-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100%;
    padding: 34px 24px 40px;
    background: #f5f8f8;
    text-align: center;
}

.custome-image{
    max-width: 100% !important;
    height: auto !important;
    display: inline-block !important;
    border-radius: 8px !important;
    object-fit: cover !important;
}


.chat-message--outgoing  .chat-message__media--image {
    background: #d7fed1;
}

.welcome-visual {
    display: none;
    justify-content: center;
    width: 100%;
    margin-bottom: 8px;
}

.welcome-illustration {
    width: min(680px, 43%);
    max-width: 100%;
    height: auto;
    object-fit: contain;
}

.welcome-title {
    margin: 4px 0 0;
    color: #1d2f36;
    font-size: clamp(1.6rem, 2vw, 2.3rem);
    font-weight: 700;
    line-height: 1.2;
}

.welcome-subtitle {
    margin: 12px 0 4px;
    color: #1d2f36;
    font-size: clamp(1.05rem, 1.4vw, 1.4rem);
    font-weight: 600;
}

.welcome-copy {
    max-width: 640px;
    margin: 0;
    color: #64727b;
    font-size: 0.96rem;
    line-height: 1.6;
}

.welcome-cards {
    display: grid;
    grid-template-columns: repeat(4, minmax(140px, 1fr));
    gap: 18px;
    width: min(760px, 100%);
    margin-top: 26px;
}

.welcome-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 120px;
    padding: 18px 14px 16px;
    border: 1px solid rgba(35, 72, 87, 0.08);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.8);
    box-shadow: 0 10px 24px rgba(22, 36, 44, 0.05);
    color: #214b55;
    font-size: 0.8rem;
    font-weight: 600;
    line-height: 1.35;
    text-align: center;
}

.welcome-card-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 62px;
    height: 62px;
    margin-bottom: 10px;
    border-radius: 16px;
    background: rgba(50, 157, 122, 0.12);
    color: #1a7f72;
}

.welcome-card-icon svg {
    width: 26px;
    height: 26px;
    stroke: currentColor;
    fill: none;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

@media (max-width: 767.98px) {
    .welcome-empty-state {
        padding-top: 18px;
        padding-bottom: 26px;
    }

    .welcome-illustration {
        width: min(420px, 84%);
    }

    .welcome-cards {
        grid-template-columns: repeat(2, minmax(140px, 1fr));
        gap: 12px;
    }
}

.messenger-shell {
    position: relative;
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 100%;

}

.chat-header {
    flex: 0 0 auto;
    position: relative;
    z-index: 2;
    padding: 13px 13px !important;
    background: #ffffff;
    box-shadow: 0px 0px 20px 2px #00000008;
}

.chat-header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;

}

.chat-profile {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
}

.mobile-chat-back {
    display: none;
}

.chat-profile-img {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 39px;
    height: 39px;
    overflow: hidden;
    border-radius: 50%;
    background: #f4f7f7;
}

.chat-profile-img.avatar-initials {
    background: hsl(var(--avatar-hue, 180), 46%, 43%);
    color: #ffffff;
    font-size: 0.82rem;
    font-weight: 700;
    line-height: 1;
}

.chat-name-number {
    min-width: 0;
}

.chat-name-number__title {
    display: flex;
    align-items: center;
    gap: 7px;
    min-width: 0;
}

.chat-name-number__meta {
    display: flex;
    align-items: center;
    gap: 10px;
}

.chat-name-number h5 {
    margin: 0;
    color: #000000;
    font-size: 0.90rem;
    font-weight: 400;
    line-height: 1.2;
}

.chat-name-number p {
    margin: 3px 0 0;
    color: #667781;
    font-size: 0.72rem;
    line-height: 1.2;
}

.chat-header__role,
.chat-header__window-badge {
    display: none;
    align-items: center;
    width: fit-content;
    padding: 2px 6px;
    border-radius: 999px;
    background: #edf3f2;
    color: #47615e;
    font-size: 0.62rem;
    font-weight: 600;
    line-height: 1.2;
    white-space: nowrap;
}

.chat-header__role.is-visible,
.chat-header__window-badge.is-visible {
    display: inline-flex;
}

.chat-header__window-badge.is-visible {
    display: inline-flex;
}

.chat-header__window-badge--online {
    background: #e8f6eb;
    color: #27833b;
}

.chat-header__window-badge--offline {
    background: #fff0ef;
    color: #bf3d36;
}

.chat-actions {
    position: relative;
    display: flex;
    align-items: center;
    flex-shrink: 0;
    gap: 5px;
    margin-left: auto;
}

.chat-header__search {
    display: flex;
    align-items: center;
    width: 38px;
    max-width: min(350px, 56vw);
    overflow: hidden;
    border-radius: 8px;
    transition: width 0.24s ease;
}

.chat-header__search.is-open {
    width: min(350px, 56vw);
    border: 1px solid #0000001f;
    box-shadow: 2px 2px 6px #00000005;
}

.chat-header__search-input {
    flex: 1 1 auto;
    width: 0;
    min-width: 0;
    height: 38px;
    padding: 0;
    border: 0;
    outline: none;
    background: #ffffff;
    color: #1d2f36;
    font: inherit;
    font-size: 0.84rem;
    opacity: 0;
    transition: opacity 0.16s ease, padding 0.24s ease;
}

.chat-header__search.is-open .chat-header__search-input {
    padding: 0 0 0 12px;
    opacity: 1;
}

.chat-header__search-input:focus-visible {
    outline: none;
}

.chat-header__search-toggle {
    flex: 0 0 38px;
    border: 0;
    cursor: pointer;
}

.chat-header__search-toggle svg {
    width: 24px;
    height: 24px;
}

.chat-search-highlight {
    padding: 0 1px;
    border-radius: 2px;
    background: #ffeb70;
    color: inherit;
}

.chat-search-highlight.is-current {
    background: #ffd54f;
    box-shadow: 0 0 0 1px rgba(164, 115, 0, 0.3);
}

.chat-search-navigation {
    position: absolute;
    top: 58px;
    right: calc(53px + min(350px, 56vw) - 99px);
    z-index: 5;
    display: inline-flex;
    align-items: center;
    gap: 3px;
    min-height: 36px;
    padding: 4px 6px 4px 10px;
    border: 1px solid rgba(17, 27, 33, 0.08);
    border-radius: 8px;
    background: #ffffff;
    box-shadow: 0 5px 14px rgba(17, 27, 33, 0.14);
    color: #34454d;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(-4px);
    transition: opacity 0.16s ease, visibility 0.16s ease, transform 0.16s ease;
}

.chat-search-navigation.is-visible {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0);
}

.chat-search-navigation__count {
    min-width: 26px;
    font-size: 0.76rem;
    line-height: 1;
    text-align: center;
    white-space: nowrap;
}

.chat-search-navigation__button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 27px;
    height: 27px;
    padding: 0;
    border: 0;
    border-radius: 5px;
    background: transparent;
    color: inherit;
    cursor: pointer;
}

.chat-search-navigation__button:hover:not(:disabled),
.chat-search-navigation__button:focus-visible:not(:disabled) {
    background: #f1f4f5;
    outline: none;
}

.chat-search-navigation__button:disabled {
    opacity: 0.4;
    cursor: default;
}

.chat-search-navigation__button svg {
    width: 17px;
    height: 17px;
}

.chat-header__menu-toggle {
    border: 0;
    cursor: pointer;
}

.chat-header__menu-toggle svg {
    width: 24px;
    height: 24px;
}

.chat-actions .chat-header__dropdown {
    top: calc(100% + 8px) !important;
    right: 0 !important;
    left: auto !important;
    min-width: 185px;
}

.chat-header__divider {
    height: 1px;
    margin: 5px 0;
    background: #e4e8ea;
}

.chat-header__profile-panel {
    position: absolute;
    top: calc(100% + 10px);
    right: 10px;
    z-index: 1000;
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 240px;
    padding: 14px;
    border-radius: 10px;
    background: #ffffff;
    box-shadow: 2px 0 14px 6px rgb(110 116 119 / 9%);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(-5px);
    transition: opacity 0.18s ease, visibility 0.18s ease, transform 0.18s ease;
}

.chat-header__profile-panel.is-open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0);
}

.chat-header__profile-panel img {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    object-fit: cover;
}

.chat-header__profile-panel div {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.chat-header__profile-panel strong,
.chat-header__profile-panel span {
    overflow-wrap: anywhere;
}

.chat-header__profile-panel strong {
    color: #1d2f36;
    font-size: 0.9rem;
}

.chat-header__profile-panel span {
    color: #667781;
    font-size: 0.78rem;
}

.messenger-shell .chat-header h5 {
    margin: 0;
    color: #000000;
    font-size: 01rem;
    font-weight: 400;
}

.messenger-shell .chat-header p {
    margin: 3px 0 0;
    color: #667781;
    font-size: 0.72rem;
}

.header-contact-number {
    margin: 0;
    color: #111b21;
    font-size: 1.05rem;
    line-height: 1.3;
    font-weight: 500;
}

.header-action-icons {
    display: flex;
    align-items: center;
    gap: 12px;
}

.header-action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;

    border-radius: 8px;
    background: #ffffff;
    color: #1f2c34;
    font-size: 1rem;
    transition: all 0.2s ease;
}

.header-action-btn:hover {
    text-decoration: none;
    background: #f7f7f7;
    transform: translateY(-1px);
}

.edit-btn,
.delete-btn,
.transfer-btn {
    border-color: #111b21;
    /* background: #f7f7f7; */
    color: #38464f;
    text-decoration: none;
}

.avatar-img {
    width: 100%;
}

.messenger-shell .avatar {
    width: 46px;
    height: 44px;
    border: 2px solid rgba(17, 127, 116, 0.12);
    box-shadow: none;
    object-fit: cover;
    border-radius: 41px;
}

.chat-main {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(17, 27, 33, 0.28) transparent;
}

.chat-pinned-date {
    position: sticky;
    top: 8px;
    z-index: 6;
    display: flex;
    justify-content: center;
    height: 0;
    pointer-events: none;
    visibility: hidden;
    transition: visibility 0s linear 0.22s;
}

.chat-pinned-date.is-visible {
    visibility: visible;
    transition-delay: 0s;
}

.chat-pinned-date__label {
    height: fit-content;
    padding: 7px 10px;
    border: 1px solid rgba(17, 27, 33, 0.05);
    border-radius: 9px;
    background: #ffffff;
    color: #667781;
    box-shadow: 0 1px 0 #0000002e;
    font-size: 11px;
    font-weight: 500;
    line-height: 1.2;
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 0.22s ease, transform 0.22s ease;
}

.chat-pinned-date.is-visible .chat-pinned-date__label {
    opacity: 1;
    transform: translateY(0);
}

.chat-main::-webkit-scrollbar {
    width: 6px;
    height: 6px;
    background: transparent;
}

.chat-main::-webkit-scrollbar-track {
    background: transparent;
}

.chat-main::-webkit-scrollbar-thumb {
    border: 2px solid transparent;
    border-radius: 999px;
    background: rgba(17, 27, 33, 0.25);
    background-clip: padding-box;
}

.chat-body-inner {
    padding: 28px clamp(16px, 4vw, 54px) 10px !important;
    display: flex;
    flex-direction: column;
    min-height: 100%;
}

.chat-box {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
}

.chat-body-inner > .chat-box {
    margin-top: auto;
}

.chat-message {
    display: flex;
    margin: 8px 0;
    width: 100%;
}

.chat-message--incoming {
    justify-content: flex-start;
}

.chat-message--outgoing {
    justify-content: flex-end;
}

.chat-message__inner {
    max-width: min(72%, 620px);
}

.chat-message__content {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
}

.chat-message--outgoing .chat-message__content {
    align-items: flex-end;
}

.chat-message--incoming .chat-message__type,
.chat-message--incoming .chat-message__media,
.chat-message--incoming .chat-message__file,
.chat-message--incoming .chat-message__template,
.chat-message--incoming .chat-message__text {
    margin-right: auto;
    align-self: flex-start;
}

.chat-message--outgoing .chat-message__type,
.chat-message--outgoing .chat-message__media,
.chat-message--outgoing .chat-message__file,
.chat-message--outgoing .chat-message__template,
.chat-message--outgoing .chat-message__text {
    margin-left: auto;
    align-self: flex-end;
}

.chat-message__type,
.chat-message__media,
.chat-message__file,
.chat-message__template,
.chat-message__text {
    position: relative;
    max-width: min(620px, 78vw);
}

.chat-message__type--text,
.chat-message__type--template,
.chat-message__type--document,
.chat-message__type--audio,
.chat-message__type--image,
.chat-message__type--video {
    overflow: visible;
}

.chat-message__text--incoming,
.chat-message__text--outgoing {
    padding: 0;
    background: transparent;
    box-shadow: none;
}

.chat-message__bubble {
    position: relative;
    display: inline-flex;
    align-items: flex-end;
    gap: 8px;
    max-width: min(620px, 78vw);
    padding: 6px 7px 9px 10px;
    border-radius: 8px;
    font-size: 0.82rem;
    line-height: 1.55;
    word-break: break-word;
    box-shadow: 1px 1px 0 rgb(87 114 131 / 20%);
    z-index: 1;
}

.chat-message__bubble>* {
    position: relative;
    z-index: 1;
}

.chat-message__bubble--incoming {
    background: var(--messenger-incoming, #ffffff);
    color: #000000;
}



.chat-message__bubble--outgoing {
    background: var(--messenger-outgoing, #d9fdd3);
    color: #000000;
}

.chat-message__media {
    display: inline-flex;
    flex-direction: column;
    gap: 8px;
    padding: 0;
    background: transparent;
    box-shadow: none;
}

.chat-message__img,
.chat-message__video,
.chat-message__audio {
    display: block;
    width: 100%;
    max-width: 235px;
    border-radius: 12px;
    object-fit: cover;
    background: #edf2f4;
}

.chat-message__img {
    box-shadow: 0 10px 18px rgba(17, 27, 33, 0.12);
    cursor: pointer;
}

.chat-image-overlay {
    position: fixed !important;
    left: 0 !important;
    top: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    display: flex;
    align-items: center !important;
    justify-content: center !important;
    background: rgba(255, 255, 255, 0.96) !important;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.2s ease, visibility 0.2s ease;
    z-index: 2147483647 !important;
}

body.chat-image-preview-open .layout,
body.chat-image-preview-open .navigation,
body.chat-image-preview-open .sidebar,
body.chat-image-preview-open main.main,
body.chat-image-preview-open .messenger-shell {
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

.chat-image-overlay.is-open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

body.chat-image-preview-open .chat-image-overlay {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.chat-image-overlay__header {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: min(92vw, 1200px);
    z-index: 2147483647;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    pointer-events: none;
}

.chat-image-overlay__profile,
.chat-image-overlay__toolbar {
    pointer-events: auto;
}

.chat-image-overlay__profile {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 8px 16px 8px 10px;
    border: 1px solid rgba(17, 27, 33, 0.08);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 12px 30px rgba(17, 27, 33, 0.12);
    backdrop-filter: blur(6px);
}

.chat-image-overlay__avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid rgba(17, 27, 33, 0.08);
    background: #f2f3f5;
}

.chat-image-overlay__meta {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.chat-image-overlay__name {
    font-size: 0.96rem;
    font-weight: 700;
    color: #111b21;
}

.chat-image-overlay__number {
    font-size: 0.78rem;
    color: rgba(17, 27, 33, 0.72);
}

.chat-image-overlay__stamp {
    margin-top: 4px;
    font-size: 0.72rem;
    line-height: 1.2;
    color: rgba(17, 27, 33, 0.7);
    letter-spacing: 0.02em;
}

.chat-image-overlay__panel {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: auto;
    max-width: min(92vw, 1200px);
    max-height: 90vh;
    border-radius: 14px;
    overflow: visible;
    z-index: 1;
}

.chat-image-overlay__toolbar {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    padding: 8px 10px;
    border: 1px solid rgba(17, 27, 33, 0.08);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 12px 30px rgba(17, 27, 33, 0.12);
    backdrop-filter: blur(6px);
}

.chat-image-overlay__zoom-controls {
    position: absolute;
    top: calc(100% + 8px);
    left: 18px;
    display: flex;
    align-items: center;
    gap: 8px;
    z-index: 2;
}

.chat-image-overlay__zoom-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 12px;
    border: 1px solid rgba(17, 27, 33, 0.08);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.96);
    font-size: 0.72rem;
    font-weight: 700;
    color: #111b21;
    box-shadow: 0 8px 16px rgba(17, 27, 33, 0.1);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.18s ease, visibility 0.18s ease;
}

.chat-image-overlay__zoom-pill.is-visible {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.chat-image-overlay__action--reset {
    display: none;
    gap: 6px;
    padding: 6px 12px;
    width: 112px !important;
    height: 34px !important;
    border-radius: 99px !important;
    background: rgba(255, 255, 255, 0.96) !important;
    border: 1px solid rgba(17, 27, 33, 0.08);
    box-shadow: 0 8px 16px rgba(17, 27, 33, 0.1);
    font-size: 0.72rem;
    font-weight: 700;
    line-height: 1;
    color: #111b21;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.18s ease, visibility 0.18s ease;
}

.chat-image-overlay__action--reset.is-visible {
    display: inline-flex;
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.chat-image-overlay__action,
.chat-image-overlay__close {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: #111b21;
    cursor: pointer;
    transition: background 0.18s ease, transform 0.18s ease;
}

.chat-image-overlay__action[data-tooltip]::after,
.chat-image-overlay__close[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    top: calc(100% + 8px);
    left: 50%;
    z-index: 5;
    padding: 5px 8px;
    border-radius: 4px;
    background: #111b21;
    color: #ffffff;
    font-size: 0.72rem;
    font-weight: 500;
    line-height: 1.2;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transform: translate(-50%, -2px);
    transition: opacity 0.15s ease, visibility 0.15s ease, transform 0.15s ease;
}

.chat-image-overlay__action[data-tooltip]:hover::after,
.chat-image-overlay__action[data-tooltip]:focus-visible::after,
.chat-image-overlay__close[data-tooltip]:hover::after,
.chat-image-overlay__close[data-tooltip]:focus-visible::after {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, 0);
}

.chat-image-overlay__action:hover,
.chat-image-overlay__close:hover,
.chat-image-overlay__action:focus-visible,
.chat-image-overlay__close:focus-visible {
    background: rgba(17, 27, 33, 0.06);
    transform: translateY(-1px);
    outline: none;
}

.chat-image-overlay__action svg {
    width: 17px;
    height: 17px;
    display: block;
    stroke: currentColor;
}

.chat-image-overlay__action--zoom {
    font-size: 1.4rem;
    font-weight: 600;
    line-height: 1;
}

.chat-image-overlay__action--zoom.is-active {
    background: rgba(17, 27, 33, 0.08);
}

.chat-image-overlay__action--danger {
    color: #111b21;
}

.chat-image-overlay__img {
    display: block;
    max-width: min(82vw, 980px);
    max-height: 70vh;
    width: auto;
    height: auto;
    object-fit: contain;
    background: #ffffff;
    transform: translate(var(--chat-pan-x, 0px), var(--chat-pan-y, 0px)) scale(var(--chat-preview-zoom, 1));
    transition: transform 0.12s ease-out;
    border-radius: 12px;
    will-change: transform;
    cursor: default;
    user-select: none;
    -webkit-user-drag: none;
    touch-action: none;
}

.chat-image-overlay__img.is-zoomed {
    cursor: grab;
}

.chat-image-overlay__img.is-dragging {
    cursor: grabbing;
    transition: none;
}

.chat-image-overlay__footer {
    position: fixed;
    left: 50%;
    bottom: 0px;
    transform: translateX(-50%);
    width: min(92vw, 1200px);
    z-index: 2147483647;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    backdrop-filter: blur(15px);
    transition: opacity 0.2s ease, visibility 0.2s ease;
}

.chat-image-overlay.is-open .chat-image-overlay__footer {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.chat-image-overlay__nav,
.chat-image-overlay__thumb {
    pointer-events: auto;
}

.chat-image-overlay__nav {
    width: 42px;
    height: 42px;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.9);
    color: #111b21;
    font-size: 2rem;
    line-height: 1;
    cursor: pointer;
    box-shadow: 0 10px 18px rgba(17, 27, 33, 0.12);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.chat-image-overlay__nav svg {
    width: 18px;
    height: 18px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2.4;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.chat-image-overlay__thumbs {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    max-width: min(72vw, 880px);
    overflow: hidden;
    padding: 6px 8px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.08);
}

.chat-image-overlay__thumb {
    width: 72px;
    height: 72px;
    padding: 0;
    border: 2px solid transparent;
    border-radius: 12px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 6px 12px rgba(17, 27, 33, 0.08);
    cursor: pointer;
    flex-shrink: 0;
}

.chat-image-overlay__thumb img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.chat-image-overlay__thumb.is-active {
    border-color: #1ea67a;
    box-shadow: 0 0 0 2px rgba(30, 166, 122, 0.15);
}

.chat-image-overlay__close {
    width: 36px;
    height: 36px;
    font-size: 24px;
    line-height: 1;
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 10px 18px rgba(17, 27, 33, 0.12);
}

@media (max-width: 767.98px) {
    .chat-image-overlay {
        height: 100dvh !important;
        min-height: 100dvh;
        overflow: hidden;
        overscroll-behavior: none;
    }

    body.chat-image-preview-open {
        overflow: hidden;
        overscroll-behavior: none;
    }

    .chat-image-overlay__header {
        top: calc(env(safe-area-inset-top) + 8px);
        right: 8px;
        left: 8px;
        width: auto;
        transform: none;
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }

    .chat-image-overlay__profile {
        align-self: flex-start;
        gap: 8px;
        max-width: calc(100% - 42px);
        padding: 5px 10px 5px 6px;
        border-radius: 14px;
    }

    .chat-image-overlay__avatar {
        width: 32px;
        height: 32px;
    }

    .chat-image-overlay__meta {
        min-width: 0;
    }

    .chat-image-overlay__name,
    .chat-image-overlay__stamp {
        max-width: min(62vw, 240px);
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .chat-image-overlay__name {
        font-size: .8rem;
    }

    .chat-image-overlay__stamp {
        margin-top: 2px;
        font-size: .64rem;
    }

    .chat-image-overlay__toolbar {
        position: static;
        justify-content: space-evenly;
        gap: 0;
        width: 100%;
        min-width: 0;
        padding: 4px;
        overflow: visible;
        border-radius: 14px;
        scrollbar-width: none;
    }

    .chat-image-overlay__toolbar::-webkit-scrollbar {
        display: none;
    }

    .chat-image-overlay__action,
    .chat-image-overlay__close {
        flex: 0 0 32px;
        width: 32px;
        height: 32px;
    }

    .chat-image-overlay__close {
        position: absolute;
        top: 0;
        right: 0;
        z-index: 2;
    }

    .chat-image-overlay__zoom-controls {
        position: static;
        flex: 0 0 32px;
        width: 32px;
        align-items: center;
        justify-content: center;
        gap: 3px;
    }

    .chat-image-overlay__action--reset.is-visible {
        width: 32px !important;
        min-width: 32px;
        padding: 0;
        overflow: hidden;
    }

    .chat-image-overlay__action--reset span + span {
        display: none;
    }

    .chat-image-overlay__panel {
        position: absolute;
        top: calc(env(safe-area-inset-top) + 112px);
        right: 8px;
        bottom: calc(env(safe-area-inset-bottom) + 76px);
        left: 8px;
        width: auto;
        max-width: none;
        max-height: none;
        overflow: hidden;
        border-radius: 8px;
        touch-action: pan-y;
    }

    .chat-image-overlay__img {
        max-width: 100%;
        max-height: 100%;
        border-radius: 8px;
        touch-action: pan-y;
    }

    .chat-image-overlay__footer {
        right: 0;
        bottom: calc(env(safe-area-inset-bottom) + 8px);
        left: 0;
        width: 100%;
        gap: 6px;
        padding: 0 8px;
        transform: none;
        box-sizing: border-box;
    }

    .chat-image-overlay__nav {
        flex: 0 0 34px;
        width: 34px;
        height: 34px;
    }

    .chat-image-overlay__thumbs {
        flex: 1 1 auto;
        justify-content: flex-start;
        min-width: 0;
        max-width: none;
        gap: 7px;
        padding: 4px;
        overflow-x: auto;
        border-radius: 10px;
        scrollbar-width: none;
        -webkit-overflow-scrolling: touch;
    }

    .chat-image-overlay__thumbs::-webkit-scrollbar {
        display: none;
    }

    .chat-image-overlay__thumb {
        flex: 0 0 46px;
        width: 46px;
        height: 54px;
        border-radius: 8px;
    }
}

.chat-message__media--image .chat-message__time {
    position: absolute;
    right: 6px;
    bottom: 11px;
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 4px;
    margin: 0;
    padding: 2px 6px;
    color: #ffffff !important;
    border-radius: 6px;
    font-size: 0.68rem;
    line-height: 1.2;
    white-space: nowrap;
    text-shadow: 0 1px 1px rgba(0, 0, 0, 0.35);
    backdrop-filter: blur(1px);
    z-index: 1;
}

.chat-message__media--image .chat-message__time img {
    filter: brightness(0) invert(1);
    opacity: 1;
}

.chat-message__media--image {
    position: relative;
    display: inline-block;
    padding: 5px;
    border-radius: 6px;
    overflow: visible;
    background: #ffffff;

    cursor: pointer;
}

.chat-message__media--image.chat-message__media--captioned {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.chat-message__media--image.chat-message__media--captioned .chat-message__time {
    position: static;
    align-self: flex-end;
    padding: 0;
    color: #667781 !important;
    text-shadow: none;
    backdrop-filter: none;
}

.chat-message__media--image.chat-message__media--captioned .chat-message__time img {
    filter: none;
}

.chat-message__image-wrap {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: min(308px, 72vw);
    min-width: 159px;
    max-width: 280px;
    min-height: 110px;
    max-height: 360px;
    border-radius: 6px;
    overflow: visible;
    background: #edf2f4;

}

.chat-message__image-menu {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 4;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.92);
    color: #13323b;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(-4px);
    transition: opacity 0.2s ease, visibility 0.2s ease, transform 0.2s ease;
    cursor: pointer;
    box-shadow: 0 8px 18px rgba(17, 27, 33, 0.18);
}

.chat-message__image-wrap:hover .chat-message__image-menu,
.chat-message__image-wrap:focus-within .chat-message__image-menu,
.chat-message__file--pdf:hover > .chat-message__image-menu,
.chat-message__file--pdf:focus-within > .chat-message__image-menu,
.chat-message__image-menu:hover,
.chat-message__image-menu:focus-visible {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0);
}

.chat-message__image-menu svg {
    width: 17px;
    height: 17px;
    display: block;
    color: #13323b;
}

.chat-message__image-dropdown {
    position: absolute;
    top: 8px !important;
    right: 0px !important;
    z-index: 999 !important;
    display: flex;
    flex-direction: column;
    min-width: 150px;
    padding: 8px 0;
    /* border: 1px solid rgba(17, 27, 33, 0.08); */
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 2px 0px 10px 6px rgb(110 116 119 / 7%);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(-6px);
    transition: opacity 0.18s ease, visibility 0.18s ease, transform 0.18s ease;
}

.chat-message--incoming .chat-message__image-dropdown {
    left: calc(100% + -6px);
    right: auto;
    top: 8px;
}

.chat-message--outgoing .chat-message__image-dropdown {
    right: -190px;
    left: auto;
    top: 8px;
}

.chat-message__file--pdf > .chat-message__image-dropdown {
    top: 42px !important;
    right: 8px !important;
    left: auto !important;
}

.chat-message__image-dropdown.is-open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0);
}

.chat-message__image-action {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 10px 14px;
    border: 0;
    background: transparent;
    color: #1d2f36;
    font-size: 0.9rem;
    font-weight: 500;
    text-align: left;
    cursor: pointer;
    transition: background 0.15s ease;
}

.chat-message__image-action:hover,
.chat-message__image-action:focus-visible {
    background: #f5f7f8;
    outline: none;
}

.chat-message__image-action--danger {
    color: #d92d20;
}

/* Keep the image message menu consistent with text messages. */
.chat-message__image-dropdown .chat-message__image-action[data-action="copy"],
.chat-message__image-dropdown .chat-message__image-action[data-action="download"] {
    display: none;
}

.chat-message__image-action__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    color: inherit;
    flex-shrink: 0;
}

.chat-message__image-action__icon svg {
    width: 18px;
    height: 18px;
    display: block;
    stroke: currentColor;
}

/* Text message options: UI only for now. */
.chat-message__text { position: relative; }
.chat-text-actions {
    position: absolute;
    top: 4px;
    right: -28px;
    z-index: 8;
}
.chat-message__text--outgoing .chat-text-actions {
    left: -28px;
    right: auto;
}
.chat-text-actions__trigger {
    border: 0;
    background: rgba(255,255,255,.9);
    color: #50636a;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    line-height: 18px;
    padding: 0;
    font-size: 18px;
    cursor: pointer;
    opacity: 0;
    transition: opacity .15s ease;
}
.chat-message__text:hover .chat-text-actions__trigger,
.chat-text-actions:focus-within .chat-text-actions__trigger { opacity: 1; }
.chat-text-actions__menu {
    position: absolute;
    top: 28px;
    left: 0;
    min-width: 125px;
    padding: 6px 0;
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 8px 20px rgba(17,27,33,.16);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}
.chat-text-actions:hover .chat-text-actions__menu,
.chat-text-actions:focus-within .chat-text-actions__menu {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}
.chat-text-actions__menu button {
    display: block;
    width: 100%;
    padding: 8px 12px;
    border: 0;
    background: transparent;
    color: #1d2f36;
    text-align: left;
    cursor: pointer;
}
.chat-text-actions__menu button:hover { background: #f5f7f8; }
.chat-text-actions__menu .is-danger { color: #d92d20; }

.chat-reply-preview {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0 12px 8px;
    padding: 8px 12px;
    border-left: 3px solid #168b8d;
    border-radius: 8px;
    background: #eef8f7;
    color: #25464b;
}
.chat-reply-preview__content {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
}
.chat-reply-preview__content strong { font-size: .75rem; color: #168b8d; }
.chat-reply-preview__content span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: .82rem;
}
.chat-reply-preview > button {
    border: 0;
    background: transparent;
    color: #557177;
    font-size: 1.25rem;
    line-height: 1;
    cursor: pointer;
}
.chat-replied-message {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-bottom: 7px;
    padding: 6px 9px;
    border-left: 3px solid rgba(22,139,141,.75);
    border-radius: 5px;
    background: rgba(22,139,141,.10);
    font-size: .78rem;
}
.chat-replied-message strong { color: #168b8d; font-size: .7rem; }
.chat-replied-message span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Do not block the dashboard with Bootstrap's dark modal overlay. */
.modal-backdrop {
    display: none !important;
    pointer-events: none !important;
}

body.modal-open {
    overflow: auto !important;
    padding-right: 0 !important;
}

.chat-message__image-wrap::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.00) 0%, rgba(0, 0, 0, 0.00) 86%, rgb(0 0 0 / 63%) 100%);
    pointer-events: none;
    z-index: 1;
}

.chat-message__img {
    display: block;
    width: 100%;
    max-width: 235px;
    min-height: 110px;
    max-height: 360px;
    height: auto;
    border-radius: 12px;
    overflow: hidden;
    object-fit: cover;
    object-position: center center;
    position: relative;
    z-index: 0;
    background: #edf2f4;
}

.chat-message__media--video {
    padding: 0;
}

.chat-message--incoming .chat-message__media--audio {
    position: relative;
    padding: 7px 7px 7px 7px;
    background: #ffffff;
    border-radius: 0px 11px 11px 11px;
    box-shadow: 1px 1px 0 rgb(87 114 131 / 20%);
}


.chat-message--incoming .chat-message__media--audio::after {
    content: "";
    position: absolute;
    left: -10px;
    top: 0;
    transform: rotate(90deg);
    width: 22px;
    height: 22px;
    background: #ffffff;
    clip-path: polygon(0 100%, 100% 0, 0 0);
    z-index: -1;
}

.chat-message--outgoing .chat-message__media--audio {
    position: relative;
    padding: 7px;
    background: #d9fdd3;
    border-radius: 11px 0 11px 11px;
    box-shadow: 1px 1px 0 rgb(87 114 131 / 20%);
}

.chat-message--outgoing .chat-message__media--audio::after {
    content: "";
    position: absolute;
    right: -10px;
    top: 0;
    transform: rotate(270deg);
    width: 22px;
    height: 22px;
    background: #d9fdd3;
    clip-path: polygon(100% 100%, 0 0, 100% 0);
    z-index: 0;
}

.chat-message__audio {
    max-width: 300px;
    width: min(300px, 72vw);
}

.chat-message__caption {
    color: #000000;
    font-size: 0.8rem;
    line-height: 1.55;
    word-break: break-word;
}

.chat-message__template, .chat-message__file, .chat-message__file--document {
    display: inline-flex;
    flex-direction: column;
    gap: 8px;
    padding: 10px 12px 8px;
    background: #ffffff;
    border: 1px solid #edf2f4;
    color: #111b21;
    position: relative;
    font-size: .82rem !important;
    border-radius: 10px;
    box-shadow: 1px 1px 1px 0px #0000003b;
}
.chat-message__file--incoming {
    background: #ffffff;
    border: 1px solid #edf2f4;
    margin-right: auto;
}

.chat-message__file--outgoing {
    background: #d9fdd3;
    border: 1px solid rgba(17, 27, 33, 0.06);
    margin-left: auto;
}

.chat-message__file--incoming::before {
    content: "";
    position: absolute;
    left: -11px;
    top: 12px;
    width: 22px;
    height: 22px;
    background: #ffffff;
    clip-path: polygon(0 100%, 100% 0, 0 0);
    z-index: 0;
}

.chat-message__file--outgoing::before {
    content: "";
    position: absolute;
    right: -11px;
    top: 0px;
    width: 22px;
    transform: rotate(270deg);
    height: 22px;
    background: #d9fdd3;
    clip-path: polygon(100% 100%, 0 0, 100% 0);
    z-index: 0;
}

.chat-message__template--outgoing,
.chat-message__bubble--outgoing {
    background: #d8fdd2;
}

.chat-message__template--outgoing::before,
.chat-message__bubble--outgoing::before {
    content: "";
    position: absolute;
    right: -11px;
    top: 0px;
    width: 22px;
    transform: rotate(270deg);
    height: 22px;
    background: #d9fdd3;
    clip-path: polygon(100% 100%, 0 0, 100% 0);
    z-index: 0;
}

.chat-message__template--incoming,
.chat-message__bubble--incoming {
    background: #ffffff;
}

.chat-message__doc-link {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #111b21;
    text-decoration: none;
    word-break: break-word;
}

.chat-message__doc-icon {
    width: 42px;
    height: 42px;
    object-fit: contain;
    flex-shrink: 0;
}

.chat-message__file--pdf {
    width: min(340px, 78vw);
    gap: 0;
    padding: 5px;
    border-radius: 8px;
}

.chat-message__doc-preview {
    position: relative;
    display: block;
    width: 100%;
    height: 115px;
    overflow: hidden;
    background: #f1f3f4;
    /* border-radius: 6px; */
    border-top-left-radius: 10px;
    border-top-right-radius: 10px;
}

.chat-message__doc-preview iframe {
    display: block;
    width: calc(100% + 16px);
    max-width: none;
    height: 100%;
    border: 0;
    pointer-events: none;
}

.chat-message__file--pdf .chat-message__doc-link {
    min-width: 0;
        padding: 25px 14px 14px 14px;
    background: #d5f3cf;
    margin-top: -5px;
    margin-bottom: 10px;
    border-bottom-right-radius: 10px;
    border-bottom-left-radius: 10px;
}

.chat-message__file--pdf .chat-message__doc-icon {
    width: 36px;
    height: 36px;
}

.chat-message__doc-details {
    display: flex;
    flex: 1;
    flex-direction: column;
    min-width: 0;
    gap: 3px;
}

.chat-message__doc-name {
    overflow: hidden;
    font-size: 0.82rem;
    font-weight: 500;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.chat-message__doc-meta {
    color: #667781;
    font-size: 0.7rem;
    line-height: 1.3;
}

.chat-message__file--pdf .chat-message__time {
    align-self: flex-end;
    margin: 0 4px 3px auto;
}

.chat-message__time {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 4px;
    margin-left: auto;
    color: rgba(102, 119, 129, 0.96);
    font-size: 0.68rem;
    line-height: 1;
    white-space: nowrap;
}

.chat-message__time img {
    width: 15px;
    height: 15px;
    min-width: 15px;
    max-width: 15px;
    display: inline-block;
    vertical-align: middle;
    object-fit: contain;
}

.messenger-shell .message {
    display: flex;
    margin: 8px 0;
}

.messenger-shell .message.message-out {
    justify-content: flex-end;
}


.messenger-shell .message-text img {
    max-width: 100%;
    height: auto;
    display: inline-block;
    border-radius: 8px;
    object-fit: cover;
}


.messenger-shell .message-text img[data-type="status"] {
    width: 15px;
    height: 15px;
    min-width: 15px;
    max-width: 15px;
    display: inline-block;
    vertical-align: middle;
    border-radius: 0;
    object-fit: contain;
}

.messenger-shell .message-text::after {
    content: "";
    position: absolute;
    left: -10px;
    top: 0;
    transform: rotate(90deg);
    width: 22px;
    height: 22px;
    background: #ffffff;
    clip-path: polygon(0 100%, 100% 0, 0 0);
    z-index: -2;
}

.messenger-shell .message.message-out .message-text {
    border-color: transparent;
    border-radius: 8px;
    background: #d9fdd3;
}

.messenger-shell .message.message-out .message-text::after {
    left: auto;
    right: -13px;
    background: #d9fdd3;
    clip-path: polygon(100% 100%, 0 0, 100% 0);
    transform: rotate(270deg);
    width: 20px;
    height: 20px;
    z-index: -1;
}

.messenger-shell .message-text p {
    display: flex;
    align-items: flex-end;
    flex-wrap: wrap;
    gap: 6px 8px;
    margin: 0;
    color: #111b21;
    font-size: 0.82rem;
    line-height: 1.5;
}

.messenger-shell .message-text p:has(> img:first-child:last-child) {
    position: relative;
    display: block;
    padding: 0;
    gap: 0;
    line-height: 0;
}

.messenger-shell .message-text p:has(> img:first-child:last-child)>img {
    display: block;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    margin: 0;
    border-radius: 8px;
    box-shadow: 0 12px 18px rgba(17, 27, 33, 0.14);
}

.messenger-shell .message-text p:has(> img:first-child:last-child) .chat-time {
    position: absolute;
    right: 8px;
    bottom: 8px;
    display: inline-flex;
    justify-content: flex-end;
    align-items: center;
    margin: 0;
    padding: 2px 6px;
    color: #ffffff !important;
    background: rgba(0, 0, 0, 0.28);
    border-radius: 6px;
    text-shadow: 0 1px 1px rgba(0, 0, 0, 0.35);
    backdrop-filter: blur(1px);
}

.messenger-shell .message-text p:has(> img:first-child:last-child) .chat-time img {
    filter: brightness(0) invert(1);
    opacity: 1;
}

.messenger-shell .chat-time {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-left: auto;
    color: #667781;
    font-size: 0.73rem;
    line-height: 0.6;
    white-space: nowrap;
    vertical-align: bottom;
}

.messenger-shell .chat-time img {
    width: 17px;
    height: 16px;
    min-width: 17px;
    max-width: 17px;
    display: inline-block;
    vertical-align: middle;
    object-fit: contain;
}

.messenger-shell .message-text .extra-small {
    display: none;
}

.messenger-shell .message-divider {
    margin: 22px 0;
    color: #667781 !important;
    font-size: 0.66rem;
    text-align: center;
}

.messenger-shell .chat-date-divider {
    width: fit-content;
    max-width: 100%;
    margin: 12px auto;
}

.messenger-shell .message-divider small {
    padding: 7px 10px !important;
    border: 1px solid rgba(17, 27, 33, 0.05);
    font-size: 11px;
    font-weight: 500;
    border-radius: 9px !important;
    background: rgb(255 255 255) !important;
    color: #667781 !important;
    box-shadow: 0px 1px 0px #0000002e;
}

.chat-footer {
    flex: 0 0 auto;
    width: 100%;
    padding: 0 12px 12px !important;
    position: relative !important;
    z-index: 9999999999 !important;

}

.chat-form {
    max-width: 1080px;
    margin: 0 auto !important;
    padding: 8px 12px;
    border: 0;
    border-radius: 18px;
    background: #ffffff !important;
    box-shadow: 0 1px 0 rgba(17, 27, 33, 0.04), 0 2px 8px rgba(17, 27, 33, 0.04);
}

.chat-form-inner {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
}

.chat-attach-menu {
    position: relative;
    flex: 0 0 auto;
}

.chat-attach-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: #111b21;
    cursor: pointer;
}

.chat-attach-toggle:hover,
.chat-attach-toggle:focus-visible {
    background: #f0f2f5;
    outline: none;
}

.chat-attach-toggle svg {
    width: 22px;
    height: 22px;
}

.chat-attach-actions {
    position: absolute;
    left: 0;
    bottom: calc(100% + 10px);
    z-index: 20;
    display: flex;
    flex-direction: column;
    min-width: 176px;
    padding: 6px;
    border: 1px solid #e6edef;
    border-radius: 14px;
    background: #ffffff;
    box-shadow: 0 12px 30px rgba(23, 37, 47, 0.16);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(5px);
    transition: opacity .16s ease, visibility .16s ease, transform .16s ease;
}

.chat-attach-actions.is-open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0);
}

.chat-attach-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    min-height: 42px;
    padding: 8px 10px;
    border-radius: 9px;
    color: #111b21;
    background: transparent;
    text-decoration: none;
    font-size: 0.85rem;
}

.chat-attach-btn:hover,
.chat-attach-btn:focus-visible {
    background: #f3f6f7;
    color: #111b21;
    outline: none;
}

.chat-attach-btn svg {
    width: 20px;
    height: 20px;
    flex: 0 0 20px;
}

.chat-input-wrap {
    flex: 1 1 auto;
    min-width: 0;
}

.chat-input-wrap input {
    width: 100%;
    border: 0;
    outline: none;
    box-shadow: none;
    background: transparent;
    color: #111b21;
    font-family: inherit;
    font-size: 0.95rem;
}

.chat-input-wrap input::placeholder {
    color: #9aa7b1;
}

.chat-send-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 0 0 auto;
}

.chat-send-actions button {
    width: 40px;
    height: 40px;
    border: 0;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

#recordAudioBtn {
    background: #edf4f4;
    color: #111b21;
}

#send {
    background: var(--shell-accent);
    color: #ffffff;
}

.messenger-shell .chat-footer form.chat-form[data-emoji-form] {
    width: 100%;
    max-width: 1080px;
    margin: 0 auto 0px !important;
    padding: 5px 8px;
    border: 1px solid #e4e8eb;
    border-radius: 999px;
    background: #ffffff;
    box-shadow: 0 2px 10px rgba(17, 27, 33, 0.08);
}

.messenger-shell .chat-footer .chat-input-wrap {
    min-height: 42px;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}

.messenger-shell .chat-footer .chat-input-wrap:focus-within {
    border: 0;
    background: transparent;
    box-shadow: none;
}

.messenger-shell .chat-footer .chat-input-wrap input {
    min-height: 42px;
    padding: 0 6px !important;
}

.messenger-shell .chat-form .form-control:focus {
    box-shadow: none;
}

.messenger-shell .chat-form .form-control::placeholder {
    color: #9aa7b1;
}

.messenger-shell .chat-form .btn-icon {
    width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.messenger-shell .chat-form .btn-primary {
    border-color: var(--messenger-primary);
    background: var(--messenger-primary);
}

.messenger-shell .chat-form .btn-primary:hover,
.messenger-shell .chat-form .btn-primary:focus {
    border-color: var(--messenger-primary-dark);
    background: var(--messenger-primary-dark);
}

.messenger-shell .chat-form .btn-secondary {
    border-color: #e6ecef;
    background: #f4f7f8;
    color: var(--messenger-ink);
}

.messenger-shell .chat-form .input-group-text {
    border: 0;
    background: transparent !important;
}

.messenger-shell .dropdown-menu,
.messenger-shell .modal-content {
    border: 1px solid var(--messenger-line);
    border-radius: 12px;
    box-shadow: var(--messenger-shadow);
}

.messenger-shell .dropdown-item {
    padding: 9px 14px;
    font-size: 0.78rem;
}

.messenger-shell .btn-outline-primary {
    --bs-btn-color: var(--messenger-primary);
    --bs-btn-border-color: #b9dddd;
    --bs-btn-hover-bg: var(--messenger-primary);
    --bs-btn-hover-border-color: var(--messenger-primary);
}

@media (max-width: 1199.98px) {
    .messenger-shell .chat-header {
        padding-inline: 16px !important;
    }

    .messenger-shell .chat-footer {
        padding-inline: 12px !important;
    }
}

@media (max-width: 575.98px) {
    .messenger-shell .chat-body-inner {
        padding: 20px 12px 96px !important;
    }

    .messenger-shell .chat-footer {
        padding-bottom: 10px !important;
    }

    .messenger-shell .message-text {
        max-width: 88vw;
    }

    .messenger-shell .chat-form {
        padding: 5px 6px;
    }
}

/* Application shell: navigation, chat list, and conversation workspace */
:root {
    --shell-ink: #17252f;
    --shell-muted: #7a8991;
    --shell-line: #e6edef;
    --shell-canvas: #f5f8f9;
    --shell-surface: #ffffff;
    --shell-accent: #168184;
    --shell-accent-soft: #e4f3f1;
    --shell-shadow: 0 16px 40px rgba(31, 61, 72, .07);
}

html,
body {
    background: var(--shell-canvas);
    color: var(--shell-ink);
    font-family: 'Poppins', sans-serif;
}

.layout {
    display: grid !important;
    grid-template-columns: 86px 360px minmax(0, 1fr);
    width: 100%;
    height: 100vh;
    min-height: 640px;
    background: var(--shell-canvas);
    overflow: hidden;
}

.navigation {
    grid-column: 1;
}

.sidebar {
    grid-column: 2;
    width: 100%;
    min-width: 0;
}


main.main {
    grid-column: 3;
    display: block;
    width: 100%;
    min-width: 0;
    min-height: 100%;
    height: 100%;
    background: #ffffff;

}

.navigation {
    position: relative;
    z-index: 5;
    padding: 20px 10px 16px;
    overflow: hidden;
    background: #13323b !important;
    border: 0;
    box-shadow: 8px 0 24px rgba(23, 53, 61, .08);
}

.navigation>a {
    position: relative;
    flex: 0 0 54px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 54px;
    height: 54px;
    margin: 0 auto 24px !important;
    padding: 8px;
    border-radius: 15px;
    background: #fff;
}

.navigation>a::after {
    position: absolute;
    right: -10px;
    bottom: -15px;
    left: -10px;
    border-bottom: 1px solid rgba(185, 218, 215, .25);
    content: "";
}

.navigation>a img {
    width: 100% !important;
    height: 100%;
    object-fit: contain;
}

.navigation .navbar-nav {
    gap: 7px;
    padding: 0 !important;
}

.navigation .nav-item {
    width: 100%;
}

.navigation .nav-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    margin: 0 auto;
    padding: 0 !important;
    border-radius: 13px;
    color: #b5c8ca;
    transition: background .2s ease, color .2s ease, transform .2s ease;
}

.navigation .nav-link:hover,
.navigation .nav-link:focus,
.navigation .nav-link.active {
    background: rgba(121, 199, 174, .16);
    color: #8ad5bd;
    transform: translateY(-1px);
}

.navigation .nav-link svg {
    width: 22px;
    height: 22px;
}

.navigation .icon,
.navigation .avatar {
    margin: 0 !important;
}

.navigation .badge {
    top: -3px;
    right: -5px;
    background: #78c9ae !important;
    color: #17353d;
}

.navigation .avatar {
    width: 38px;
    height: 38px;
    border: 2px solid #78c9ae;
}

.sidebar {
    position: relative;
    z-index: 3;
    min-width: 0;
    background: var(--shell-surface) !important;
    border-right: 1px solid var(--shell-line);
}

.sidebar .tab-content,
.sidebar .tab-pane {
    height: 100%;
    min-height: 0;
}

#tab-content-chats {
    background: var(--shell-surface);
    min-height: 0;
}

#tab-content-chats>.d-flex {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
}

#tab-content-chats>.d-flex>.hide-scrollbar {
    height: 100%;
    overflow: hidden auto;
}

#tab-content-chats .container {
    max-width: none;
    padding: 0px 18px 0px !important;
}

#tab-content-chats h2 {
    position: static !important;
    width: auto !important;
    padding: 0 !important;
    background: transparent !important;
    color: #1f687e;
    font-weight: 500;
    font-size: 1.25rem;
    letter-spacing: -.02em;
}

#tab-content-chats .card-list {
    height: auto !important;
    margin: 0 !important;
}





#tab-content-chats .chatfilter {
    width: 100%;
    min-height: 40px;
    padding: 8px 12px;
    border: 1px solid var(--shell-line);
    border-radius: 10px;
    color: var(--shell-ink);
    font-size: .80rem;
}

#chat-table {
    border-collapse: separate;
    border-spacing: 0 6px;
}

#chat-table_wrapper,
#chat-table_info,
#chat-table {
    width: auto !important;
    max-width: 100% !important;
}

#chat-table thead {
    display: none;
}

#chat-table tbody tr {
    display: block !important;
    border: 0 !important;
    border-radius: 12px !important;
    background: transparent !important;
    box-shadow: none !important;
    transition: background .2s ease, transform .2s ease !important;
}

#chat-table tbody tr:hover,
#chat-table tbody tr.active {
    background: rgb(17 62 69 / 6%) !important;
    transform: translateX(1px) !important;
}

#chat-table tbody td {
    display: block !important;
    padding: 0 !important;
    border: 0 !important;
}



#chat-table tbody tr td>a.card {
    display: block !important;
    width: 100% !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 12px !important;
    background: transparent !important;
    color: var(--shell-ink) !important;
    text-decoration: none !important;
    box-shadow: none !important;
    margin-bottom: 5px;
}

#chat-table tbody tr td>a.card:hover,
#chat-table tbody tr td>a.card:focus {
    text-decoration: none !important;
    color: var(--shell-ink) !important;
}

#chat-table tbody tr td>a.card .card-body {
    padding: 10px 10px 8px 7px !important;
    background: transparent !important;
    border-radius: 12px !important;
    margin-right: -32px !important;
}

#chat-table tbody tr td>a.card .row {
    --bs-gutter-x: 10px !important;
    align-items: center !important;
    margin: 0 !important;
}

#chat-table tbody tr td>a.card .avatar {
    width: 38px !important;
    height: 38px !important;
    border-radius: 50% !important;
    overflow: hidden !important;
    border: 1px solid rgba(17, 62, 69, .08) !important;
    box-shadow: none !important;
    background: #eef3f4 !important;
}

#chat-table tbody tr td>a.card .avatar img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
}

#chat-table tbody tr td>a.card .avatar.avatar-initials {
    display: flex;
    align-items: center;
    justify-content: center;
    border: 0 !important;
    background: hsl(var(--avatar-hue, 180), 46%, 43%) !important;
    color: #ffffff;
    font-size: 0.9rem;
    font-weight: 500;
    line-height: 1;
    letter-spacing: 0;
}

#chat-table tbody tr td>a.card h5 {
    margin: 0 !important;
    font-size: .88rem !important;
    font-weight: 500 !important;
    letter-spacing: -.01em !important;
    color: var(--shell-ink) !important;
}

.avatar-online::before {
    background: #10c246;
}

.avatar-offline::before {
    background: #ff4d4d;
    top: 12px!important;
}


.avatar-offline::before,
.avatar-online::before {
    position: absolute;
    border-radius: 50%;
    display: block;
    content: "";
    height: 8px;
    width: 8px;
    top: 20%;
    left: 13%;

}








#chat-table tbody tr td>a.card .small {
    font-size: .6rem !important;
    color: rgb(55 71 78 / 68%) !important;
    white-space: nowrap !important;
}

#chat-table tbody tr td>a.card .d-flex.align-items-center.mb-3 {
    margin-bottom: 4px !important;
}

#chat-table tbody tr td>a.card .line-clamp {
    display: block !important;
    max-width: 100% !important;
    overflow: hidden !important;
    color: rgb(55 71 78 / 70%) !important;
    font-size: .7rem !important;
    line-height: 1.3 !important;
    white-space: nowrap !important;
    text-overflow: ellipsis !important;
}

#chat-table tbody tr td>a.card .badge-circle {
    min-width: 18px !important;
    height: 18px !important;
    padding: 0 5px !important;
    border-radius: 999px !important;
    font-size: .52rem !important;
    line-height: 18px !important;
    background: #396e7c !important;
    color: #fff !important;
}

#chat-table tbody tr td>a.card .badge-circle span {
    display: inline-block !important;
    min-width: 8px !important;
}

#groupChatsBox {
    margin-top: 24px;
    padding-top: 18px;
    border-top: 1px solid var(--shell-line);
}

main.main {
    position: relative;
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    width: 100%;
    min-width: 0;
    min-height: 100%;
    height: 100%;
    padding: 0 !important;
    background-color: var(--shell-canvas);
    background-image: url('../images/chat-bg1.png');
    background-repeat: no-repeat;
    background-position: center center;
    background-size: cover;
}

.main.is-visible {
    visibility: visible;
    transform: translateX(0);
}

#content__inner {
    display: block;
    width: 100%;
    height: 100%;
    min-height: 100%;
    max-width: none;
    padding: 0 !important;
    background: transparent;
}

#content__inner>div {
    min-width: 0;
    height: 100%;
}

#conversation-shell {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-width: 0;
    background: transparent;
}

#conversation-shell>div:first-child {
    position: relative;
    z-index: 2;
    min-height: 76px;
    padding: 14px 24px;
    background: var(--shell-surface);
    border-bottom: 1px solid var(--shell-line);
    box-shadow: 0 3px 14px rgba(31, 61, 72, .04);
}

#conversation-shell>div:first-child h5 {
    margin: 0;
    color: var(--shell-ink);
    font-size: .92rem;
    font-weight: 600;
}

#conversation-shell>div:first-child p {
    margin: 3px 0 0;
    color: var(--shell-muted);
    font-size: .7rem;
}

#conversation-shell>div:first-child img {
    width: 44px;
    height: 44px;
    border: 3px solid var(--shell-accent-soft);
    border-radius: 50%;
    object-fit: cover;
}

#conversation-shell form[data-emoji-form] {
    position: relative;
    z-index: 3;
    margin: 0 22px 18px !important;
    padding: 7px 10px;
    border: 1px solid var(--shell-line);
    border-radius: 16px;
    background: var(--shell-surface);
    box-shadow: var(--shell-shadow);
}


#chat-body-inner,
[id^="chat"].chat-body-inner {
    min-width: 0;
}

#msg {
    min-height: 42px !important;
    padding: 10px 14px !important;
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    font-size: .8rem;
}

#recordAudioBtn,
#send {
    width: 40px;
    height: 40px;
    margin-left: 8px !important;
    border: 0;
    box-shadow: none;
}

#send {
    background: var(--shell-accent);
}

#recordAudioBtn {
    background: #edf4f4;
    color: var(--shell-ink);
}

.chat-send-actions button {
    display: none;
}

.chat-form-inner:not(.has-message) .chat-send-actions #recordAudioBtn,
.chat-form-inner.has-message .chat-send-actions #send {
    display: inline-flex;
}

@media (max-width: 1199.98px) {
    .layout {
        grid-template-columns: 86px 360px minmax(0, 1fr);
    }

    .navigation {
        grid-column: 1;
    }

    .sidebar {
        grid-column: 2;
    }

    main.main {
        position: relative !important;
        top: auto !important;
        right: auto !important;
        bottom: auto !important;
        left: auto !important;
        width: 100% !important;
        height: 100% !important;
        z-index: 1;
        visibility: visible !important;
        transform: none !important;
        transition: none;
    }

    .main.is-visible {
        visibility: visible !important;
        transform: none !important;
    }
}

@media (max-width: 991.98px) {
    .layout {
        grid-template-columns: 80px 310px minmax(0, 1fr);
    }
}

@media (max-width: 767.98px) {
    .layout {
        display: flex !important;
        flex-direction: column;
        height: 100dvh;
        min-height: 0;
    }

    .navigation {
        flex: 0 0 62px;
        width: 100%;
        padding: 6px 10px;
    }

    .navigation>a {
        display: none;
    }

    .navigation .navbar-nav {
        flex-direction: row !important;
        justify-content: space-around !important;
        gap: 2px;
    }

    .navigation .nav-item {
        width: auto;
    }

    .navigation .nav-item:nth-child(n+7) {
        display: none;
    }

    .navigation .nav-link {
        width: 42px;
        height: 42px;
    }

    .navigation .nav-item.align-content-end {
        display: block;
        margin-left: 0;
    }

    .sidebar {
        flex: 1 1 48%;
        min-height: 245px;
        border-right: 0;
        border-bottom: 1px solid var(--shell-line);
    }

    main.main {
        flex: 1 1 52%;
        min-height: 0;
    }

    #tab-content-chats .container {
        padding: 15px 14px !important;
    }

    #tab-content-chats h2 {
        font-size: 1.08rem;
    }

    #conversation-shell>div:first-child {
        padding: 12px 15px;
    }

    #conversation-shell form[data-emoji-form] {
        margin: 0 10px 10px !important;
    }
}

/* Keep the icon rail as its own scroll area on desktop. */
@media (min-width: 768px) {

    html,
    body {
        height: 100%;
        overflow: hidden;
    }

    .layout {
        height: 100vh;
        min-height: 0;
        overflow: hidden;
    }

    .navigation {
        height: 100vh;
        min-height: 0;
        overflow-x: hidden;
        overflow-y: hidden;
        overscroll-behavior: contain;
        scrollbar-width: none;
    }

    .navigation::-webkit-scrollbar {
        display: none;
        width: 0;
    }

    .navigation .navbar-nav {
        display: flex;
        flex: 0 0 auto !important;
        flex-direction: column !important;
        justify-content: flex-start !important;
        align-items: center !important;
        position: absolute;
        top: 104px;
        right: 0;
        bottom: 0;
        left: 0;
        min-height: 0 !important;
        height: auto !important;
        max-height: none;
        overflow-x: hidden;
        overflow-y: auto;
        overscroll-behavior: contain;
        scrollbar-width: none;
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 !important;
        padding-right: 0 !important;
        padding-left: 0 !important;
        box-sizing: border-box;
    }

    .navigation .navbar-nav::-webkit-scrollbar {
        display: none;
        width: 0;
    }

    .navigation>a {
        position: absolute;
        top: 20px;
        left: 50%;
        z-index: 22;
        flex: 0 0 54px;
        margin: 0 !important;
        background: #fff;
        transform: translateX(-50%);
    }

    .navigation .navbar-nav>.nav-item:last-child {
        position: sticky;
        bottom: 0;
        z-index: 3;
        display: flex !important;
        align-items: center;
        justify-content: center;
        height: 62px;
        min-height: 62px;
        margin-top: 8px;
        background: #17353d;
    }

    .navigation .nav-item,
    .navigation .nav-link {
        display: block !important;
        flex: 0 0 46px !important;
        box-sizing: border-box;
        visibility: visible;
        opacity: 1;
    }

    .navigation .nav-item {
        width: 100% !important;
    }

    .navigation .navbar-nav>.nav-item:last-child {
        flex: 0 0 62px !important;
        width: 100% !important;
    }

    .navigation .nav-link {
        display: flex !important;
        color: #b5c8ca !important;
        margin: 0 auto !important;
    }

    .navigation .nav-link svg {
        display: block !important;
        visibility: visible;
        opacity: 1;
        stroke: currentColor !important;
    }
}

/* Explicit navigation zones: fixed header, scrollable menu, fixed footer. */
@media (min-width: 768px) {
    .navigation {
        display: flex !important;
        flex-direction: column !important;
        flex-wrap: nowrap !important;
        align-items: stretch !important;
        width: 100%;
        min-width: 0;
        overflow: hidden !important;
        padding: 20px 10px 12px;
        box-sizing: border-box;
    }

    .navigation-header {
        position: relative;
        z-index: 3;
        display: flex;
        flex: 0 0 72px;
        align-items: flex-start;
        justify-content: center;
        width: 100%;
        border-bottom: 1px solid rgba(185, 218, 215, .25);
    }

    .navigation-header>a {
        display: flex !important;
        align-items: center;
        justify-content: center;
        width: 54px;
        height: 54px;
        margin: 0 !important;
        padding: 8px;
        border-radius: 15px;
        background: #fff;
    }

    .navigation-header>a img {
        width: 100% !important;
        height: 100%;
        object-fit: contain;
    }

    .navigation-main {
        flex: 1 1 0;
        min-height: 0;
        width: auto;
        min-width: 0;
        align-self: stretch;
        overflow-x: hidden;
        overflow-y: auto;
        overscroll-behavior: contain;
        scrollbar-width: none;
        box-sizing: border-box;
    }

    .navigation-main::-webkit-scrollbar {
        display: none;
        width: 0;
    }

    .navigation-main>.navbar-nav {
        position: static !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: flex-start !important;
        width: 100% !important;
        min-height: max-content !important;
        height: auto !important;
        max-height: none !important;
        margin: 0 !important;
        padding: 10px 0 !important;
        overflow: visible !important;
    }

    .navigation-main .nav-item {
        display: block !important;
        flex: 0 0 50px !important;
        width: 100% !important;
        position: static !important;
        margin-top: 0 !important;
        margin-bottom: 0 !important;
    }

    .navigation-main .nav-item:last-child {
        position: static !important;
        bottom: auto !important;
        flex: 0 0 50px !important;
        height: 50px !important;
        min-height: 50px !important;
        margin-top: 0 !important;
        background: transparent !important;
    }

    .navigation-main .nav-link {
        display: flex !important;
        width: 50px;
        height: 50px;
        margin: 0 auto !important;
    }

    .navigation-main .icon-badged {
        position: relative;
        display: flex;
        align-items: center;
        justify-content: center;
        width: 100%;
        height: 100%;
    }

    .navigation-main .icon-badged>svg {
        width: 22px;
        height: 22px;
    }

    .navigation-main .icon-badged>.badge {
        position: absolute;
        top: -2px;
        right: 1px;
        display: flex !important;
        align-items: center;
        justify-content: center;
        width: 25px;
        height: 25px;
        padding: 0;
        border: 2px solid #17353d;
        border-radius: 50%;
        background: #ffffff !important;
        color: #000000 !important;
        font-size: 15px;
        line-height: 1;
        opacity: 1 !important;
        visibility: visible !important;
    }

    .navigation-main .icon-badged>.badge span {
        display: block;
        line-height: 1;
    }

    .navigation-footer {
        display: flex;
        flex: 0 0 76px;
        align-items: center;
        justify-content: center;
        width: 100%;
        border-top: 1px solid rgba(185, 218, 215, .22);
        background: #15323a;
    }

    .navigation-footer>a {
        position: relative;
        display: flex !important;
        align-items: center;
        justify-content: center;
        width: 54px;
        height: 54px;
        margin: 0 !important;
        border: 1px solid rgba(121, 199, 174, .28);
        border-radius: 16px;
        background: rgba(255, 255, 255, .06);
        box-shadow: 0 8px 18px rgba(7, 25, 30, .16);
        transition: background .2s ease, border-color .2s ease, transform .2s ease;
    }

    .navigation-footer>a:hover,
    .navigation-footer>a:focus-visible {
        border-color: rgba(121, 199, 174, .72);
        background: rgba(121, 199, 174, .16);
        transform: translateY(-2px);
    }

    .navigation-footer>a::after {
        position: absolute;
        right: 2px;
        bottom: 2px;
        width: 12px;
        height: 12px;
        border: 3px solid #15323a;
        border-radius: 50%;
        background: #62c99e;
        content: "";
    }

    .navigation-footer .avatar {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 42px;
        height: 42px;
        margin: 0 !important;
        border: 0;
        border-radius: 50%;
        overflow: hidden;
        background: #233e46;
    }

    .navigation-footer .avatar-img {
        display: block;
        width: 100%;
        height: 100%;
        object-fit: cover;
    }
}

.navigation-main .nav-link[data-bs-toggle="tooltip"] {
    position: relative;
}

/* Sidebar navigation tooltip */
.navigation-main .nav-link[data-tooltip] {
    position: relative;
}

.navigation-main .nav-link[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    top: 50%;
    left: calc(100% - 10px);
    z-index: 1090;
    width: max-content;
    max-width: 220px;
    padding: 7px 11px;
    border: 1px solid rgba(121, 199, 174, .3);
    border-radius: 7px;
    background: #102d35;
    box-shadow: 0 8px 20px rgba(16, 45, 53, .25);
    color: #f4fffd;
    font-family: 'Poppins', sans-serif;
    font-size: .68rem;
    font-weight: 500;
    line-height: 1.2;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transform: translate(0, -50%) scale(.96);
    transform-origin: left center;
    transition: opacity .15s ease, transform .15s ease;
}

.navigation-main .nav-link[data-tooltip]::before {
    content: "";
    position: absolute;
    top: 50%;
    left: calc(100% - 3px);
    z-index: 1091;
    width: 8px;
    height: 8px;
    background: #102d35;
    opacity: 0;
    pointer-events: none;
    transform: translate(-50%, -50%) rotate(45deg);
    transition: opacity .15s ease;
}

.navigation-main .nav-link[data-tooltip]:hover::after,
.navigation-main .nav-link[data-tooltip]:focus-visible::after,
.navigation-main .nav-link[data-tooltip]:hover::before,
.navigation-main .nav-link[data-tooltip]:focus-visible::before {
    opacity: 1;
}

.navigation-main .nav-link[data-tooltip]:hover::after,
.navigation-main .nav-link[data-tooltip]:focus-visible::after {
    transform: translate(8px, -50%) scale(1);
}

@media (max-width: 767.98px) {
    .navigation-main .nav-link[data-tooltip]::before,
    .navigation-main .nav-link[data-tooltip]::after {
        display: none;
    }
}

.navigation-main+.navigation-footer,
.tooltip[data-popper-placement="right"],
.tooltip.bs-tooltip-end {
    z-index: 1080;
}

.navigation-main .tooltip {
    --bs-tooltip-bg: #102d35;
    --bs-tooltip-color: #f4fffd;
    --bs-tooltip-opacity: 1;
    font-family: 'Poppins', sans-serif;
    font-size: .68rem;
    font-weight: 500;
    letter-spacing: .01em;
}

.chat-tooltip .tooltip-inner {
    padding: 8px 11px;
    border: 1px solid rgba(121, 199, 174, .3);
    border-radius: 8px;
    background: #102d35;
    box-shadow: 0 8px 20px rgba(16, 45, 53, .2);
    color: #f4fffd;
    font-family: 'Poppins', sans-serif;
    font-size: .68rem;
    font-weight: 500;
}

.chat-tooltip .tooltip-arrow::before {
    border-bottom-color: #102d35;
}

@media (max-width: 767.98px) {
    .tooltip.chat-tooltip {
        display: none !important;
    }
}

.tooltip[data-popper-placement="right"] .tooltip-inner,
.tooltip.bs-tooltip-end .tooltip-inner {
    width: max-content;
    min-width: 0;
    max-width: min(220px, calc(100vw - 110px));
    padding: 8px 11px;
    border: 1px solid rgba(121, 199, 174, .3);
    border-radius: 8px;
    background: #102d35;
    box-shadow: 0 8px 20px rgba(16, 45, 53, .2);
    color: #f4fffd;
    text-align: left;
    white-space: nowrap;
}

.tooltip[data-popper-placement="right"] .tooltip-arrow::before,
.tooltip.bs-tooltip-end .tooltip-arrow::before {
    border-right-color: #102d35;
}

.chat-modal-shell {
    position: relative;
    display: flex;
    flex-direction: column;
    width: min(100%, 520px);
    height: auto;
    max-height: min(535px, calc(100vh - 24px));
    min-height: 0;
    margin: 0 auto;
    overflow: hidden;
    /* border: 1px solid var(--shell-line); */
    border-radius: 22px;
    background: var(--shell-surface);
    box-shadow: var(--shell-shadow);
}

.modal-content {
    border-radius: 20px;
}

.chat-modal-header {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 12px;
    padding: 22px 22px 18px;
    border-bottom: 1px solid var(--shell-line);
    background: linear-gradient(180deg, rgba(22, 129, 132, 0.08), rgba(22, 129, 132, 0.02));
}

.chat-modal-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 14px;
    background: rgba(22, 129, 132, 0.12);
    color: var(--shell-accent);
}

.chat-modal-icon svg {
    width: 22px;
    height: 22px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.chat-modal-header-copy {
    flex: 1 1 auto;
    min-width: 0;
}

.chat-modal-kicker {
    display: block;
    margin: 0;
    color: var(--shell-muted);
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.chat-modal-title {
    margin: 4px 0 0;
    color: #0a4345;
    font-size: 1.4rem;
    /* font-weight: 600; */
    letter-spacing: -.02em;
}

.chat-modal-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    border: 1px solid #275c74;
    border-radius: 10px;
    background: #275c74;
    color: #ffffff;
    cursor: pointer;
    transition: border-color .16s ease, color .16s ease, background-color .16s ease;
}

.chat-modal-close:hover,
.chat-modal-close:focus-visible {
    border-color: #17252f;
    background: #17252f;
    color: #ffffff;
    outline: none;
}

.chat-modal-close svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.chat-modal-body {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
    background: linear-gradient(180deg, rgba(19, 71, 78, 0.02), rgba(19, 71, 78, 0.00));
}

.chat-form-intro {
    margin: 0 0 18px;
    padding: 12px 14px;
    border: 1px solid rgba(22, 129, 132, 0.12);
    border-radius: 12px;
    background: rgba(22, 129, 132, 0.04);
}

.chat-form-intro p {
    margin: 0;
    color: var(--shell-muted);
    font-size: 0.8rem;
    line-height: 1.5;
}

#myModal .modal-dialog:has(.chat-compose-modal) {
    width: min(560px, calc(100% - 24px));
    max-width: 560px;
    margin: 12px auto;
}

#myModal .modal-dialog:has(.chat-compose-modal--template) {
    width: min(800px, calc(100% - 32px));
    max-width: 800px;
}

#myModal .modal-content:has(.chat-compose-modal) {
    overflow: hidden;
    border: 1px solid #e4eaed;
    border-radius: 20px;
    background: #ffffff;
    box-shadow: 0 24px 64px rgba(23, 37, 47, 0.2);
}

.chat-compose-modal {
    display: flex;
    flex-direction: column;
    max-height: min(88vh, 760px);
    color: var(--shell-ink, #17252f);
}

.chat-compose-modal .chat-modal-header {
    padding: 22px 24px 20px;
    background: linear-gradient(135deg, #e9f5f3 0%, #f7faf9 72%);
}

.chat-compose-modal .chat-modal-icon {
    flex: 0 0 48px;
}

.chat-compose-modal .chat-modal-title {
    font-size: 1.25rem;
    font-weight: 600;
    letter-spacing: 0;
    line-height: 1.25;
}

.chat-compose-subtitle {
    margin: 5px 0 0;
    color: #667781;
    font-size: 0.8rem;
    line-height: 1.45;
}

.chat-compose-modal__body {
    min-height: 0;
    padding: 22px 24px 24px;
    overflow-y: auto;
    background: #ffffff;
}

.chat-compose-form,
.chat-compose-form-content {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.chat-compose-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
}

.chat-compose-label,
.chat-compose-modal label {
    margin: 0;
    color: #263942;
    font-size: 0.83rem;
    font-weight: 600;
    line-height: 1.35;
}

.chat-compose-label span {
    color: #7a8991;
    font-size: 0.76rem;
    font-weight: 400;
}

.chat-compose-help {
    display: block;
    margin: 0;
    color: #73828a;
    font-size: 0.74rem;
    line-height: 1.45;
}

.chat-compose-modal .chat-compose-file,
.chat-compose-modal .form-control,
.chat-compose-modal .form-select {
    min-height: 44px;
    border: 1px solid #dce5e8;
    border-radius: 10px;
    background-color: #fbfcfc;
    color: #17252f;
    font-family: inherit;
    font-size: 0.86rem;
    box-shadow: none;
}

.chat-compose-modal .chat-compose-file {
    height: auto;
    padding: 7px;
}

.chat-compose-modal .chat-compose-file::file-selector-button {
    min-height: 30px;
    margin: 0 10px 0 0;
    padding: 5px 11px;
    border: 0;
    border-radius: 7px;
    background: #e6f3f1;
    color: #126d70;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
}

.chat-compose-modal .chat-compose-file::file-selector-button:hover {
    background: #d8ebe8;
}

.chat-compose-modal .chat-compose-textarea {
    min-height: 104px;
    padding: 11px 12px;
    line-height: 1.5;
    resize: vertical;
}

.chat-compose-modal textarea#template-content[name="template"] {
    min-height: 170px;
    background: #fbfcfc;
    line-height: 1.55;
}

.chat-compose-modal .form-control:focus,
.chat-compose-modal .form-select:focus {
    border-color: rgba(22, 129, 132, 0.55);
    background-color: #ffffff;
    box-shadow: 0 0 0 3px rgba(22, 129, 132, 0.1);
}

.chat-compose-modal .select2-container {
    display: inline-block;
    width: 100% !important;
    box-sizing: border-box;
    vertical-align: middle;
}

.chat-compose-modal #tableSelector:not(.select2-hidden-accessible) {
    width: 100% !important;
    min-height: 44px;
    padding: 10px 13px;
    border: 1px solid #dce5e8;
    border-radius: 10px;
    background: #fbfcfc;
    color: #17252f;
    font: inherit;
    font-size: 0.86rem;
}

.chat-compose-modal #tableSelector.select2-hidden-accessible {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

.chat-compose-modal .select2-container--default .select2-selection--single {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
    min-height: 44px;
    border: 1px solid #dce5e8;
    border-radius: 10px;
    background: #fbfcfc;
    box-sizing: border-box;
}

.chat-compose-modal .select2-container--default .select2-selection--single .select2-selection__rendered {
    display: block;
    flex: 1 1 auto;
    min-width: 0;
    margin: 0;
    padding: 0 38px 0 12px;
    color: #17252f;
    font-size: 0.86rem;
    line-height: 42px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.chat-compose-modal .select2-container--default .select2-selection--single .select2-selection__arrow {
    display: block;
    position: absolute;
    top: 0;
    right: 0;
    width: 36px;
    height: 42px;
    border: 0;
    border-radius: 0 9px 9px 0;
    background: #fbfcfc;
}

.chat-compose-modal .select2-container--default .select2-selection--single .select2-selection__arrow b {
    left: 50%;
    top: 50%;
}

.chat-template-options {
    position: absolute;
    z-index: 1075;
    overflow: hidden;
    border: 1px solid #dce5e8 !important;
    border-radius: 10px;
    background: #ffffff;
    box-shadow: 0 12px 28px rgba(23, 37, 47, 0.16);
}

.chat-template-options .select2-search--dropdown {
    display: block;
    margin: 0;
    padding: 9px;
    border-bottom: 1px solid #e8eef0;
    background: #ffffff;
}

.chat-template-options .select2-search__field {
    display: block;
    width: 100%;
    min-height: 36px;
    padding: 7px 10px;
    border: 1px solid #dce5e8;
    border-radius: 7px;
    background: #fbfcfc;
    color: #17252f;
    font: inherit;
    font-size: 0.82rem;
    box-sizing: border-box;
}

.chat-template-options .select2-search__field:focus {
    border-color: rgba(22, 129, 132, 0.55);
    outline: 0;
    box-shadow: 0 0 0 3px rgba(22, 129, 132, 0.1);
}

.chat-template-options .select2-results__options {
    max-height: 240px;
    margin: 0;
    padding: 5px;
    overflow-x: hidden;
    overflow-y: auto;
    list-style: none;
    background: #ffffff;
}

.chat-template-options .select2-results__option {
    display: block;
    padding: 9px 10px;
    border-radius: 7px;
    color: #263942;
    font-size: 0.82rem;
    line-height: 1.35;
    cursor: pointer;
}

.chat-template-options .select2-results__option--highlighted[aria-selected] {
    background: #e6f3f1;
    color: #126d70;
}

.chat-template-options .select2-results__option[aria-selected="true"] {
    background: #f0f7f6;
    color: #126d70;
    font-weight: 600;
}

.chat-compose-modal #document-header-box > .border {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent;
}

.chat-compose-modal #document-preview {
    min-width: 0;
    margin-bottom: 0 !important;
}

.chat-template-document-preview {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    padding: 0 0 13px;
    border-bottom: 1px solid #e5ecee;
}

.chat-template-document-icon {
    display: inline-flex;
    flex: 0 0 42px;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 10px;
    background: #e6f3f1;
    color: #168184;
}

.chat-template-document-icon svg {
    width: 22px;
    height: 22px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.chat-template-document-copy {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    min-width: 0;
    gap: 4px;
}

.chat-template-document-name {
    display: block;
    max-width: 100%;
    overflow: hidden;
    color: #17252f;
    font-size: 0.84rem;
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.chat-template-document-status {
    color: #73828a;
    font-size: 0.74rem;
    line-height: 1.35;
}

.chat-compose-modal #document-header-box > .form-label,
.chat-compose-modal #template-components-box > .form-label {
    margin-bottom: 0;
    color: #263942;
    font-size: 0.86rem;
    font-weight: 600;
}

.chat-compose-modal #template-components {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.chat-compose-modal #template-components > .mb-3.border {
    margin: 0 !important;
    padding: 14px !important;
    border: 1px solid #e3eaed !important;
    border-radius: 10px !important;
    background: #f8fafb;
}

.chat-compose-modal #template-components .row {
    row-gap: 12px;
}

.chat-compose-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid #e9eef0;
}

.chat-compose-submit {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 0 18px;
    border: 0;
    border-radius: 10px;
    background: #168184;
    color: #ffffff;
    font-size: 0.84rem;
    font-weight: 600;
    transition: background-color .16s ease, transform .16s ease;
}

.chat-compose-submit:hover,
.chat-compose-submit:focus-visible {
    background: #116c6f;
    color: #ffffff;
    transform: translateY(-1px);
}

.chat-compose-submit:focus-visible {
    outline: 3px solid rgba(22, 129, 132, 0.2);
    outline-offset: 2px;
}

@media (max-width: 575.98px) {
    #myModal .modal-dialog:has(.chat-compose-modal) {
        width: calc(100% - 20px);
        margin: 10px auto;
    }

    .chat-compose-modal .chat-modal-header {
        padding: 18px 18px 16px;
    }

    .chat-compose-modal__body {
        padding: 18px;
    }

    .chat-compose-footer {
        align-items: stretch;
        flex-direction: column;
    }

    .chat-compose-submit {
        width: 100%;
    }
}

.chat-modal-form {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    min-height: 0;
    gap: 0;
}

.chat-modal-scroll {
    flex: 1 1 auto;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 16px;
    scrollbar-width: thin;
    scrollbar-color: rgba(22, 129, 132, .38) transparent;
}

.chat-modal-scroll::-webkit-scrollbar {
    width: 8px;
}

.chat-modal-scroll::-webkit-scrollbar-track {
    background: transparent;
}

.chat-modal-scroll::-webkit-scrollbar-thumb {
    border: 2px solid transparent;
    border-radius: 999px;
    background: rgba(22, 129, 132, .38);
    background-clip: padding-box;
}

.chat-modal-scroll::-webkit-scrollbar-thumb:hover {
    background: rgba(22, 129, 132, .68);
    background-clip: padding-box;
}

.chat-modal-field {
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin-bottom: 22px;
}

.chat-modal-label {
    margin: 0;
    color: #0a4345;
    font-size: .92rem;
    font-weight: 500;
}

.chat-input-wrap {
    display: flex;
    align-items: center;
    gap: 0;
    width: 100%;
    min-height: 50px;
    padding: 0;
    border: 1px solid var(--shell-line);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.7);
    transition: border-color .16s ease, box-shadow .16s ease, background-color .16s ease;
}

.chat-input-wrap:focus-within {
    border-color: rgba(22, 129, 132, 0.4);
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(22, 129, 132, 0.08);
}

.chat-input-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 50px;
    flex: 0 0 52px;
    border-right: 1px solid #c4cece;
    background: rgb(243 255 255);
    border-radius: 14px 0 0 14px;
    color: var(--shell-muted);
}

.chat-input-icon svg {
    width: 22px;
    height: 22px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.chat-form-control,
.chat-form-select {
    width: 100%;
    min-height: 50px;
    padding: 0 16px 0 14px;
    border: 0;
    background: transparent;
    color: var(--shell-ink);
    font-size: 0.95rem;
    font-weight: 500;
    outline: none;
    box-shadow: none;
}

.chat-modal-shell .chat-form-control:autofill,
.chat-modal-shell .chat-form-control:-webkit-autofill,
.chat-modal-shell .chat-form-control:-webkit-autofill:hover,
.chat-modal-shell .chat-form-control:-webkit-autofill:focus {
    background-color: transparent !important;
    box-shadow: 0 0 0 1000px transparent inset !important;
    -webkit-box-shadow: 0 0 0 1000px transparent inset !important;
    -webkit-text-fill-color: var(--shell-ink) !important;
}

.chat-form-control::placeholder {
    color: #8797a0;
}

.chat-modal-textarea {
    display: block;
    width: 100%;
    min-height: 220px;
    padding: 14px 15px;
    border: 1px solid var(--shell-line);
    border-radius: 12px;
    outline: none;
    background: rgba(255, 255, 255, .78);
    color: var(--shell-ink);
    font-family: inherit;
    font-size: .88rem;
    font-weight: 400;
    line-height: 1.55;
    resize: vertical;
    transition: border-color .16s ease, box-shadow .16s ease, background-color .16s ease;
}

.chat-modal-textarea:focus {
    border-color: rgba(22, 129, 132, .45);
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(22, 129, 132, .08);
}

.chat-modal-textarea::placeholder {
    color: #8797a0;
}

.template-sync-dialog {
    width: min(520px, calc(100vw - 32px));
    max-width: 520px;
}

.template-sync-modal {
    width: 100%;
    max-width: none;
}

.template-sync-modal .chat-modal-body {
    padding: 20px 22px 22px;
}

.template-sync-modal .chat-form-intro {
    margin: 0;
}

.template-sync-modal .chat-modal-actions {
    margin: 20px -22px -22px;
}

#myModal .modal-dialog:has(.update-template-modal-header) {
    width: min(920px, calc(100vw - 32px));
    max-width: 920px;
    margin: 12px auto;
}

#myModal .modal-content:has(.update-template-modal-header) {
    overflow: hidden;
    border: 1px solid var(--shell-line);
    border-radius: 20px;
    background: var(--shell-surface);
    box-shadow: 0 22px 60px rgba(19, 46, 55, .2);
}

#myModal .modal-content:has(.update-template-modal-header) .modal-header {
    padding: 20px 28px 16px !important;
    border-bottom: 1px solid var(--shell-line) !important;
    background: linear-gradient(120deg, #ffffff, #f1f8f7);
}

#myModal .modal-content:has(.update-template-modal-header) .modal-header .modal-title {
    color: var(--shell-ink);
    font-family: inherit;
    font-size: 1.35rem;
    font-weight: 600;
}

#myModal .modal-content:has(.update-template-modal-header) form.ajaxForm {
    width: 100%;
}

#myModal .modal-content:has(.update-template-modal-header) .modal-body {
    max-height: calc(100dvh - 120px);
    overflow-y: auto;
    margin-right: 0 !important;
    margin-left: 0 !important;
    padding: 22px 28px 26px !important;
    scrollbar-width: thin;
    scrollbar-color: rgba(22, 129, 132, .38) transparent;
}

#myModal .modal-content:has(.update-template-modal-header) .modal-body::-webkit-scrollbar {
    width: 8px;
}

#myModal .modal-content:has(.update-template-modal-header) .modal-body::-webkit-scrollbar-thumb {
    border: 2px solid transparent;
    border-radius: 999px;
    background: rgba(22, 129, 132, .38);
    background-clip: padding-box;
}

#myModal .modal-content:has(.update-template-modal-header) .form-floating,
#myModal .modal-content:has(.update-template-modal-header) .form-floating > .form-control,
#myModal .modal-content:has(.update-template-modal-header) .form-floating > .form-select,
#myModal .modal-content:has(.update-template-modal-header) .form-control,
#myModal .modal-content:has(.update-template-modal-header) .form-select,
#myModal .modal-content:has(.update-template-modal-header) select {
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

@media (max-width: 767.98px) {
    #myModal .modal-dialog:has(.update-template-modal-header) {
        width: calc(100vw - 20px);
        max-width: none;
        margin: 10px auto;
    }

    #myModal .modal-content:has(.update-template-modal-header) .modal-body {
        max-height: calc(100dvh - 100px);
        padding: 16px !important;
    }

    #myModal .modal-content:has(.update-template-modal-header) .modal-header {
        padding: 16px 18px 14px !important;
    }
}

#myModal .modal-dialog:has(.api-settings-modal) {
    width: min(680px, calc(100vw - 32px));
    max-width: 680px;
    margin: 16px auto;
}

#myModal .modal-content:has(.api-settings-modal) {
    overflow: hidden;
    border: 1px solid var(--shell-line);
    border-radius: 18px;
    background: #ffffff;
    box-shadow: 0 22px 60px rgba(19, 46, 55, .2);
}

#myModal .api-settings-modal {
    display: flex;
    flex-direction: column;
    max-height: calc(100dvh - 32px);
    min-height: 0;
    overflow: hidden;
    background: #ffffff;
}

#myModal .api-settings-header {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 13px;
    padding: 19px 24px;
    border-bottom: 1px solid var(--shell-line);
    background: linear-gradient(120deg, #ffffff, #f1f8f7);
}

#myModal .api-settings-close {
    display: inline-flex;
    flex: 0 0 36px;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    margin-left: auto;
    padding: 0;
    border: 1px solid var(--shell-line);
    border-radius: 9px;
    background: #ffffff;
    color: var(--shell-muted);
    cursor: pointer;
    transition: border-color .16s ease, background-color .16s ease, color .16s ease;
}

#myModal .api-settings-close:hover,
#myModal .api-settings-close:focus-visible {
    border-color: rgba(22, 129, 132, .35);
    background: var(--shell-accent-soft);
    color: var(--shell-accent);
    outline: none;
}

#myModal .api-settings-icon {
    display: inline-flex;
    flex: 0 0 42px;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: var(--shell-accent-soft);
    color: var(--shell-accent);
    font-size: 1rem;
}

#myModal .api-settings-heading {
    min-width: 0;
}

#myModal .api-settings-kicker {
    display: block;
    margin-bottom: 3px;
    color: var(--shell-muted);
    font-size: .72rem;
    font-weight: 700;
    text-transform: uppercase;
}

#myModal .api-settings-title {
    margin: 0;
    color: var(--shell-ink);
    font-family: inherit;
    font-size: 1.3rem;
    font-weight: 600;
    line-height: 1.25;
}

#myModal .api-settings-form {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    min-height: 0;
}

#myModal .api-settings-form-target,
#myModal .api-settings-hidden {
    display: none;
}

#myModal .api-settings-body {
    flex: 1 1 auto;
    min-height: 0;
    max-height: calc(100dvh - 154px);
    margin: 0 !important;
    padding: 20px 24px 22px !important;
    overflow-x: hidden;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(22, 129, 132, .38) transparent;
}

#myModal .api-settings-body::-webkit-scrollbar {
    width: 8px;
}

#myModal .api-settings-body::-webkit-scrollbar-thumb {
    border: 2px solid transparent;
    border-radius: 999px;
    background: rgba(22, 129, 132, .38);
    background-clip: padding-box;
}

#myModal .api-settings-field {
    margin: 0 0 17px;
}

#myModal .api-settings-label {
    display: block;
    margin: 0 0 7px;
    color: #40555d;
    font-size: .86rem;
    font-weight: 600;
}

#myModal .api-settings-phone-group,
#myModal .api-settings-credential-group {
    display: flex;
    flex-flow: row nowrap !important;
    align-items: stretch !important;
    height: 58px;
    min-width: 0;
    padding: 0;
    overflow: hidden;
    border: 1px solid var(--shell-line);
    border-radius: 10px;
    background: #fbfdfd;
    transition: border-color .16s ease, box-shadow .16s ease, background-color .16s ease;
}

#myModal .api-settings-phone-group:focus-within,
#myModal .api-settings-credential-group:focus-within {
    border-color: rgba(22, 129, 132, .5);
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(22, 129, 132, .09);
}

#myModal .api-settings-input-icon {
    display: inline-flex;
    align-self: stretch !important;
    flex: 0 0 48px !important;
    align-items: center;
    justify-content: center;
    width: 48px !important;
    height: auto !important;
    min-height: 100%;
    margin: 0 !important;
    padding: 0 !important;
    box-sizing: border-box;
    border: 0 !important;
    border-radius: 9px 0 0 9px !important;
    background: #f0f7f6;
    color: var(--shell-accent);
}

#myModal .api-settings-icon svg,
#myModal .api-settings-input-icon svg,
#myModal .api-settings-close svg,
#myModal .api-settings-submit svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

#myModal .api-settings-icon svg {
    width: 22px;
    height: 22px;
}

#myModal .api-settings-country-code {
    position: absolute;
    inset: 0;
    z-index: 1;
    width: 100%;
    height: 100%;
    padding: 0;
    border: 0;
    outline: 0;
    background: transparent;
    color: transparent;
    -webkit-text-fill-color: transparent;
    font-family: inherit;
    font-size: .84rem;
    appearance: none;
    cursor: pointer;
}

#myModal .api-settings-country-control {
    position: relative;
    display: flex;
    flex: 0 0 80px;
    align-items: center;
    width: 138px;
    min-width: 0;
    border-right: 1px solid var(--shell-line);
    background: #f6faf9;
}

#myModal .api-settings-country-code option {
    color: var(--shell-ink);
    -webkit-text-fill-color: var(--shell-ink);
}

#myModal .api-settings-country-display {
    padding-left: 12px;
    color: var(--shell-ink);
    font-size: .86rem;
    pointer-events: none;
}

#myModal .api-settings-country-arrow {
    width: 15px;
    height: 15px;
    margin: 0 10px 0 auto;
    fill: none;
    stroke: #526970;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    pointer-events: none;
}

#myModal .api-settings-number {
    flex: 1 1 140px;
    width: 1%;
    min-width: 120px;
    min-height: 46px;
    padding: 9px 12px;
    border: 0;
    border-radius: 0;
    outline: 0;
    background: transparent;
    color: var(--shell-ink);
    font-family: inherit;
    font-size: .9rem;
    box-shadow: none;
}

#myModal .api-settings-rating-button {
    align-self: center;
    flex: 0 0 auto;
    min-height: 34px;
    margin: 0 6px 0 0;
    padding: 0 10px;
    border: 0;
    border-radius: 7px;
    background: var(--shell-accent-soft);
    color: var(--shell-accent);
    font-family: inherit;
    font-size: .78rem;
    font-weight: 600;
}

#myModal .api-settings-rating-button:hover,
#myModal .api-settings-rating-button:focus-visible {
    background: #d9eeeb;
    color: #116d70;
}

#myModal .api-settings-spinner {
    width: 10px;
    height: 10px;
    border-width: 2px;
}

#myModal .api-settings-credential-group .form-floating {
    flex: 1 1 auto;
    min-width: 0;
}

#myModal .api-settings-credential-group .form-control {
    flex: 1 1 0%;
    width: 1% !important;
    min-width: 0;
    height: auto !important;
    min-height: 100%;
    margin: 0 !important;
    padding: 0 14px !important;
    box-sizing: border-box;
    border: 0 !important;
    border-radius: 0 9px 9px 0;
    background: transparent;
    color: var(--shell-ink);
    font-family: inherit;
    font-size: .9rem;
    line-height: 1.4;
    box-shadow: none;
}

#myModal .api-settings-credential-group .form-control::placeholder {
    color: var(--shell-muted);
    opacity: 1;
}

#myModal .api-settings-note {
    margin-top: 10px;
    padding: 10px 12px;
    border-left: 3px solid #d6a83a;
    border-radius: 0 8px 8px 0;
    background: #fbf8ed;
    color: #6d6245;
    font-size: .82rem;
    line-height: 1.5;
}

#myModal .api-settings-rating-result {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-top: 10px;
    padding: 12px 14px;
    border: 1px solid var(--shell-line);
    border-radius: 10px;
    background: #f5f9f9;
}

#myModal .api-settings-rating-result.api-settings-hidden {
    display: none;
}

#myModal .api-settings-rating-result .small {
    color: var(--shell-muted);
    font-size: .76rem;
}

#myModal .api-settings-rating-result .fw-semibold {
    margin-top: 3px;
    color: var(--shell-ink);
    font-size: .88rem;
}

#myModal .api-settings-rating-error {
    margin-top: 10px;
    padding: 9px 12px;
    border: 1px solid #f2d2d2;
    border-radius: 8px;
    background: #fff7f7;
    color: #a94442;
    font-size: .82rem;
}

#myModal .api-settings-actions {
    display: flex;
    flex: 0 0 auto;
    justify-content: flex-end;
    padding: 14px 24px 18px;
    border-top: 1px solid var(--shell-line);
    background: #ffffff;
}

#myModal .api-settings-submit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 42px;
    padding: 0 17px;
    border: 1px solid var(--shell-accent);
    border-radius: 9px;
    background: var(--shell-accent);
    color: #ffffff;
    font-family: inherit;
    font-size: .86rem;
    font-weight: 600;
}

#myModal .api-settings-submit:hover,
#myModal .api-settings-submit:focus-visible {
    border-color: #116d70;
    background: #116d70;
    color: #ffffff;
}

@media (max-width: 767.98px) {
    #myModal .modal-dialog:has(.api-settings-modal) {
        width: calc(100vw - 20px);
        max-width: none;
        margin: 10px auto;
    }

    #myModal .api-settings-header {
        padding: 16px 18px;
    }

    #myModal .api-settings-body {
        max-height: calc(100dvh - 142px);
        padding: 16px 18px !important;
    }

    #myModal .api-settings-actions {
        padding: 12px 18px 16px;
    }
}

#myModal .modal-dialog:has(.add-template-modal-header) {
    width: min(900px, calc(100vw - 32px));
    max-width: 900px;
    margin: 12px auto;
}

#myModal .modal-content:has(.add-template-modal-header) {
    display: flex;
    flex-direction: column;
    max-height: calc(100dvh - 24px);
    overflow: hidden;
    border: 1px solid var(--shell-line);
    border-radius: 22px;
    background: var(--shell-surface);
    box-shadow: 0 22px 60px rgba(19, 46, 55, .2);
}

#myModal .modal-content:has(.add-template-modal-header) .add-template-modal-header {
    flex: 0 0 auto;
    padding: 20px 26px 18px !important;
    border-bottom: 1px solid var(--shell-line) !important;
    background: linear-gradient(180deg, rgba(22, 129, 132, .09), rgba(22, 129, 132, .02));
}

#myModal .modal-content:has(.add-template-modal-header) .add-template-modal-title {
    color: var(--shell-ink);
    font-size: 1.35rem;
    font-weight: 600;
    letter-spacing: 0;
}

#myModal .modal-content:has(.add-template-modal-header) .add-template-modal-subtitle {
    color: var(--shell-muted);
    font-size: .76rem;
}

#myModal .modal-content:has(.add-template-modal-header) .add-template-modal-icon {
    width: 46px;
    height: 46px;
    border: 0;
    border-radius: 14px;
    background: var(--shell-accent-soft);
    color: var(--shell-accent);
}

#myModal .modal-content:has(.add-template-modal-header) .add-template-modal-icon svg {
    width: 22px;
    height: 22px;
}

#myModal .modal-content:has(.add-template-modal-header)>form.ajaxForm {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    min-height: 0;
}

#myModal .modal-content:has(.add-template-modal-header) .add-template-modal-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    padding: 22px 26px 24px !important;
    background: linear-gradient(180deg, rgba(19, 71, 78, .025), rgba(19, 71, 78, 0));
    scrollbar-width: thin;
    scrollbar-color: rgba(22, 129, 132, .38) transparent;
}

#myModal .modal-content:has(.add-template-modal-header) .add-template-modal-body::-webkit-scrollbar {
    width: 8px;
}

#myModal .modal-content:has(.add-template-modal-header) .add-template-modal-body::-webkit-scrollbar-track {
    background: transparent;
}

#myModal .modal-content:has(.add-template-modal-header) .add-template-modal-body::-webkit-scrollbar-thumb {
    border: 2px solid transparent;
    border-radius: 999px;
    background: rgba(22, 129, 132, .38);
    background-clip: padding-box;
}

#myModal .modal-content:has(.add-template-modal-header) .template-form-section {
    margin-bottom: 16px;
    padding: 16px 18px;
    border: 1px solid var(--shell-line);
    border-radius: 12px;
    background: rgba(255, 255, 255, .88);
}

#myModal .modal-content:has(.add-template-modal-header) .template-form-section:last-child {
    margin-bottom: 0;
}

#myModal .modal-content:has(.add-template-modal-header) .template-form-section-title {
    color: var(--shell-ink);
    font-size: .84rem;
    font-weight: 600;
}

#myModal .modal-content:has(.add-template-modal-header) .template-form-section-title svg {
    color: var(--shell-accent);
}

#myModal .modal-content:has(.add-template-modal-header) .template-form-section-description,
#myModal .modal-content:has(.add-template-modal-header) .template-field-help {
    color: var(--shell-muted);
    font-size: .9rem;
}

#myModal .modal-content:has(.add-template-modal-header) .template-field-label {
    color: #40555d;
    font-size: .76rem;
    font-weight: 600;
}

#myModal .modal-content:has(.add-template-modal-header) .template-form-control {
    min-height: 44px;
    border-color: var(--shell-line) !important;
    border-radius: 9px !important;
    background-color: #ffffff !important;
    color: var(--shell-ink) !important;
    font-family: inherit;
    font-size: .82rem !important;
}

#myModal .modal-content:has(.add-template-modal-header) .template-form-control:focus {
    border-color: rgba(22, 129, 132, .5) !important;
    box-shadow: 0 0 0 3px rgba(22, 129, 132, .09) !important;
}

#myModal .modal-content:has(.add-template-modal-header) .template-media-box,
#myModal .modal-content:has(.add-template-modal-header) .template-component {
    border-color: var(--shell-line);
    border-radius: 10px;
    background: #f8fbfb;
}

#myModal .modal-content:has(.add-template-modal-header) .template-message-box {
    border-color: var(--shell-line);
    border-radius: 10px;
}

#myModal .modal-content:has(.add-template-modal-header) .template-message-box:focus-within {
    border-color: rgba(22, 129, 132, .5);
    box-shadow: 0 0 0 3px rgba(22, 129, 132, .08);
}

#myModal .modal-content:has(.add-template-modal-header) .template-message-textarea {
    color: var(--shell-ink) !important;
    font-family: inherit;
    font-size: .82rem !important;
}

#myModal .modal-content:has(.add-template-modal-header) .template-message-toolbar {
    border-color: var(--shell-line);
    background: #f7fafb;
}

#myModal .modal-content:has(.add-template-modal-header) .template-variable-btn {
    border-color: var(--shell-line);
    border-radius: 8px;
    color: var(--shell-accent);
}

#myModal .modal-content:has(.add-template-modal-header) .template-variable-btn:hover {
    border-color: rgba(22, 129, 132, .35);
    background: rgba(22, 129, 132, .06);
}

#myModal .modal-content:has(.add-template-modal-header) .template-component {
    padding: 14px;
}

#myModal .modal-content:has(.add-template-modal-header) .template-submit-area {
    position: sticky;
    bottom: -24px;
    z-index: 2;
    margin: 12px -26px -24px;
    padding: 14px 26px 18px;
    border-top: 1px solid var(--shell-line);
    background: rgba(255, 255, 255, .97);
}

#myModal .modal-content:has(.add-template-modal-header) .template-submit-btn {
    min-width: 150px;
    min-height: 44px;
    border: 1px solid var(--shell-accent);
    border-radius: 10px;
    background: var(--shell-accent);
    color: #ffffff;
    font-family: inherit;
    font-size: .82rem;
    font-weight: 600;
}

#myModal .modal-content:has(.add-template-modal-header) .template-submit-btn:hover {
    border-color: #116d70;
    background: #116d70;
    box-shadow: 0 8px 18px rgba(22, 129, 132, .18);
}

@media (max-width: 767.98px) {
    #myModal .modal-dialog:has(.add-template-modal-header) {
        width: calc(100vw - 20px);
        max-width: none;
        margin: 10px auto;
    }

    #myModal .modal-content:has(.add-template-modal-header) {
        max-height: calc(100dvh - 20px);
        border-radius: 18px;
    }

    #myModal .modal-content:has(.add-template-modal-header) .add-template-modal-body {
        padding: 16px !important;
    }

    #myModal .modal-content:has(.add-template-modal-header) .template-form-section {
        padding: 14px;
    }

    #myModal .modal-content:has(.add-template-modal-header) .template-submit-area {
        margin-right: -16px;
        margin-left: -16px;
        padding-right: 16px;
        padding-left: 16px;
    }
}

.chat-form-select {
    padding-right: 38px;
    background-image: linear-gradient(45deg, transparent 50%, #64818a 50%), linear-gradient(135deg, #64818a 50%, transparent 50%);
    background-position: calc(100% - 18px) calc(50% - 2px), calc(100% - 13px) calc(50% - 2px);
    background-size: 5px 5px, 5px 5px;
    background-repeat: no-repeat;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
}

.chat-form-control--compact {
    min-width: 0;
}

.chat-form-control--compact[type="number"] {
    appearance: textfield;
    -moz-appearance: textfield;
}

input:-internal-autofill-previewed {
    appearance: menulist-button;
    background-image: none !important;
    background-color: light-dark(rgba(232, 240, 254, 0), rgba(70, 90, 126, 0)) !important;
    color: fieldtext !important;
}

.chat-form-control--compact[type="number"]::-webkit-inner-spin-button,
.chat-form-control--compact[type="number"]::-webkit-outer-spin-button {
    margin: 0;
    -webkit-appearance: none;
}

.chat-input-wrap--split {
    position: relative;
    padding-right: 0;
}

.chat-input-wrap--split .chat-form-select {
    border-radius: 0 14px 14px 0;
    padding-left: 12px;
}

.chat-country-code-display {
    position: absolute;
    left: 66px;
    z-index: 1;
    color: var(--shell-ink);
    font-size: 0.9rem;
    font-weight: 500;
    line-height: 1;
    pointer-events: none;
}

.chat-country-select {
    flex: 0 0 82px;
    width: 82px;
    padding-right: 28px;
    color: transparent;
}

.chat-country-select option {
    color: var(--shell-ink);
}

.chat-input-wrap--split .chat-form-control--compact {
    border-left: 1px solid var(--shell-line);
    padding-left: 12px;
}

.chat-modal-actions {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    padding: 12px 22px 18px;
    border-top: 1px solid var(--shell-line);
    background: var(--shell-surface);
}

.user-permissions {
    min-width: 0;
    margin: 0;
    padding: 0;
    border: 0;
}

.user-permissions legend {
    float: none;
    width: auto;
    margin-bottom: 9px;
}

.user-permissions-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.user-permission-option {
    display: flex;
    align-items: center;
    gap: 9px;
    min-height: 42px;
    padding: 8px 10px;
    border: 1px solid var(--shell-line);
    border-radius: 10px;
    background: #ffffff;
    color: var(--shell-ink);
    font-size: 0.78rem;
    font-weight: 500;
    cursor: pointer;
}

.user-permission-option input {
    width: 16px;
    height: 16px;
    flex: 0 0 16px;
    margin: 0;
    accent-color: var(--shell-accent);
}

.user-permission-option:has(input:checked) {
    border-color: rgba(22, 129, 132, 0.38);
    background: rgba(22, 129, 132, 0.05);
}

.user-photo-optional {
    margin-left: 6px;
    color: var(--shell-muted);
    font-size: .7rem;
    font-weight: 400;
}

.user-password-toggle {
    display: inline-flex;
    flex: 0 0 44px;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 48px;
    padding: 0;
    border: 0;
    border-radius: 0 13px 13px 0;
    background: transparent;
    color: var(--shell-muted);
    cursor: pointer;
}

.user-password-toggle:hover,
.user-password-toggle:focus-visible {
    background: rgba(22, 129, 132, .06);
    color: var(--shell-accent);
    outline: none;
}

.user-password-toggle svg {
    width: 19px;
    height: 19px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.user-password-toggle-hide,
.user-password-toggle.is-visible .user-password-toggle-show {
    display: none;
}

.user-password-toggle.is-visible .user-password-toggle-hide {
    display: block;
}

.user-photo-upload {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 58px;
    padding: 10px 14px;
    border: 1px dashed #b9cccf;
    border-radius: 12px;
    background: #f8fbfb;
    color: var(--shell-ink);
    cursor: pointer;
    transition: border-color .16s ease, background-color .16s ease;
}

.user-photo-upload:hover,
.user-photo-upload:focus-within {
    border-color: var(--shell-accent);
    background: rgba(22, 129, 132, .04);
}

.user-photo-upload>svg {
    width: 21px;
    height: 21px;
    flex: 0 0 21px;
    fill: none;
    stroke: var(--shell-accent);
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.user-photo-upload>span {
    display: flex;
    flex-direction: column;
    gap: 3px;
    font-size: .78rem;
    font-weight: 600;
}

.user-photo-upload small {
    color: var(--shell-muted);
    font-size: .66rem;
    font-weight: 400;
}

.user-photo-upload input {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.app-delete-confirm.swal2-modal {
    position: relative !important;
    inset: auto !important;
    width: min(420px, calc(100vw - 32px)) !important;
    max-width: 100%;
    margin: auto !important;
    padding: 26px !important;
    border: 1px solid var(--shell-line);
    border-radius: 18px;
    background: var(--shell-surface);
    box-shadow: var(--shell-shadow);
    font-family: 'Poppins', sans-serif;
}

.app-delete-confirm.swal2-modal.swal2-hide {
    display: none !important;
}

.swal2-container:has(.app-delete-confirm) {
    position: fixed !important;
    inset: 0 !important;
    z-index: 20000 !important;
    display: flex;
    align-items: center !important;
    justify-content: center !important;
    box-sizing: border-box;
    padding: 16px !important;
    background: rgba(19, 46, 55, .42);
}

.swal2-container:has(.app-delete-confirm.swal2-hide) {
    display: none !important;
}

.app-delete-confirm .swal2-title {
    margin: 8px 0 0;
    color: var(--shell-ink);
    font-size: 1.15rem;
    font-weight: 600;
    text-align: center;
}

.app-delete-confirm .swal2-content {
    margin-top: 8px;
    color: var(--shell-muted);
    font-size: .82rem;
    line-height: 1.5;
    text-align: center;
}

.app-delete-confirm .swal2-icon.swal2-warning {
    display: flex !important;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    width: 48px;
    height: 48px;
    margin: 0 auto 14px;
    border: 3px solid #e7ad50;
    border-radius: 50%;
    color: #d59327;
    font-family: Georgia, serif;
    font-size: 30px;
    font-weight: 400;
    line-height: 1;

}

.app-delete-confirm .swal2-buttonswrapper {
    display: flex !important;
    justify-content: center;
    gap: 9px;
    margin-top: 20px;
}

.app-delete-confirm .swal2-buttonswrapper .swal2-styled {
    min-height: 40px;
    margin: 0;
    padding: 0 16px;
    border: 1px solid transparent;
    border-radius: 10px;
    font-family: inherit;
    font-size: .78rem;
    font-weight: 600;
    box-shadow: none;
    transition: background-color .16s ease, border-color .16s ease, transform .16s ease;
}

.app-delete-confirm .swal2-buttonswrapper .swal2-styled:hover {
    transform: translateY(-1px);
}

.app-delete-confirm .swal2-buttonswrapper .swal2-confirm {
    border-color: #b94339;
    background: #b94339;
    color: #ffffff;
}

.app-delete-confirm .swal2-buttonswrapper .swal2-cancel {
    border-color: var(--shell-line);
    background: #f4f8f8;
    color: var(--shell-ink);
}

.chat-modal-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    padding: 0 18px;
    border: 1px solid transparent;
    border-radius: 12px;
    font-size: 0.82rem;
    font-weight: 600;
    letter-spacing: .01em;
    cursor: pointer;
    transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease, background-color .16s ease, color .16s ease;
}

.chat-modal-button:hover,
.chat-modal-button:focus-visible {
    transform: translateY(-1px);
    outline: none;
}

.chat-modal-button--ghost {
    border-color: var(--shell-line);
    background: #f7fafb;
    color: var(--shell-ink);
}

.chat-modal-button--primary {
    border-color: var(--messenger-primary);
    background: var(--messenger-primary);
    color: #ffffff;
    box-shadow: 0 10px 22px rgba(31, 104, 126, 0.18);
}

@media (max-width: 575.98px) {
    .chat-modal-shell {
        border-radius: 18px;
    }

    .chat-modal-header {
        padding-left: 16px;
        padding-right: 16px;
    }

    .chat-modal-scroll {
        padding-right: 16px;
        padding-left: 16px;
    }

    .chat-modal-actions {
        padding-right: 16px;
        padding-left: 16px;
    }

    .chat-modal-button {
        width: min(100%, 190px);
    }
}

.management-page {
    display: flex;
    flex-direction: column;
    gap: 20px;
    width: 100%;
    height: 100%;
    min-height: 0;
    padding: 16px;
    overflow: hidden;
    background: var(--shell-canvas);
}

.management-page-scroll {
    flex: 1 1 auto;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    scrollbar-color: rgba(22, 129, 132, .38) transparent;
}

.management-page-scroll::-webkit-scrollbar {
    width: 8px;
}

.management-page-scroll::-webkit-scrollbar-track {
    background: transparent;
}

.management-page-scroll::-webkit-scrollbar-thumb {
    border: 2px solid transparent;
    border-radius: 999px;
    background: rgba(22, 129, 132, .38);
    background-clip: padding-box;
}

.management-page-scroll::-webkit-scrollbar-thumb:hover {
    background: rgba(22, 129, 132, .68);
    background-clip: padding-box;
}

.management-page-header {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.management-page-heading {
    min-width: 0;
}

.management-page-eyebrow {
    display: block;
    margin-bottom: 5px;
    color: var(--shell-accent);
    font-size: .69rem;
    font-weight: 700;
    text-transform: uppercase;
}

.management-page-title {
    margin: 0;
    color: var(--shell-ink);
    font-size: 1.45rem;
    font-weight: 600;
    line-height: 1.25;
}

.management-page-subtitle {
    margin: 5px 0 0;
    color: var(--shell-muted);
    font-size: .78rem;
}

.management-page-stat {
    display: grid;
    grid-template-columns: auto auto;
    align-items: baseline;
    column-gap: 8px;
    min-width: 125px;
    padding: 11px 14px;
    border: 1px solid var(--shell-line);
    border-radius: 10px;
    background: var(--shell-surface);
}

.management-page-stat>span {
    color: var(--shell-muted);
    font-size: .7rem;
    font-weight: 600;
}

.management-page-stat strong {
    color: var(--shell-ink);
    font-size: 1rem;
    font-weight: 700;
    text-align: right;
}

.management-page-stat strong span {
    color: var(--shell-muted);
    font-size: .78rem;
    font-weight: 500;
}

.management-page-stat small {
    grid-column: 1 / -1;
    color: var(--shell-muted);
    font-size: .63rem;
    text-align: right;
}

.management-table-panel {
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
    border: 1px solid var(--shell-line);
    border-radius: 10px;
    background: var(--shell-surface);
    box-shadow: 0 8px 22px rgba(31, 61, 72, .04);
}

.management-table-panel>.dataTables_wrapper {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
    min-height: 0;
}

.api-message-page {
    gap: 0px;
    padding: 12px;
}

.api-message-page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    min-height: 68px;
    padding: 2px 4px;
}

.api-message-table-panel {
    min-width: 0;
}

.api-message-table-panel>.dataTables_wrapper {
    display: grid;
    width: 100%;
    height: 100%;
    min-height: 0;
    grid-template-columns: minmax(0, 1fr) minmax(400px, 460px);
    grid-template-rows: auto minmax(0, 1fr) auto;
    grid-template-areas:
        "length filter"
        "table table"
        "info paginate";
    padding: 0;
}

.api-message-table-panel .dataTables_length,
.api-message-table-panel .dataTables_filter {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    min-height: 58px;
    margin: 0;
    padding: 10px 16px;
    border-bottom: 1px solid var(--shell-line);
    background: #ffffff;
    color: var(--shell-muted);
    font-size: .74rem;
}

.api-message-table-panel .dataTables_length {
    grid-area: length;
}

.api-message-table-panel .dataTables_length label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    white-space: nowrap;
}

.api-message-table-panel .dataTables_length select {
    width: 78px;
    height: 36px;
    min-height: 36px;
    padding: 0 26px 0 10px;
    border: 1px solid var(--shell-line);
    border-radius: 8px;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-color: #f8fbfb;
    background-image: linear-gradient(45deg, transparent 50%, #71838b 50%), linear-gradient(135deg, #71838b 50%, transparent 50%);
    background-position: calc(100% - 13px) 15px, calc(100% - 9px) 15px;
    background-size: 4px 4px, 4px 4px;
    background-repeat: no-repeat;
    color: var(--shell-ink);
    font: inherit;
    line-height: 1;
    vertical-align: middle;
}

.api-message-table-panel .dataTables_filter {
    grid-area: filter;
    justify-content: flex-end;
}

.api-message-table-panel .dataTables_filter label {
    margin: 0;
    font-size: 0;
}

.api-message-table-panel .dataTables_filter input {
    width: min(280px, 40vw);
    height: 36px;
    margin: 0 0 0 8px !important;
    padding: 0 11px;
    border: 1px solid var(--shell-line);
    border-radius: 9px;
    outline: 0;
    background: #f8fbfb;
    color: var(--shell-ink);
    font: inherit;
    font-size: .76rem;
}

.api-message-table-panel .dataTables_filter input:focus {
    border-color: rgba(22, 129, 132, .5);
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(22, 129, 132, .08);
}

.api-message-table-panel .dataTables_scroll {
    grid-area: table;
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    min-height: 0;
}

.api-message-table-panel .dataTables_scrollHead {
    flex: 0 0 auto;
}

.api-message-table-panel .dataTables_scrollBody {
    flex: 1 1 auto;
    min-height: 0;
    max-height: none !important;
    overflow: auto !important;
    scrollbar-width: thin;
    scrollbar-color: rgba(22, 129, 132, .38) transparent;
}

.api-message-table-panel .dataTables_scrollBody::-webkit-scrollbar {
    width: 9px;
    height: 9px;
}

.api-message-table-panel .dataTables_scrollBody::-webkit-scrollbar-track {
    background: transparent;
}

.api-message-table-panel .dataTables_scrollBody::-webkit-scrollbar-thumb {
    border: 2px solid transparent;
    border-radius: 999px;
    background: rgba(22, 129, 132, .38);
    background-clip: padding-box;
}

.api-message-table-panel .dataTables_scrollBody::-webkit-scrollbar-thumb:hover {
    background: rgba(22, 129, 132, .68);
    background-clip: padding-box;
}

.api-message-table {
    min-width: 1220px;
}

.api-message-table thead th {
    padding: 13px 12px;
    background: #f3f8f8;
    color: #5d737a;
    font-size: .66rem;
}

.api-message-table tbody td {
    padding: 12px;
    font-size: .76rem;
}

.api-message-table thead th:nth-child(1),
.api-message-table tbody td:nth-child(1) {
    width: 64px;
    text-align: center;
}

.api-message-table thead th:nth-child(2),
.api-message-table tbody td:nth-child(2) {
    min-width: 135px;
    white-space: nowrap;
}

.api-message-table thead th:nth-child(3),
.api-message-table tbody td:nth-child(3) {
    min-width: 170px;
    font-weight: 600;
}

.api-message-table thead th:nth-child(4),
.api-message-table tbody td:nth-child(4) {
    min-width: 360px;
    max-width: 520px;
    white-space: normal;
    overflow-wrap: anywhere;
    line-height: 1.55;
}

.api-message-table thead th:nth-child(n+5):nth-child(-n+9),
.api-message-table tbody td:nth-child(n+5):nth-child(-n+9) {
    min-width: 82px;
    text-align: center;
}

.api-message-table tbody td .badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 42px;
    min-height: 28px;
    padding: 5px 9px;
    border-radius: 999px;
    font-size: .72rem !important;
    font-weight: 600;
    line-height: 1;
    box-shadow: inset 0 0 0 1px rgba(23, 37, 47, .045);
}

.api-message-table tbody td:nth-child(5) .badge {
    background: #e9eff1 !important;
    color: #354a52 !important;
}

.api-message-table tbody td:nth-child(6) .badge {
    background: #e8f4ee !important;
    color: #287653 !important;
}

.api-message-table tbody td:nth-child(7) .badge {
    background: #e7f4f6 !important;
    color: #277989 !important;
}

.api-message-table tbody td:nth-child(8) .badge {
    background: #e8eff8 !important;
    color: #386c9d !important;
}

.api-message-table tbody td:nth-child(9) .badge {
    background: #f8eaea !important;
    color: #ad4a48 !important;
}

.api-message-table tbody td:nth-child(4) a:not(.btn) {
    display: inline-flex;
    margin-top: 5px;
    color: var(--shell-accent);
    font-size: .7rem;
    font-weight: 600;
    text-decoration: none;
}

.api-message-table tbody td:nth-child(4) a:not(.btn):hover {
    text-decoration: underline;
}

.api-message-table tbody td:nth-child(4) br {
    display: none;
}

.api-message-table tbody td:nth-child(4) a[data-bs-toggle="popover"],
.api-message-table tbody td:nth-child(4) a.btn[target="_blank"] {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 32px;
    margin: 8px 7px 0 0 !important;
    padding: 5px 10px;
    border: 1px solid rgba(22, 129, 132, .26);
    border-radius: 8px;
    background: rgba(22, 129, 132, .055);
    color: var(--shell-accent) !important;
    font-size: .7rem !important;
    font-weight: 600;
    line-height: 1.2;
    text-decoration: none;
    white-space: nowrap;
    vertical-align: middle;
}

.api-message-table tbody td:nth-child(4) a[data-bs-toggle="popover"]:hover,
.api-message-table tbody td:nth-child(4) a[data-bs-toggle="popover"]:focus-visible,
.api-message-table tbody td:nth-child(4) a.btn[target="_blank"]:hover,
.api-message-table tbody td:nth-child(4) a.btn[target="_blank"]:focus-visible {
    border-color: var(--shell-accent);
    background: var(--shell-accent);
    color: #ffffff !important;
    text-decoration: none;
    outline: none;
}

.api-message-table tbody td:last-child {
    min-width: 92px;
    text-align: center;
}

.api-message-table tbody td:last-child .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    margin: 0 !important;
    padding: 0;
    border: 1px solid rgba(22, 129, 132, .22);
    border-radius: 10px;
    background: #f1f8f7;
    color: var(--shell-accent);
    transition: border-color .16s ease, background-color .16s ease, color .16s ease, transform .16s ease;
}

.api-message-table tbody td:last-child .btn:hover,
.api-message-table tbody td:last-child .btn:focus-visible {
    border-color: var(--shell-accent);
    background: var(--shell-accent);
    color: #ffffff;
    transform: translateY(-1px);
}

.api-message-table tbody td:last-child .btn svg {
    width: 18px;
    height: 18px;
}

.api-message-table-panel .dataTables_info,
.api-message-table-panel .dataTables_paginate {
    grid-row: 3;
    flex: 0 0 auto;
    min-height: 48px;
    padding: 12px 16px;
    border-top: 1px solid var(--shell-line);
    background: #ffffff;
    color: var(--shell-muted);
    font-size: .72rem;
}

.api-message-table-panel .dataTables_info {
    grid-column: 1;
}

.api-message-table-panel .dataTables_paginate {
    grid-area: paginate;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 5px;
    min-width: 0;
    max-width: 100%;
    overflow-x: auto;
    flex-wrap: nowrap;
    white-space: nowrap;
    scrollbar-width: thin;
}

.api-message-table-panel .dataTables_paginate span {
    display: inline-flex;
    align-items: center;
    flex: 0 0 auto;
    gap: 4px;
    white-space: nowrap;
}

.api-message-table-panel .dataTables_paginate .paginate_button {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    width: 38px;
    min-width: 38px;
    height: 36px;
    flex: 0 0 38px;
    margin: 0 2px !important;
    padding: 0 !important;
    border: 1px solid transparent !important;
    border-radius: 8px !important;
    background: transparent !important;
    color: #536b72 !important;
    font-size: .72rem;
}

.api-message-table-panel .dataTables_paginate .paginate_button.previous,
.api-message-table-panel .dataTables_paginate .paginate_button.next {
    width: auto;
    min-width: 68px;
    flex: 0 0 auto;
    padding: 0 10px !important;
}

.api-message-table-panel .dataTables_paginate .paginate_button.current,
.api-message-table-panel .dataTables_paginate .paginate_button:hover {
    border-color: rgba(22, 129, 132, .2) !important;
    background: rgba(22, 129, 132, .08) !important;
    color: var(--shell-accent) !important;
}

.api-message-table-panel .dataTables_paginate .paginate_button.disabled {
    opacity: .45;
    cursor: default !important;
}

@media (max-width: 767.98px) {
    .api-message-page {
        gap: 8px;
        padding: 10px;
    }

    .api-message-page-header {
        min-height: 0;
        align-items: flex-start;
        padding: 0 2px;
    }

    .api-message-table-panel>.dataTables_wrapper {
        grid-template-columns: minmax(0, 1fr) minmax(130px, 200px);
    }

    .api-message-table-panel .dataTables_length,
    .api-message-table-panel .dataTables_filter {
        min-height: 48px;
        padding: 8px;
    }

    .api-message-table-panel .dataTables_length,
    .api-message-table-panel .dataTables_length label {
        gap: 5px;
        font-size: .65rem;
    }

    .api-message-table-panel .dataTables_length select {
        width: 68px;
        height: 32px;
        min-height: 32px;
        padding-right: 22px;
        padding-left: 6px;
        background-position: calc(100% - 11px) 13px, calc(100% - 7px) 13px;
    }

    .api-message-table-panel .dataTables_filter input {
        width: 100%;
        height: 34px;
        padding: 0 8px;
        background-image: none;
    }

    .api-message-table-panel .dataTables_info,
    .api-message-table-panel .dataTables_paginate {
        padding: 10px;
    }
}

.management-table-toolbar {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--shell-line);
    background: #ffffff;
}

.management-table-toolbar .dataTables_length,
.management-table-toolbar .dataTables_filter {
    margin: 0;
    color: var(--shell-muted);
    font-size: .74rem;
}

.management-table-toolbar .dataTables_length label {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    white-space: nowrap;
}

.management-table-toolbar .dataTables_length select {
    min-height: 36px;
    padding: 0 28px 0 10px;
    border: 1px solid var(--shell-line);
    border-radius: 8px;
    background-color: #f8fbfb;
    color: var(--shell-ink);
    font: inherit;
}

.management-table-toolbar .dataTables_filter label {
    display: block;
    margin: 0;
    font-size: 0;
}

.management-table-toolbar .dataTables_filter input {
    width: min(280px, 42vw);
    height: 38px;
    margin: 0 !important;
    padding: 0 12px 0 36px;
    border: 1px solid var(--shell-line);
    border-radius: 9px;
    outline: none;
    background: #f8fbfb url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%237a8991' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='6'/%3E%3Cpath d='m16 16 4 4'/%3E%3C/svg%3E") no-repeat 12px center / 15px 15px;
    color: var(--shell-ink);
    font: inherit;
    font-size: .76rem;
    transition: border-color .16s ease, box-shadow .16s ease, background-color .16s ease;
}

.management-table-toolbar .dataTables_filter input:focus {
    border-color: rgba(22, 129, 132, .5);
    background-color: #ffffff;
    box-shadow: 0 0 0 3px rgba(22, 129, 132, .08);
}

.management-table-panel .dataTables_scroll {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    min-height: 0;
}

.management-table-panel .dataTables_scrollHead {
    flex: 0 0 auto;
}

.management-table-panel .dataTables_scrollBody {
    flex: 1 1 auto;
    min-height: 0;
    max-height: none !important;
    overflow: auto !important;
}

.management-table {
    width: 100% !important;
    min-width: 860px;
    margin: 0 !important;
    border-collapse: separate;
    border-spacing: 0;
    color: var(--shell-ink);
    font-size: .78rem;
}

.management-table thead th {
    padding: 13px 14px;
    border: 0;
    border-bottom: 1px solid var(--shell-line);
    background: #f5f9f9;
    color: #62747b;
    font-size: .67rem;
    font-weight: 700;
    text-align: left;
    text-transform: uppercase;
    white-space: nowrap;
}

.management-table tbody td {
    padding: 9px 12px;
    border: 0;
    border-bottom: 1px solid #eef2f3;
    background: #ffffff;
    color: var(--shell-ink);
    vertical-align: middle;
}

.management-table tbody tr:last-child td {
    border-bottom: 0;
}

.management-table tbody tr:hover td {
    background: #f8fbfb;
}

.management-password {
    padding: 0;
    border: 0;
    background: transparent;
    color: #63777e;
    font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
    font-size: .76rem;
    cursor: pointer;
}

.management-password:focus-visible {
    border-radius: 3px;
    outline: 2px solid rgba(22, 129, 132, .35);
    outline-offset: 2px;
}

.management-photo-link {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: var(--shell-accent);
    font-size: .73rem;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
}

.management-photo-link:hover,
.management-photo-link:focus-visible {
    color: var(--messenger-primary-dark);
    text-decoration: underline;
}

.management-photo-link svg {
    width: 17px;
    height: 17px;
}

.management-table-actions {
    display: flex;
    align-items: center;
    gap: 7px;
}

.management-table-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    padding: 0;
    border: 1px solid var(--shell-line);
    border-radius: 8px;
    background: #ffffff;
    color: #41666d;
    text-decoration: none;
    transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}

.management-table-action:hover,
.management-table-action:focus-visible {
    border-color: rgba(22, 129, 132, .35);
    background: rgba(22, 129, 132, .06);
    color: var(--shell-accent);
    outline: none;
}

.management-table-action--danger:hover,
.management-table-action--danger:focus-visible {
    border-color: rgba(190, 67, 58, .3);
    background: rgba(190, 67, 58, .06);
    color: #b94339;
}

.management-table-action svg {
    width: 17px;
    height: 17px;
}

.management-switch {
    position: relative;
    display: inline-flex;
    align-items: center;
    width: 36px;
    height: 21px;
    margin: 0;
    cursor: pointer;
}

.management-switch input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
}

.management-switch span {
    position: relative;
    width: 36px;
    height: 21px;
    border-radius: 999px;
    background: #d7e0e2;
    transition: background-color .16s ease;
}

.management-switch span::after {
    position: absolute;
    top: 3px;
    left: 3px;
    width: 15px;
    height: 15px;
    border-radius: 50%;
    background: #ffffff;
    box-shadow: 0 1px 3px rgba(23, 37, 47, .18);
    content: "";
    transition: transform .16s ease;
}

.management-switch input:checked+span {
    background: var(--shell-accent);
}

.management-switch input:checked+span::after {
    transform: translateX(15px);
}

.management-switch input:focus-visible+span {
    outline: 3px solid rgba(22, 129, 132, .18);
    outline-offset: 2px;
}

.management-table-footer {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 54px;
    padding: 10px 16px;
    border-top: 1px solid var(--shell-line);
    background: #ffffff;
}

.management-table-footer .dataTables_info {
    padding: 0;
    color: var(--shell-muted);
    font-size: .71rem;
}

.management-table-footer .dataTables_paginate {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 0;
}

.management-table-footer .paginate_button {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    min-width: 30px;
    height: 30px;
    margin: 0 !important;
    padding: 0 8px !important;
    border: 1px solid transparent !important;
    border-radius: 7px !important;
    background: transparent !important;
    color: #52666d !important;
    font-size: .72rem;
    line-height: 1;
}

.management-table-footer .paginate_button.current,
.management-table-footer .paginate_button:hover {
    border-color: rgba(22, 129, 132, .18) !important;
    background: rgba(22, 129, 132, .08) !important;
    color: var(--shell-accent) !important;
}

.management-table-footer .paginate_button.disabled {
    opacity: .4;
    cursor: default !important;
}

@media (max-width: 767.98px) {
    .management-page {
        gap: 14px;
        padding: 18px 12px 14px;
    }

    .management-page-header {
        align-items: flex-start;
        gap: 12px;
    }

    .management-page-title {
        font-size: 1.2rem;
    }

    .management-page-subtitle {
        max-width: 240px;
        font-size: .7rem;
    }

    .management-page-stat {
        min-width: 108px;
        padding: 9px 10px;
    }

    .management-table-toolbar {
        align-items: stretch;
        flex-direction: column;
        gap: 10px;
        padding: 12px;
    }

    .management-table-toolbar .dataTables_filter input {
        width: 100%;
    }

    .management-table-footer {
        align-items: flex-start;
        flex-direction: column;
        padding: 10px 12px;
    }
}

/* User sidebar zones: fixed header, scrolling cards, fixed footer. */
#tab-content-chats>.d-flex {
    min-height: 0;
    overflow: hidden;
}

.hide {
    display: none !important;
}

.user-sidebar-header {
    flex: 0 0 auto;
    padding: 16px;
    background: var(--shell-surface);
}

.user-sidebar-header-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px 14px;
}

.chat-sidebar-filters {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 14px;
}

.chat-sidebar-filter {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 32px;
    padding: 5px 11px;
    border: 1px solid var(--shell-line);
    border-radius: 999px;
    background: transparent;
    color: #53666d;
    font-size: 0.76rem;
    font-weight: 600;
    line-height: 1;
    cursor: pointer;
    transition: background-color 0.16s ease, border-color 0.16s ease, color 0.16s ease;
}

.chat-sidebar-filter:hover,
.chat-sidebar-filter:focus-visible {
    border-color: rgba(22, 124, 128, 0.35);
    background: rgba(22, 124, 128, 0.06);
    color: var(--messenger-primary);
    outline: none;
}

.chat-sidebar-filter.is-active {
    border-color: var(--messenger-primary);
    background: var(--messenger-primary);
    color: #ffffff;
}

.chat-sidebar-filter__count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 999px;
    background: rgba(17, 27, 33, 0.08);
    color: inherit;
    font-size: 0.66rem;
    font-weight: 700;
}

.chat-sidebar-filter.is-active .chat-sidebar-filter__count {
    background: rgba(255, 255, 255, 0.2);
}

.user-sidebar-header-left,
.user-sidebar-header-right {
    display: flex;
    align-items: center;
    min-width: 0;
}

.user-sidebar-header-left {
    flex: 1 1 auto;
}

.user-sidebar-header-right {
    flex: 0 0 auto;
    justify-content: flex-end;
}

.user-sidebar-header-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
}

.user-sidebar-new-chat {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 42px;
    width: 42px;
    height: 42px;
    padding: 0;
    border: 1px solid var(--shell-line);
    border-radius: 10px;
    background: #1f687e;
    color: #ffffff;
    cursor: pointer;
    transition: border-color .2s ease, background-color .2s ease, color .2s ease;
}

.user-sidebar-new-chat:hover,
.user-sidebar-new-chat:focus-visible {
    border-color: var(--shell-accent);
    background: rgba(22, 129, 132, .06);
    color: var(--shell-accent);
    outline: 0;
}

.user-sidebar-new-chat svg {
    width: 22px;
    height: 22px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.user-sidebar-header-left h2 {
    flex: 1 1 auto;
    min-width: 0;
    margin: 0 !important;
    padding: 0 !important;
    background: transparent !important;
    color: var(--shell-ink);
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -.02em;
    line-height: 1.2;
    white-space: nowrap;
}

.chatfilter-control {
    position: relative;
    flex: 0 1 auto;
    min-width: 42px;
    max-width: min(190px, 42vw);
}

.chatfilter__native {
    display: none !important;
}

.chatfilter__toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    min-width: 42px;
    height: 42px;
    padding: 0 11px;
    border: 1px solid var(--shell-line);
    border-radius: 10px;
    background: #f6fafb;
    color: #52676f;
    cursor: pointer;
    transition: border-color .16s ease, background-color .16s ease, color .16s ease;
}

.chatfilter__toggle:hover,
.chatfilter__toggle:focus-visible,
.chatfilter__toggle[aria-expanded="true"] {
    border-color: rgba(22, 124, 128, .35);
    background: #ffffff;
    color: var(--messenger-primary);
    outline: none;
}

.chatfilter__toggle.has-selection,
.chatfilter__toggle.has-selection:hover,
.chatfilter__toggle.has-selection:focus-visible,
.chatfilter__toggle.has-selection[aria-expanded="true"] {
    border-color: #1f687e;
    background: #1f687e;
    color: #ffffff;
}

.chatfilter__toggle svg {
    flex: 0 0 19px;
    width: 19px;
    height: 19px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.chatfilter__current {
    overflow: hidden;
    color: inherit;
    font-size: .8rem;
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.chatfilter__current:empty {
    display: none;
}

.chatfilter__menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    z-index: 1200;
    display: flex;
    flex-direction: column;
    width: max-content;
    min-width: 190px;
    max-width: min(280px, 80vw);
    padding: 7px 0;
    border: 1px solid rgba(17, 27, 33, .08);
    border-radius: 12px;
    background: rgba(255, 255, 255, .98);
    box-shadow: 0 8px 24px rgba(17, 27, 33, .16);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(-5px);
    transition: opacity .16s ease, visibility .16s ease, transform .16s ease;
}

.chatfilter__menu.is-open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0);
}

.chatfilter__option {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    min-height: 40px;
    padding: 8px 13px;
    border: 0;
    background: transparent;
    color: #1d2f36;
    font: inherit;
    font-size: .88rem;
    font-weight: 500;
    text-align: left;
    cursor: pointer;
}

.chatfilter__option:hover,
.chatfilter__option:focus-visible,
.chatfilter__option.is-selected {
    background: #f4f7f8;
    outline: none;
}

.chatfilter__option-label {
    flex: 1 1 auto;
    min-width: 0;
    overflow-wrap: anywhere;
}

.chatfilter__option-check {
    width: 16px;
    color: var(--messenger-primary);
    font-size: .9rem;
    font-weight: 700;
    opacity: 0;
}

.chatfilter__option.is-selected .chatfilter__option-check {
    opacity: 1;
}

.user-sidebar-search-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    padding: 0;
    border: 1px solid var(--shell-line);
    border-radius: 10px;
    background: #f6fafb;
    color: var(--shell-ink);
    cursor: pointer;
    transition: all .2s ease;
}

.user-sidebar-search-toggle:hover,
.user-sidebar-search-toggle:focus-visible {
    border-color: var(--shell-accent);
    background: rgba(22, 129, 132, .06);
    outline: 0;
}

.user-sidebar-search-toggle svg {
    width: 25px;
    height: 25px;
    stroke: rgb(90 110 118);
    stroke-width: 2;
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.user-sidebar-header-bottom {
    width: 100%;
    margin-top: 12px;
}

#user-sidebar-search-slot {
    width: 100%;
    margin: 0;
}

#user-sidebar-search-slot .dataTables_filter {
    display: flex;
    width: 100%;
    max-height: 0;
    margin: 0;
    opacity: 0;
    overflow: hidden;
    pointer-events: none;
    transform: translateY(-6px);
    transition: max-height .25s ease, opacity .2s ease, transform .25s ease;
}

#user-sidebar-search-slot.is-open .dataTables_filter {
    max-height: 52px;
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
    margin-top: 8px;
}

#user-sidebar-search-slot .dataTables_filter label {
    width: 100%;
    margin: 0;
    font-size: 0;
}

#user-sidebar-search-slot .dataTables_filter input {
    width: 100%;
    height: 38px;
    margin: 0 !important;
    padding: 8px 12px 8px 38px;
    border: 1px solid var(--shell-line);
    border-radius: 10px;
    outline: 0;
    background: #f7fafb url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23576b73' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='5.5'/%3E%3Cpath d='M16 16L21 21'/%3E%3C/svg%3E") no-repeat 12px center / 16px 16px;
    color: var(--shell-ink);
    font-family: inherit;
    font-size: .72rem;
}

#user-sidebar-search-slot .dataTables_filter input:focus {
    border-color: var(--shell-accent);
}

.user-sidebar-main {
    flex: 1 1 auto;
    min-height: 0;
    height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    overscroll-behavior: contain;
}

.user-sidebar-main::-webkit-scrollbar {
    width: 0;
    height: 0;
    display: none;
}

.user-sidebar-main::-webkit-scrollbar-thumb,
.user-sidebar-main::-webkit-scrollbar-track {
    background: transparent;
}

.user-sidebar-main>.hide-scrollbar {
    flex: 1 1 auto;
    min-height: 0;
    height: 100% !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    scrollbar-width: thin;
    -ms-overflow-style: none;
    scrollbar-color: rgba(22, 129, 132, .38) transparent;
}

.user-sidebar-main>.hide-scrollbar::-webkit-scrollbar {
    width: 6px;
    height: 0;
}

.user-sidebar-main>.hide-scrollbar::-webkit-scrollbar-thumb {
    border-radius: 999px;
    background: rgba(22, 129, 132, .38);
}

.user-sidebar-main>.hide-scrollbar::-webkit-scrollbar-thumb:hover {
    background: rgba(22, 129, 132, .68);
}

.user-sidebar-main .container {
    display: flex;
    flex-direction: column;
    max-width: none;
    height: 100%;
    min-height: 100%;
    padding: 10px 10px 18px !important;
    box-sizing: border-box;
}

.user-sidebar-main .card-list {
    display: flex;
    flex: 1 0 auto;
    flex-direction: column;
    min-height: 100%;
    height: auto !important;
    margin: 0 !important;
}

.user-sidebar-main .dataTables_wrapper {
    position: relative;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    min-height: 100%;
}

.user-sidebar-main .dataTables_wrapper .dataTables_scroll,
.user-sidebar-main .dataTables_wrapper .dataTables_scrollHead,
.user-sidebar-main .dataTables_wrapper .dataTables_scrollHeadInner,
.user-sidebar-main .dataTables_wrapper table,
.user-sidebar-main .dataTables_info {
    width: 100% !important;
    max-width: 100% !important;
}

.user-sidebar-main .dataTables_filter {
    display: none;
}

.user-sidebar-main .dataTables_filter label {
    width: 100%;
    margin: 0;
    font-size: 0;
}

.user-sidebar-main .dataTables_filter input {
    width: 100%;
    height: 38px;
    margin: 0 !important;
    padding: 8px 12px 8px 38px;
    border: 1px solid var(--shell-line);
    border-radius: 999px;
    outline: 0;
    background: #f7fafb;
    color: var(--shell-ink);
    font-family: inherit;
    font-size: .72rem;
}

.user-sidebar-main .dataTables_filter input:focus {
    border-color: var(--shell-accent);
    box-shadow: 0 0 0 3px rgba(22, 129, 132, .1);
}

.user-sidebar-main .dataTables_paginate {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
    margin-top: 10px;
    padding-top: 6px;
}

.user-sidebar-main .dataTables_info {
    display: flex;
    align-items: center;
    margin-top: 12px;
    color: var(--shell-ink);
    font-size: .75rem;
    line-height: 1.4;
}

.user-sidebar-main .dataTables_wrapper .dataTables_paginate .paginate_button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    height: 28px;
    padding: 0 8px;
    border: 1px solid var(--shell-line);
    border-radius: 8px;
    background: transparent;
    color: var(--shell-ink);
    font-size: .72rem;
    line-height: 1;
}

.user-sidebar-main .dataTables_wrapper .dataTables_paginate .paginate_button.current,
.user-sidebar-main .dataTables_wrapper .dataTables_paginate .paginate_button:hover,
.user-sidebar-main .dataTables_wrapper .dataTables_paginate .paginate_button:focus {
    border-color: var(--messenger-primary);
    background: rgba(22, 124, 128, .08);
    color: var(--messenger-primary);
    box-shadow: none;
}

.user-sidebar-main .dataTables_wrapper .dataTables_paginate .paginate_button.disabled {
    opacity: .45;
    pointer-events: none;
}

.user-sidebar-main .dataTables_wrapper {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.user-sidebar-main .dataTables_wrapper .dataTables_paginate,
.user-sidebar-main .dataTables_wrapper .dataTables_info {
    width: 100%;
}

.chat-table-footer {
    position: sticky;
    bottom: 0;
    z-index: 5;
    display: flex;
    flex: 0 0 auto;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    margin-top: auto;
    min-height: 46px;
    padding-top: 10px;
    padding-bottom: 10px;
    background: rgb(255 255 255);
    border-top: 1px solid var(--shell-line);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(6px);
}

.chat-table-footer .dataTables_info,
.chat-table-footer .dataTables_paginate {
    margin: 0 !important;
}

.chat-table-footer .dataTables_info {
    flex: 1 1 auto;
    min-width: 0;
    color: #848688;
    font-size: .72rem;
    line-height: 1.4;
}

.chat-table-footer .dataTables_paginate {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: nowrap;
    gap: 6px;
    width: 100%;
    white-space: nowrap;
}

.chat-table-footer .dataTables_paginate .paginate_button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 26px;
    height: 23px;
    font-weight: 600;
    padding: 0 7px;
    /* border: 1px solid #c2c3c3; */
    border-radius: 8px;
    background: transparent;
    color: var(--shell-ink);
    font-size: .68rem;
    text-decoration: none;
    line-height: 2;
    cursor: pointer;
    margin-right: 6px;
}

.chat-table-footer .dataTables_paginate .paginate_button.current,
.chat-table-footer .dataTables_paginate .paginate_button:hover,
.chat-table-footer .dataTables_paginate .paginate_button:focus {
    border-color: var(--messenger-primary);
    background: rgba(22, 124, 128, .08);
    color: var(--messenger-primary);
    box-shadow: none;
    border: 2px solid #167c80;
}

.chat-table-footer .dataTables_paginate .paginate_button.disabled {
    opacity: .45;
    pointer-events: none;
}

/* Keep the chat pager compact: show the first five page buttons and Next only. */
.chat-table-footer .dataTables_paginate .paginate_button.ellipsis,
.chat-table-footer .dataTables_paginate .paginate_button.last {
    display: none !important;
}

.sidebar-user-card {
    width: 100%;
}

.sidebar-user-card .card-body {
    display: flex;
    align-items: center;
    width: 100%;
}

.sidebar-user-avatar-wrap {
    width: 52px;
    min-width: 52px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.sidebar-user-avatar-wrap .avatar {
    margin: 0 auto;
}

.sidebar-user-content {
    min-width: 0;
    width: 100%;
}

.sidebar-user-top-row,
.sidebar-user-bottom-row {
    width: 100%;
    gap: 8px;
}

.sidebar-user-name {
    font-size: 1rem;
    line-height: 1.3;
    font-weight: 600;
    color: #1f2937;
    flex: 1 1 auto;
    min-width: 0;
    margin-right: 0;
}

.sidebar-user-meta,
.sidebar-user-admin-meta {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
    margin-left: 0;
    flex-shrink: 0;
}

.sidebar-user-meta {
    min-width: 90px;
}

.sidebar-user-admin-meta {
    margin-left: 0;
}

.sidebar-user-bottom-row .line-clamp {
    flex: 1 1 auto;
    min-width: 0;
    margin-right: 0;
}

.sidebar-chat-status {
    margin: 4px 0 0;
    font-size: 10px;
    line-height: 1.2;
    text-align: center;
    letter-spacing: .02em;
}

.sidebar-chat-status--online {
    color: #2a9d3f;
}

.sidebar-chat-status--offline {
    color: #d93a3a;
}

.user-sidebar-footer {
    flex: 0 0 34px;
    border-top: 1px solid var(--shell-line);
    background: var(--shell-surface);
}

@media (max-width: 767.98px) {
    .user-sidebar-header {
        padding: 12px 14px 10px;
    }

    .user-sidebar-header-top {
        align-items: flex-start;
        gap: 8px;
    }

    .user-sidebar-header-left h2 {
        font-size: 1.05rem;
    }

    .user-sidebar-footer {
        flex-basis: 24px;
    }
}




.add-template-modal-header {
    padding: 20px 24px 16px !important;
    background: #ffffff;
    border-bottom: 1px solid #edf0f2 !important;
}

.add-template-modal-header-inner {
    width: 100%;

    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 15px;
}

.add-template-modal-title-wrap {
    min-width: 0;
}

.add-template-modal-title {
    margin: 0;

    color: #1f2937;

    font-size: 18px;
    font-weight: 650;

    letter-spacing: -0.2px;
}

.add-template-modal-subtitle {
    margin-top: 4px;

    color: #9ca3af;

    font-size: 11px;
    line-height: 1.5;
}

.add-template-modal-icon {
    display: inline-flex;

    align-items: center;
    justify-content: center;

    width: 38px;
    height: 38px;

    flex-shrink: 0;

    background: #f5f7fa;

    border: 1px solid #e5e9ef;

    border-radius: 9px;

    color: #64748b;
}

.add-template-modal-icon svg {
    width: 19px;
    height: 19px;
}




.add-template-modal-body {
    padding: 20px 24px 24px !important;

    background: #ffffff;
}


.template-form-section {
    margin-bottom: 22px;
}

.template-form-section:last-child {
    margin-bottom: 0;
}

.template-form-section-title {
    display: flex;

    align-items: center;

    gap: 7px;

    margin-bottom: 5px;

    color: #374151;

    font-size: 11px;
    font-weight: 650;

    letter-spacing: 0.1px;
}

.template-form-section-title svg {
    width: 14px;
    height: 14px;

    flex-shrink: 0;

    color: #8791a1;
}

.template-form-section-description {
    margin-bottom: 13px;

    color: #9ca3af;

    font-size: 10px;

    line-height: 1.5;
}


.template-field-label {
    display: block;

    margin-bottom: 6px;

    color: #4b5563;

    font-size: 10.5px;
    font-weight: 600;

    line-height: 1.3;
}

.template-field-label .text-danger {
    margin-left: 2px;

    font-size: 10px;
}

.template-field-help {
    display: block;

    margin-top: 5px;

    color: #9ca3af;

    font-size: 9.5px;

    line-height: 1.45;
}



.template-form-control {
    width: 100%;

    min-height: 42px;

    padding: 9px 11px !important;

    border: 1px solid #dfe3e8 !important;

    border-radius: 7px !important;

    background-color: #ffffff !important;

    color: #374151 !important;

    font-size: 11.5px !important;

    box-shadow: none !important;

    transition:
        border-color .18s ease,
        box-shadow .18s ease,
        background-color .18s ease;
}

.template-form-control:hover {
    border-color: #cfd5dc !important;
}

.template-form-control:focus {
    border-color: #aeb6c2 !important;

    background-color: #ffffff !important;

    box-shadow:
        0 0 0 3px rgba(100, 116, 139, .07) !important;
}

.template-form-control::placeholder {
    color: #b0b6bf;
}

select.template-form-control {
    cursor: pointer;
}



#header_text_box {
    margin-top: -4px;
}



.template-media-box {
    padding: 13px;

    background: #fafbfc;

    border: 1px dashed #d9dee5;

    border-radius: 8px;
}

.template-media-box .template-field-label {
    margin-bottom: 7px;
}




.template-message-box {
    overflow: hidden;

    background: #ffffff;

    border: 1px solid #dfe3e8;

    border-radius: 8px;

    transition:
        border-color .18s ease,
        box-shadow .18s ease;
}

.template-message-box:focus-within {
    border-color: #aeb6c2;

    box-shadow:
        0 0 0 3px rgba(100, 116, 139, .07);
}

.template-message-box>.template-field-label {
    padding: 11px 12px 0;

    margin-bottom: 0;
}

.template-message-textarea {
    display: block;

    width: 100%;

    min-height: 145px;

    padding: 9px 12px 12px !important;

    border: 0 !important;

    border-radius: 0 !important;

    outline: none !important;

    resize: vertical;

    color: #374151 !important;

    font-size: 11.5px !important;

    line-height: 1.65;

    box-shadow: none !important;
}

.template-message-textarea::placeholder {
    color: #b0b6bf;
}




.template-message-toolbar {
    display: flex;

    align-items: center;

    flex-wrap: wrap;

    gap: 6px;

    padding: 8px 10px;

    background: #fafbfc;

    border-top: 1px solid #edf0f2;
}

.template-toolbar-label {
    color: #9ca3af;

    font-size: 9.5px;

    margin-right: 2px;
}

.template-variable-btn {
    display: inline-flex;

    align-items: center;
    justify-content: center;

    min-height: 27px;

    padding: 4px 9px;

    background: #ffffff;

    border: 1px solid #dfe3e8;

    border-radius: 5px;

    color: #596273;

    font-size: 9.5px;
    font-weight: 600;

    line-height: 1;

    cursor: pointer;

    transition:
        background .18s ease,
        border-color .18s ease,
        transform .18s ease;
}

.template-variable-btn:hover {
    background: #f5f7f9;

    border-color: #cfd5dc;

    transform: translateY(-1px);
}

.template-variable-btn:active {
    transform: translateY(0);
}


.template-message-help {
    display: flex;
    flex-direction: column;
    gap: 5px;

    margin-top: 8px;

    color: #8b95a1;

    font-size: 9.5px;
    line-height: 1.5;
}

.template-help-item {
    display: flex;
    align-items: flex-start;
    gap: 7px;
}

.template-help-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    width: 14px;
    height: 14px;

    flex-shrink: 0;

    margin-top: 1px;

    background: #f1f5f9;

    border: 1px solid #e2e8f0;

    border-radius: 50%;

    color: #64748b;

    font-size: 8px;
    font-weight: 700;
}

.template-help-item strong {
    color: #687383;
    font-weight: 600;
}

.template-message-help {
    margin-top: 6px;

    color: #9ca3af;

    font-size: 9.5px;

    line-height: 1.45;
}

.template-message-example {
    margin-top: 5px;

    padding: 7px 9px;

    background: #fafbfc;

    border-left: 2px solid #d8dde4;

    color: #7b8491;

    font-size: 9.5px;

    line-height: 1.5;
}

.template-message-example strong {
    color: #596273;
}




#components {
    margin-top: -3px;
}

.template-component {
    margin-bottom: 12px;

    padding: 12px;

    background: #fafbfc;

    border: 1px solid #e8ebef;

    border-radius: 8px;
}

.template-component:last-child {
    margin-bottom: 0;
}

.template-component-header {
    display: flex;

    align-items: center;
    justify-content: space-between;

    gap: 8px;

    margin-bottom: 10px;
}

.template-component-title {
    display: flex;

    align-items: center;

    gap: 6px;

    color: #596273;

    font-size: 10px;
    font-weight: 650;
}

.template-component-title svg {
    width: 13px;
    height: 13px;

    color: #8b95a5;
}

.template-component-variable {
    display: inline-flex;

    align-items: center;
    justify-content: center;

    min-height: 22px;

    padding: 3px 7px;

    background: #ffffff;

    border: 1px solid #e1e5ea;

    border-radius: 5px;

    color: #6b7280;

    font-size: 9px;
    font-weight: 600;

    white-space: nowrap;
}

.template-component .template-form-control {
    min-height: 40px;
}


.template-submit-area {
    display: flex;

    align-items: center;

    justify-content: flex-end;

    padding-top: 16px;

    margin-top: 5px;

    border-top: 1px solid #edf0f2;
}

.template-submit-btn {
    display: inline-flex;

    align-items: center;
    justify-content: center;

    gap: 7px;

    min-width: 125px;

    min-height: 38px;

    padding: 7px 15px;

    border-radius: 7px;

    font-size: 11px;
    font-weight: 600;

    box-shadow: none;

    transition:
        transform .18s ease,
        box-shadow .18s ease;
}

.template-submit-btn:hover {
    transform: translateY(-1px);

    box-shadow:
        0 4px 10px rgba(15, 23, 42, .10);
}

.template-submit-btn:active {
    transform: translateY(0);
}

.template-submit-btn svg {
    width: 14px;
    height: 14px;
}




@media (max-width: 767px) {

    .add-template-modal-header {
        padding: 17px !important;
    }

    .add-template-modal-body {
        padding: 17px !important;
    }

    .add-template-modal-title {
        font-size: 16px;
    }

    .add-template-modal-subtitle {
        font-size: 10px;
    }

    .template-form-section {
        margin-bottom: 18px;
    }

    .template-component-header {
        align-items: flex-start;

        flex-direction: column;
    }

    .template-submit-area {
        justify-content: stretch;
    }

    .template-submit-btn {
        width: 100%;
    }

}


@media (max-width: 480px) {

    .add-template-modal-icon {
        width: 34px;
        height: 34px;
    }

    .add-template-modal-icon svg {
        width: 17px;
        height: 17px;
    }

    .template-message-textarea {
        min-height: 125px;
    }

}

#myModal .modal-content:has(.add-template-modal-header) {
    --template-ink: #17252f;
    --template-muted: #71838b;
    --template-line: #e2ebed;
    --template-accent: #168184;
    --template-accent-soft: #e7f4f2;
    border: 1px solid var(--template-line);
    border-radius: 22px;
    background: #f5f9f9;
    box-shadow: 0 22px 60px rgba(19, 46, 55, .2);
}

#myModal .modal-dialog:has(.add-template-modal-header) {
    width: min(920px, calc(100vw - 32px));
    max-width: 920px;
}

#myModal .modal-content:has(.add-template-modal-header) .add-template-modal-header {
    padding: 22px 28px !important;
    border-bottom: 1px solid var(--template-line) !important;
    background: linear-gradient(120deg, #ffffff, #f1f8f7);
}

#myModal .modal-content:has(.add-template-modal-header) .add-template-modal-header-inner {
    gap: 18px;
}

#myModal .modal-content:has(.add-template-modal-header) .add-template-modal-title-wrap {
    flex: 1 1 auto;
}

#myModal .modal-content:has(.add-template-modal-header) .add-template-modal-title {
    color: var(--template-ink);
    font-size: 1.45rem;
    font-weight: 600;
    line-height: 1.25;
}

#myModal .modal-content:has(.add-template-modal-header) .add-template-modal-subtitle {
    margin-top: 5px;
    color: var(--template-muted);
    font-size: .78rem;
    line-height: 1.45;
}

#myModal .modal-content:has(.add-template-modal-header) .add-template-modal-icon {
    width: 48px;
    height: 48px;
    border: 0;
    border-radius: 15px;
    background: var(--template-accent-soft);
    color: var(--template-accent);
}

#myModal .modal-content:has(.add-template-modal-header) .add-template-modal-icon svg {
    width: 23px;
    height: 23px;
}

#myModal .modal-content:has(.add-template-modal-header)>form.ajaxForm {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    min-height: 0;
}

#myModal .modal-content:has(.add-template-modal-header) .add-template-modal-body {
    flex: 1 1 auto;
    min-height: 0;
    max-height: calc(100dvh - 112px);
    overflow: auto;
    padding: 24px 28px 28px !important;
    background: linear-gradient(180deg, #f4f8f8, #f8fbfb);
    scrollbar-width: thin;
    scrollbar-color: rgba(22, 129, 132, .38) transparent;
}

#myModal .modal-content:has(.add-template-modal-header) .add-template-modal-body::-webkit-scrollbar {
    width: 9px;
}

#myModal .modal-content:has(.add-template-modal-header) .add-template-modal-body::-webkit-scrollbar-track {
    background: transparent;
}

#myModal .modal-content:has(.add-template-modal-header) .add-template-modal-body::-webkit-scrollbar-thumb {
    border: 2px solid transparent;
    border-radius: 999px;
    background: rgba(22, 129, 132, .38);
    background-clip: padding-box;
}

#myModal .modal-content:has(.add-template-modal-header) .template-form-section {
    margin: 0 0 16px;
    padding: 19px 20px;
    border: 1px solid var(--template-line);
    border-radius: 14px;
    background: #ffffff;
    box-shadow: 0 3px 12px rgba(26, 64, 73, .035);
}

#myModal .modal-content:has(.add-template-modal-header) .template-form-section:last-child {
    margin-bottom: 0;
}

#myModal .modal-content:has(.add-template-modal-header) .template-form-section-title {
    align-items: center;
    gap: 9px;
    margin: 0 0 6px;
    color: var(--template-ink);
    font-size: .9rem;
    font-weight: 600;
}

#myModal .modal-content:has(.add-template-modal-header) .template-form-section-title svg {
    box-sizing: content-box;
    width: 17px;
    height: 17px;
    padding: 7px;
    border-radius: 10px;
    background: var(--template-accent-soft);
    color: var(--template-accent);
}

#myModal .modal-content:has(.add-template-modal-header) .template-form-section-description {
    margin: 0 0 16px 40px;
    color: var(--template-muted);
    font-size: .76rem;
    line-height: 1.5;
}

#myModal .modal-content:has(.add-template-modal-header) .template-field-label {
    margin-bottom: 7px;
    color: #40555d;
    font-size: .78rem;
    font-weight: 600;
    line-height: 1.4;
}

#myModal .modal-content:has(.add-template-modal-header) .template-field-label .text-danger {
    color: #c74b42 !important;
}

#myModal .modal-content:has(.add-template-modal-header) .template-field-help {
    margin-top: 6px;
    color: var(--template-muted);
    font-size: .7rem;
    line-height: 1.5;
}

#myModal .modal-content:has(.add-template-modal-header) .template-form-control {
    min-height: 46px;
    padding: 10px 13px !important;
    border: 1px solid var(--template-line) !important;
    border-radius: 10px !important;
    background: #fbfdfd !important;
    color: var(--template-ink) !important;
    font-family: inherit;
    font-size: .84rem !important;
    box-shadow: none !important;
    transition: border-color .16s ease, box-shadow .16s ease, background-color .16s ease;
}

#myModal .modal-content:has(.add-template-modal-header) .template-form-control:hover {
    border-color: #c8dadd !important;
}

#myModal .modal-content:has(.add-template-modal-header) .template-form-control:focus {
    border-color: rgba(22, 129, 132, .55) !important;
    background: #ffffff !important;
    box-shadow: 0 0 0 3px rgba(22, 129, 132, .1) !important;
}

#myModal .modal-content:has(.add-template-modal-header) .template-form-control::placeholder,
#myModal .modal-content:has(.add-template-modal-header) .template-message-textarea::placeholder {
    color: #91a0a5;
}

#myModal .modal-content:has(.add-template-modal-header) #header_text_box {
    margin-top: 12px;
}

#myModal .modal-content:has(.add-template-modal-header) .template-media-box {
    padding: 16px;
    border: 1px dashed #b7cfd1;
    border-radius: 12px;
    background: #f4f9f9;
}

#myModal .modal-content:has(.add-template-modal-header) .template-media-box .template-field-label {
    margin-bottom: 9px;
}

#myModal .modal-content:has(.add-template-modal-header) .template-message-box {
    border: 1px solid var(--template-line);
    border-radius: 12px;
    background: #ffffff;
    transition: border-color .16s ease, box-shadow .16s ease;
}

#myModal .modal-content:has(.add-template-modal-header) .template-message-box:focus-within {
    border-color: rgba(22, 129, 132, .5);
    box-shadow: 0 0 0 3px rgba(22, 129, 132, .08);
}

#myModal .modal-content:has(.add-template-modal-header) .template-message-box>.template-field-label {
    padding: 13px 15px 0;
}

#myModal .modal-content:has(.add-template-modal-header) .template-message-textarea {
    min-height: 170px;
    padding: 12px 15px 15px !important;
    color: var(--template-ink) !important;
    font-family: inherit;
    font-size: .84rem !important;
    line-height: 1.6;
}

#myModal .modal-content:has(.add-template-modal-header) .template-message-toolbar {
    gap: 8px;
    padding: 10px 13px;
    border-top: 1px solid var(--template-line);
    background: #f7fafa;
}

#myModal .modal-content:has(.add-template-modal-header) .template-toolbar-label {
    color: var(--template-muted);
    font-size: .72rem;
}

#myModal .modal-content:has(.add-template-modal-header) .template-variable-btn {
    min-height: 32px;
    padding: 6px 11px;
    border: 1px solid var(--template-line);
    border-radius: 8px;
    background: #ffffff;
    color: var(--template-accent);
    font-size: .72rem;
}

#myModal .modal-content:has(.add-template-modal-header) .template-variable-btn:hover {
    border-color: rgba(22, 129, 132, .38);
    background: var(--template-accent-soft);
}

#myModal .modal-content:has(.add-template-modal-header) .template-message-help {
    gap: 7px;
    margin-top: 12px;
    color: var(--template-muted);
    font-size: .72rem;
    line-height: 1.5;
}

#myModal .modal-content:has(.add-template-modal-header) .template-help-icon {
    width: 17px;
    height: 17px;
    margin-top: 0;
    border: 0;
    background: var(--template-accent-soft);
    color: var(--template-accent);
    font-size: .65rem;
}

#myModal .modal-content:has(.add-template-modal-header) .template-help-item strong,
#myModal .modal-content:has(.add-template-modal-header) .template-message-example strong {
    color: var(--template-ink);
}

#myModal .modal-content:has(.add-template-modal-header) .template-message-example {
    margin-top: 10px;
    padding: 10px 12px;
    border-left: 3px solid var(--template-accent);
    border-radius: 0 8px 8px 0;
    background: #f4f9f9;
    color: #596d73;
    font-size: .73rem;
    line-height: 1.55;
}

#myModal .modal-content:has(.add-template-modal-header) #components:empty {
    display: none;
}

#myModal .modal-content:has(.add-template-modal-header) .template-component {
    margin: 0 0 12px;
    padding: 16px;
    border: 1px solid var(--template-line);
    border-radius: 12px;
    background: #f8fbfb;
}

#myModal .modal-content:has(.add-template-modal-header) .template-component:last-child {
    margin-bottom: 0;
}

#myModal .modal-content:has(.add-template-modal-header) .template-component-header {
    gap: 10px;
    margin-bottom: 12px;
}

#myModal .modal-content:has(.add-template-modal-header) .template-component-title {
    gap: 8px;
    color: var(--template-ink);
    font-size: .78rem;
    font-weight: 600;
}

#myModal .modal-content:has(.add-template-modal-header) .template-component-title svg {
    color: var(--template-accent);
}

#myModal .modal-content:has(.add-template-modal-header) .template-component-variable {
    min-height: 26px;
    padding: 4px 9px;
    border-color: var(--template-line);
    border-radius: 7px;
    color: var(--template-accent);
}

#myModal .modal-content:has(.add-template-modal-header) .template-submit-area {
    position: sticky;
    bottom: -28px;
    z-index: 2;
    justify-content: flex-end;
    margin: 16px -28px -28px;
    padding: 15px 28px 20px;
    border-top: 1px solid var(--template-line);
    background: rgba(255, 255, 255, .97);
    backdrop-filter: blur(10px);
}

#myModal .modal-content:has(.add-template-modal-header) .template-submit-btn {
    min-width: 160px;
    min-height: 46px;
    gap: 9px;
    padding: 9px 18px;
    border: 1px solid var(--template-accent);
    border-radius: 11px;
    background: var(--template-accent);
    color: #ffffff;
    font-family: inherit;
    font-size: .84rem;
    font-weight: 600;
}

#myModal .modal-content:has(.add-template-modal-header) .template-submit-btn:hover {
    border-color: #116d70;
    background: #116d70;
    box-shadow: 0 9px 20px rgba(22, 129, 132, .2);
}

@media (max-width: 767.98px) {
    #myModal .modal-dialog:has(.add-template-modal-header) {
        width: calc(100vw - 20px);
        max-width: none;
        margin: 10px auto;
    }

    #myModal .modal-content:has(.add-template-modal-header) {
        max-height: calc(100dvh - 20px);
        border-radius: 18px;
    }

    #myModal .modal-content:has(.add-template-modal-header) .add-template-modal-header {
        padding: 17px 18px !important;
    }

    #myModal .modal-content:has(.add-template-modal-header) .add-template-modal-body {
        padding: 16px !important;
    }

    #myModal .modal-content:has(.add-template-modal-header) .template-form-section {
        padding: 15px;
    }

    #myModal .modal-content:has(.add-template-modal-header) .template-form-section-description {
        margin-left: 0;
    }

    #myModal .modal-content:has(.add-template-modal-header) .template-submit-area {
        bottom: -16px;
        margin-right: -16px;
        margin-left: -16px;
        padding: 12px 16px 16px;
    }

    #myModal .modal-content:has(.add-template-modal-header) .template-submit-btn {
        width: 100%;
    }
}

@media (max-width: 480px) {
    #myModal .modal-content:has(.add-template-modal-header) .add-template-modal-title {
        font-size: 1.2rem;
    }

    #myModal .modal-content:has(.add-template-modal-header) .add-template-modal-icon {
        width: 40px;
        height: 40px;
    }

    #myModal .modal-content:has(.add-template-modal-header) .template-form-section {
        padding: 13px;
    }

    #myModal .modal-content:has(.add-template-modal-header) .template-component-header {
        align-items: flex-start;
        flex-direction: column;
    }

    #myModal .modal-content:has(.add-template-modal-header) .template-message-textarea {
        min-height: 145px;
    }
}



/* =========================================================
       TEMPLATE PAGE
    ========================================================= */

.template-page {
    gap: 8px;
    padding: 8px 12px 10px;
}

.template-page-header {
    flex: 0 0 auto;
}

.template-header {
    margin-bottom: 0;
}


/* =========================================================
       CHAT TRANSFER MODAL
    ========================================================= */

#myModal .modal-dialog:has(.chat-transfer-modal) {
    width: min(460px, calc(100vw - 32px));
    max-width: 460px;
    margin: 1.75rem auto;
}

#myModal .modal-content:has(.chat-transfer-modal) {
    overflow: hidden;
    border: 1px solid #dce8e5;
    border-radius: 16px;
    background: #ffffff;
    box-shadow: 0 24px 64px rgba(25, 54, 48, .2);
}

.chat-transfer-modal {
    --transfer-ink: #20332f;
    --transfer-muted: #71817d;
    --transfer-line: #e4ece9;
    --transfer-accent: #16816f;
    --transfer-accent-dark: #106d5e;
}

.chat-transfer-modal__header {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 22px 24px 20px;
    border-bottom: 1px solid var(--transfer-line);
    background: linear-gradient(135deg, #f5faf8, #ffffff 78%);
}

.chat-transfer-modal__icon {
    display: inline-flex;
    flex: 0 0 46px;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 46px;
    border: 1px solid #d6eae4;
    border-radius: 13px;
    background: #eaf5f1;
    color: var(--transfer-accent);
}

.chat-transfer-modal__icon svg {
    width: 22px;
    height: 22px;
}

.chat-transfer-modal__heading {
    flex: 1 1 auto;
    min-width: 0;
}

.chat-transfer-modal__eyebrow {
    display: block;
    margin-bottom: 3px;
    color: var(--transfer-accent);
    font-size: .66rem;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.chat-transfer-modal__heading h5 {
    margin: 0;
    color: var(--transfer-ink);
    font-size: 1.18rem;
    font-weight: 650;
    line-height: 1.3;
}

.chat-transfer-modal__heading p {
    margin: 3px 0 0;
    color: var(--transfer-muted);
    font-size: .77rem;
    line-height: 1.4;
}

.chat-transfer-modal__close {
    display: inline-flex;
    flex: 0 0 34px;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    padding: 0;
    border: 1px solid transparent;
    border-radius: 9px;
    background: transparent;
    color: #70817d;
    cursor: pointer;
}

.chat-transfer-modal__close:hover,
.chat-transfer-modal__close:focus-visible {
    border-color: var(--transfer-line);
    background: #ffffff;
    color: var(--transfer-ink);
}

.chat-transfer-modal__close svg {
    width: 17px;
    height: 17px;
}

.chat-transfer-modal__form {
    display: flex;
    flex-direction: column;
    margin: 0;
}

.chat-transfer-modal__body {
    padding: 22px 24px 24px;
}

.chat-transfer-modal__assignment {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 22px;
    padding: 13px 14px;
    border: 1px solid var(--transfer-line);
    border-radius: 11px;
    background: #f8fbfa;
}

.chat-transfer-modal__assignment-label {
    align-self: flex-start;
    margin-right: auto;
    color: var(--transfer-muted);
    font-size: .7rem;
    font-weight: 600;
}

.chat-transfer-modal__owner {
    display: flex;
    flex: 0 1 auto;
    align-items: center;
    gap: 9px;
    min-width: 0;
}

.chat-transfer-modal__avatar {
    display: inline-flex;
    flex: 0 0 32px;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #dceee8;
    color: #286d5d;
    font-size: .75rem;
    font-weight: 700;
}

.chat-transfer-modal__owner-name {
    overflow: hidden;
    color: var(--transfer-ink);
    font-size: .82rem;
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.chat-transfer-modal__arrow {
    display: inline-flex;
    flex: 0 0 30px;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: #eaf2ef;
    color: #70817d;
}

.chat-transfer-modal__arrow svg {
    width: 16px;
    height: 16px;
}

.chat-transfer-modal__label {
    display: block;
    margin: 0 0 8px;
    color: var(--transfer-ink);
    font-size: .78rem;
    font-weight: 650;
}

.chat-transfer-select {
    position: relative;
    width: 100%;
}

.chat-transfer-select__control {
    display: block;
    width: 100% !important;
    min-height: 46px;
    padding: 10px 42px 10px 13px;
    border: 1px solid #d6e2de;
    border-radius: 9px;
    background: #fbfdfd;
    color: var(--transfer-ink);
    font: inherit;
    font-size: .82rem;
    line-height: 1.4;
    appearance: none;
    box-shadow: none;
    cursor: pointer;
    transition: border-color .16s ease, background-color .16s ease, box-shadow .16s ease;
}

.chat-transfer-select__control:hover {
    border-color: #b9d2ca;
    background-color: #ffffff;
}

.chat-transfer-select__control:focus-visible {
    border-color: var(--transfer-accent);
    outline: none;
    box-shadow: 0 0 0 3px rgba(22, 129, 111, .12);
}

.chat-transfer-select__control option {
    background: #ffffff;
    color: var(--transfer-ink);
}

.chat-transfer-select__chevron {
    position: absolute;
    top: 50%;
    right: 13px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    color: #71817d;
    pointer-events: none;
    transform: translateY(-50%);
    transition: color .16s ease;
}

.chat-transfer-select__chevron svg {
    display: block;
    width: 17px;
    height: 17px;
}

.chat-transfer-select:focus-within .chat-transfer-select__chevron {
    color: var(--transfer-accent);
}

.chat-transfer-modal__help {
    margin: 8px 0 0;
    color: var(--transfer-muted);
    font-size: .71rem;
    line-height: 1.45;
}

.chat-transfer-modal__actions {
    display: flex;
    justify-content: flex-end;
    gap: 9px;
    padding: 14px 24px;
    border-top: 1px solid var(--transfer-line);
    background: #fbfdfc;
}

.chat-transfer-modal__cancel,
.chat-transfer-modal__submit {
    display: inline-flex;
    min-height: 40px;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 8px 14px;
    border-radius: 8px;
    font-family: inherit;
    font-size: .79rem;
    font-weight: 650;
    cursor: pointer;
    transition: background-color .16s ease, border-color .16s ease, color .16s ease;
}

.chat-transfer-modal__cancel {
    border: 1px solid #dce6e2;
    background: #ffffff;
    color: #53635e;
}

.chat-transfer-modal__cancel:hover {
    border-color: #bccdc6;
    background: #f5f9f7;
}

.chat-transfer-modal__submit {
    border: 1px solid var(--transfer-accent);
    background: var(--transfer-accent);
    color: #ffffff;
}

.chat-transfer-modal__submit:hover,
.chat-transfer-modal__submit:focus-visible {
    border-color: var(--transfer-accent-dark);
    background: var(--transfer-accent-dark);
}

.chat-transfer-modal__submit svg {
    width: 16px;
    height: 16px;
}

@media (max-width: 575.98px) {
    #myModal .modal-dialog:has(.chat-transfer-modal) {
        width: calc(100vw - 20px);
        max-width: 460px;
        margin: 10px auto;
    }

    #myModal .modal-content:has(.chat-transfer-modal) {
        border-radius: 13px;
    }

    .chat-transfer-modal__header {
        gap: 11px;
        padding: 18px 17px 16px;
    }

    .chat-transfer-modal__body {
        padding: 18px 17px 20px;
    }

    .chat-transfer-modal__assignment {
        gap: 8px;
        padding: 12px;
    }

    .chat-transfer-modal__actions {
        padding: 12px 17px;
    }

    .chat-transfer-modal__cancel,
    .chat-transfer-modal__submit {
        flex: 1 1 0;
        padding-inline: 10px;
    }
}


/* =========================================================
       HEADER
    ========================================================= */

.template-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 0;
}

.template-header-left {
    min-width: 0;
}

.template-header h2 {
    margin: 0;
    color: #1f2937;
    font-size: 23px;
    font-weight: 650;
    letter-spacing: -0.3px;
}

.template-header-subtitle {
    margin-top: 5px;
    color: #9ca3af;
    font-size: 12px;
}

.template-header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.template-header-actions a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;

    min-height: 36px;
    padding: 7px 12px;

    border: 1px solid #e5e7eb;
    border-radius: 7px;

    background: #fff;
    color: #374151;

    text-decoration: none;
    font-size: 12px;
    font-weight: 500;

    transition:
        background 0.18s ease,
        border-color 0.18s ease,
        box-shadow 0.18s ease,
        transform 0.18s ease;
}

.template-header-actions a:hover {
    background: #f9fafb;
    border-color: #d1d5db;
    box-shadow: 0 2px 7px rgba(0, 0, 0, 0.04);
    transform: translateY(-1px);
}

.template-header-actions a:active {
    transform: translateY(0);
}

.template-header-actions svg {
    width: 16px;
    height: 16px;
    display: block;
}


/* =========================================================
       TEMPLATE GRID
       
       IMPORTANT:
       CSS GRID is used here instead of column-count.
       This keeps the order:
       
       1  2  3
       4  5  6
       7  8  9
       
    ========================================================= */

.template-grid {
    column-count: 2;
    column-gap: 16px;
    width: 100%;
    margin: 0;
    padding: 3px;
}


/* =========================================================
       TEMPLATE CARD
    ========================================================= */

.template-card {
    display: inline-flex;
    flex-direction: column;

    width: 100%;
    min-width: 0;

    margin: 0 0 16px;
    vertical-align: top;
    break-inside: avoid;
    page-break-inside: avoid;

    background: var(--shell-surface);

    border: 1px solid var(--shell-line);
    border-radius: 14px;

    overflow: hidden;

    height: auto;
    min-height: 0;

    box-shadow: 0 4px 14px rgba(31, 61, 72, .045);

    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease,
        transform 0.2s ease;
}

.template-card:hover {
    border-color: rgba(22, 129, 132, .3);

    box-shadow:
        0 10px 24px rgba(31, 61, 72, .09);

    transform: translateY(-2px);
}


/* =========================================================
       CARD HEADER
    ========================================================= */

.template-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;

    gap: 12px;

    padding: 15px 16px;

    background: #f7fafa;

    border-bottom: 1px solid var(--shell-line);

    min-width: 0;
}

.template-title-wrap {
    display: flex;
    align-items: flex-start;

    gap: 8px;

    min-width: 0;
    flex: 1;
}

.template-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    min-width: 27px;
    height: 27px;

    padding: 0 6px;

    background: var(--shell-accent-soft);

    border: 1px solid rgba(22, 129, 132, .12);
    border-radius: 6px;

    color: var(--shell-accent);

    font-size: 10px;
    font-weight: 600;

    flex-shrink: 0;
}

.template-title {
    margin: 2px 0 0;

    color: var(--shell-ink);

    font-size: 14px;
    font-weight: 600;

    line-height: 1.45;

    min-width: 0;

    word-break: break-word;
    overflow-wrap: anywhere;
}


/* =========================================================
       CATEGORY + STATUS
    ========================================================= */

.template-card-meta {
    display: flex;

    align-items: center;
    justify-content: flex-end;

    gap: 5px;

    flex-shrink: 0;

    max-width: 56%;

    min-width: 0;
}

.template-card-meta .badge {
    display: inline-flex;

    align-items: center;
    justify-content: center;

    min-height: 25px;

    padding: 4px 8px;

    border-radius: 20px;

    font-size: 10px;
    font-weight: 600;

    line-height: 1;

    white-space: nowrap;
}

.template-category {
    background: #ffffff !important;

    border: 1px solid var(--shell-line);

    color: #5d7178 !important;
}

.template-status {
    border: 1px solid transparent;
}


/* =========================================================
       EDIT BUTTON IN CARD HEADER
    ========================================================= */

.template-card-meta>.btn {
    display: inline-flex;

    align-items: center;
    justify-content: center;

    width: 40px;
    height: 40px;

    min-width: 40px;

    padding: 0;

    border-radius: 10px;

    flex-shrink: 0;
}

.template-card-meta>.btn svg {
    width: 17px;
    height: 17px;

    display: block;
}


/* =========================================================
       CARD BODY
    ========================================================= */

.template-card-body {
    padding: 17px;

    min-width: 0;

    overflow: hidden;

    flex: 1;
}


/* =========================================================
       MESSAGE SECTION
    ========================================================= */

.template-section-label {
    display: flex;

    align-items: center;

    gap: 6px;

    margin-bottom: 7px;

    color: var(--shell-muted);

    font-size: 9px;
    font-weight: 700;

    text-transform: uppercase;

    letter-spacing: 0.6px;
}

.template-section-label svg {
    width: 13px;
    height: 13px;

    flex-shrink: 0;
}

.template-content {
    color: #40555d;

    font-size: 12.5px;

    line-height: 1.65;

    margin: 0;

    min-width: 0;

    word-break: break-word;
    overflow-wrap: anywhere;

    white-space: normal;
}


/* =========================================================
       VARIABLES
    ========================================================= */

.template-variables {
    margin-top: 14px;

    padding-top: 12px;

    border-top: 1px solid var(--shell-line);
}

.template-variables-title {
    display: flex;

    align-items: center;

    gap: 6px;

    margin-bottom: 8px;

    color: var(--shell-muted);

    font-size: 9px;
    font-weight: 700;

    text-transform: uppercase;

    letter-spacing: 0.6px;
}

.template-variables-title svg {
    width: 13px;
    height: 13px;

    flex-shrink: 0;
}

.template-variable {
    display: flex;

    align-items: flex-start;

    gap: 8px;

    padding: 7px 9px;

    margin-bottom: 4px;

    background: #f7fafa;

    border: 1px solid var(--shell-line);
    border-radius: 8px;

    font-size: 11px;

    line-height: 1.45;

    color: #51666d;

    min-width: 0;
}

.template-variable-key {
    color: var(--shell-accent);

    font-weight: 600;

    flex-shrink: 0;
}

.template-variable-value {
    min-width: 0;

    word-break: break-word;
    overflow-wrap: anywhere;
}


/* =========================================================
       CARD FOOTER
    ========================================================= */

.template-card-footer {
    display: flex;

    align-items: center;
    justify-content: flex-end;

    gap: 6px;

    padding: 11px 16px;

    background: #fbfdfd;

    border-top: 1px solid var(--shell-line);

    margin-top: auto;
}

.template-card-footer .btn {
    display: inline-flex;

    align-items: center;
    justify-content: center;

    width: 35px;
    height: 35px;

    min-width: 35px;

    padding: 0;

    border-radius: 9px;

    flex-shrink: 0;
}

.template-card-footer .btn svg {
    display: block;

    width: 15px;
    height: 15px;
}

.template-card-footer .btn:hover {
    transform: translateY(-1px);
}


/* =========================================================
       EMPTY STATE
    ========================================================= */

.template-empty {
    width: 100%;

    padding: 70px 20px;

    text-align: center;

    color: #9ca3af;

    grid-column: 1 / -1;
}

.template-empty-icon {
    display: inline-flex;

    align-items: center;
    justify-content: center;

    width: 52px;
    height: 52px;

    margin-bottom: 12px;

    background: #f8f9fa;

    border: 1px solid #e9ecef;

    border-radius: 12px;
}

.template-empty-icon svg {
    width: 24px;
    height: 24px;
}

.template-empty-title {
    color: #4b5563;

    font-size: 14px;
    font-weight: 600;
}

.template-empty-text {
    margin-top: 4px;

    font-size: 11px;
    color: #9ca3af;
}


/* =========================================================
       MODALS
    ========================================================= */

.template-modal .modal-content {
    border: 0;

    border-radius: 12px;

    box-shadow:
        0 15px 45px rgba(15, 23, 42, 0.16);
}

.template-modal .modal-header {
    padding: 15px 18px;

    border-bottom: 1px solid #edf0f2;
}

.template-modal .modal-title {
    color: #273142;

    font-size: 15px;
    font-weight: 600;
}

.template-modal .modal-body {
    padding: 18px;

    color: #596273;

    font-size: 13px;
    line-height: 1.6;
}

.template-modal .modal-footer {
    padding: 12px 18px;

    border-top: 1px solid #edf0f2;
}


/* =========================================================
       RESPONSIVE - TABLET
    ========================================================= */

@media (max-width: 1200px) {

    .template-grid {
        column-count: 2;
    }

}


/* =========================================================
       RESPONSIVE - MOBILE
    ========================================================= */

@media (max-width: 768px) {

    .template-page {
        gap: 8px;
        padding: 8px 10px;
    }

    .template-header {
        align-items: flex-start;

        flex-direction: column;

        gap: 14px;
    }

    .template-header-actions {
        width: 100%;
    }

    .template-header-actions a {
        flex: 1;
    }

    .template-grid {
        column-count: 1;
        column-gap: 0;
    }

    .template-card {
        margin: 0 0 12px;
    }

    .template-card-header {
        flex-wrap: wrap;
    }

    .template-title-wrap {
        flex: 1 1 auto;
    }

    .template-card-meta {
        width: 100%;
        max-width: 100%;

        justify-content: flex-start;
    }

    .template-card-meta>.btn {
        margin-left: auto;
    }

}


/* =========================================================
       SMALL MOBILE
    ========================================================= */

@media (max-width: 480px) {

    .template-header-actions {
        display: grid;

        grid-template-columns: 1fr 1fr;

        width: 100%;
    }

    .template-header-actions a {
        width: 100%;
    }

    .template-header-actions a:last-child {
        grid-column: 1 / -1;
    }

    .template-title {
        font-size: 13px;
    }

    .template-card-header {
        padding: 12px;
    }

    .template-card-body {
        padding: 13px;
    }

    .template-card-footer {
        padding: 9px 13px;
    }

}

#content__inner .bulk-container {
    display: flex;
    flex-direction: column;
    gap: 16px;
    width: 100%;
    height: 100%;
    min-height: 0;
    padding: 22px clamp(14px, 2.4vw, 30px) 26px;
    overflow: auto;
    background: var(--shell-canvas);
    color: var(--shell-ink);
    font-family: inherit;
    box-sizing: border-box;
}

#content__inner .bulk-container,
#content__inner .bulk-container * {
    box-sizing: border-box;
}

#content__inner .bulk-container .bulk-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin: 0;
    padding: 0 2px 14px;
    border: 0;
    border-bottom: 1px solid var(--shell-line);
    border-radius: 0;
    background: transparent;
}

#content__inner .bulk-container .bulk-header h3 {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
    color: var(--shell-ink);
    font-size: 1.35rem;
    font-weight: 600;
}

#content__inner .bulk-container .bulk-header h3 i {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    margin: 0;
    border-radius: 11px;
    background: var(--shell-accent-soft);
    color: var(--shell-accent);
    font-size: 1rem;
}

#content__inner .bulk-container .header-buttons {
    display: flex;
    align-items: center;
    gap: 8px;
}

#content__inner .bulk-container .btn {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 40px;
    padding: 0 14px;
    border: 1px solid var(--shell-line);
    border-radius: 9px;
    background: #ffffff;
    color: #456169 !important;
    font: inherit;
    font-size: .76rem;
    font-weight: 600;
    line-height: 1;
    text-decoration: none;
    transition: border-color .16s ease, background-color .16s ease, color .16s ease, transform .16s ease;
}

#content__inner .bulk-container .btn i {
    margin: 0;
}

#content__inner .bulk-container .btn-success {
    border-color: var(--shell-accent);
    background: var(--shell-accent);
    color: #ffffff !important;
}

#content__inner .bulk-container .btn-success:hover,
#content__inner .bulk-container .btn-success:focus-visible {
    border-color: #116d70;
    background: #116d70;
    color: #ffffff !important;
}

#content__inner .bulk-container .btn-info:hover,
#content__inner .bulk-container .btn-info:focus-visible {
    border-color: rgba(22, 129, 132, .35);
    background: var(--shell-accent-soft);
    color: var(--shell-accent) !important;
}

#content__inner .bulk-container .bulk-card {
    width: 100%;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}

#content__inner .bulk-container .bulk-form-row {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(320px, .9fr);
    align-items: stretch;
    gap: 16px;
    margin: 0;
}

#content__inner .bulk-container .bulk-left,
#content__inner .bulk-container .bulk-right {
    width: auto;
    min-width: 0;
    padding: 22px;
    border: 1px solid var(--shell-line);
    border-radius: 13px;
    background: var(--shell-surface);
    box-shadow: 0 7px 22px rgba(31, 61, 72, .045);
}

#content__inner .bulk-container .form-group {
    margin-bottom: 16px;
}

#content__inner .bulk-container .form-label {
    margin-bottom: 7px;
    color: #40555d;
    font-size: .78rem;
    font-weight: 600;
}

#content__inner .bulk-container .form-control {
    width: 100% !important;
    min-height: 44px;
    height: auto;
    padding: 10px 13px;
    border: 1px solid var(--shell-line);
    border-radius: 9px;
    background: #fbfdfd;
    color: var(--shell-ink);
    font-family: inherit;
    font-size: .82rem;
    line-height: 1.45;
    outline: none;
    box-shadow: none;
    transition: border-color .16s ease, box-shadow .16s ease, background-color .16s ease;
}

#content__inner .bulk-container .form-control:focus {
    border-color: rgba(22, 129, 132, .5);
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(22, 129, 132, .09);
}

#content__inner .bulk-container textarea.form-control {
    min-height: 154px;
    resize: vertical;
    line-height: 1.55;
}

#content__inner .bulk-container select.bulk-select2-source:not(.select2-hidden-accessible),
#content__inner .bulk-container select.bulk-template-select:not(.select2-hidden-accessible) {
    width: 100% !important;
    min-height: 44px;
    padding: 10px 13px;
    border: 1px solid var(--shell-line);
    border-radius: 9px;
    background: #fbfdfd;
    color: var(--shell-ink);
    font: inherit;
    font-size: .82rem;
}

.bulk-select2-source.select2-hidden-accessible,
.bulk-template-select.select2-hidden-accessible {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

#content__inner .bulk-container .select2-container {
    display: inline-block;
    width: 100% !important;
    box-sizing: border-box;
    vertical-align: middle;
}

#content__inner .bulk-container .select2-container .select2-selection--single {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
    min-height: 44px;
    border: 1px solid var(--shell-line);
    border-radius: 9px;
    background: #fbfdfd;
    box-sizing: border-box;
}

#content__inner .bulk-container .select2-container .select2-selection__rendered {
    display: block;
    flex: 1 1 auto;
    min-width: 0;
    margin: 0;
    padding: 0 38px 0 13px;
    color: var(--shell-ink);
    font-family: inherit;
    font-size: .82rem;
    line-height: 42px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

#content__inner .bulk-container .select2-container .select2-selection__arrow {
    display: block;
    position: absolute;
    top: 0;
    right: 0;
    width: 36px;
    height: 42px;
    background: #fbfdfd;
    border: 0;
    border-radius: 0 8px 8px 0;
}

#content__inner .bulk-container .select2-container .select2-selection__arrow b {
    left: 50%;
    margin-left: -4px;
    border-color: #71858a transparent transparent;
}

.bulk-template-options {
    position: absolute;
    overflow: hidden;
    border: 1px solid var(--shell-line) !important;
    border-radius: 9px;
    background: #ffffff;
    box-shadow: 0 10px 24px rgba(31, 61, 72, .12);
    z-index: 1060;
}

.bulk-template-options .select2-search--dropdown {
    display: block;
    padding: 8px;
    background: white;
    box-shadow: 2px 2px 6px #0000006e;
}

.bulk-template-options .select2-search__field {
    display: block;
    width: 100%;
    min-height: 36px;
    padding: 7px 10px;
    border: 1px solid var(--shell-line);
    border-radius: 6px;
    color: var(--shell-ink);
    font: inherit;
    box-sizing: border-box;
}

.bulk-template-options .select2-results__options {
    max-height: 100%;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    overflow-y: auto;
    list-style: none;
    background: white;
    box-shadow: 2px 2px 6px #0000006e;
}

.bulk-template-options .select2-results__option {
    display: list-item;
    cursor: pointer;
}

.bulk-template-options .select2-results__option {
    padding: 9px 12px;
    color: var(--shell-ink);
    font-size: .8rem;
}

.bulk-template-options .select2-results__option--highlighted[aria-selected] {
    background: var(--shell-accent-soft);
    color: var(--shell-accent);
}

.bulk-template-options .select2-results__option[aria-selected=true] {
    background: #eaf5f3;
    color: #116d70;
}

#content__inner .bulk-container .mobile-help {
    margin: -7px 0 16px;
    color: var(--shell-muted);
    font-size: .72rem;
    line-height: 1.55;
}

#content__inner .bulk-container .template-variables {
    margin-top: 18px;
    overflow: hidden;
    border: 1px solid var(--shell-line);
    border-radius: 11px;
    background: #ffffff;
}

#content__inner .bulk-container .template-variables-title {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 42px;
    padding: 0 13px;
    border-bottom: 1px solid var(--shell-line);
    background: #f5f9f9;
    color: var(--shell-ink);
    font-size: .76rem;
    font-weight: 600;
}

#content__inner .bulk-container .template-variables-title i {
    margin: 0;
    color: var(--shell-accent);
}

#content__inner .bulk-container #variables_container {
    height: 170px;
    max-height: 170px;
    padding: 10px 12px;
    overflow-x: hidden;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(22, 129, 132, .38) transparent;
}

#content__inner .bulk-container #variables_container::-webkit-scrollbar {
    width: 7px;
}

#content__inner .bulk-container #variables_container::-webkit-scrollbar-thumb {
    border-radius: 999px;
    background: rgba(22, 129, 132, .38);
}

#content__inner .bulk-container .variable-row {
    margin-bottom: 10px;
}

#content__inner .bulk-container .variable-row:last-child {
    margin-bottom: 0;
}

#content__inner .bulk-container .variable-label {
    margin-bottom: 5px;
    color: #526970;
    font-size: .72rem;
    font-weight: 600;
}

#content__inner .bulk-container .variable-badge {
    padding: 3px 7px;
    border-radius: 6px;
    background: var(--shell-accent-soft);
    color: var(--shell-accent);
    font-size: .68rem;
}

#content__inner .bulk-container .variable-input {
    width: 100%;
    min-height: 38px;
    padding: 8px 10px;
    border: 1px solid var(--shell-line);
    border-radius: 8px;
    background: #fbfdfd;
    color: var(--shell-ink);
    font-family: inherit;
    font-size: .78rem;
    outline: none;
}

#content__inner .bulk-container .variable-input:focus {
    border-color: rgba(22, 129, 132, .5);
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(22, 129, 132, .08);
}

#content__inner .bulk-container .no-variables {
    padding: 8px 2px;
    color: var(--shell-muted);
    font-size: .75rem;
}

#content__inner .bulk-container .submit-area {
   
    display: flex;
    justify-content: flex-end;
    width: auto;
    margin: 16px -22px -22px;
    padding: 14px 22px 18px;
    border-top: 1px solid var(--shell-line);
    background: rgba(255, 255, 255, .97);
    backdrop-filter: blur(10px);
}

#content__inner .bulk-container .submit-btn {
    min-width: 190px;
    min-height: 46px;
    padding: 10px 17px;
    border: 1px solid var(--shell-accent);
    border-radius: 10px;
    background: var(--shell-accent);
    color: #ffffff !important;
    font-size: .82rem;
    font-weight: 600;
}

#content__inner .bulk-container .submit-btn:hover {
    border-color: #116d70;
    background: #116d70;
    box-shadow: 0 8px 18px rgba(22, 129, 132, .18);
    transform: translateY(-1px);
}

#content__inner .bulk-container .template-container {
    display: flex;
    flex-direction: column;
    width: 100%;
    min-height: 100%;
    overflow: hidden;
    border: 1px solid var(--shell-line);
    border-radius: 11px;
    background: #ffffff;
}

#content__inner .bulk-container .template-header {
    display: flex;
    align-items: center;
    min-height: 44px;
    padding: 0 14px;
    background: #f2f8f7;
    border-bottom: 1px solid var(--shell-line);
}

#content__inner .bulk-container .template-header h4 {
    margin: 0;
    color: var(--shell-ink);
    font-size: .8rem;
    font-weight: 600;
}

#content__inner .bulk-container .template-header h4 i {
    margin-right: 7px;
    color: var(--shell-accent);
}

#content__inner .bulk-container .template-content {
    display: block;
    flex: 1 1 auto;
    width: 100% !important;
    min-height: 420px;
    height: 100% !important;
    padding: 16px;
    border: 0 !important;
    outline: 0 !important;
    resize: none;
    background: #ffffff;
    color: #40555d;
    font-family: inherit;
    font-size: .8rem;
    line-height: 1.65;
    overflow-y: auto;
}

@media (max-width: 991.98px) {
    #content__inner .bulk-container .bulk-form-row {
        grid-template-columns: minmax(0, 1fr);
    }

    #content__inner .bulk-container .bulk-left,
    #content__inner .bulk-container .bulk-right {
        width: 100%;
    }

    #content__inner .bulk-container .bulk-right {
        min-height: 360px;
    }

    #content__inner .bulk-container .template-content {
        min-height: 300px;
    }
}

@media (max-width: 576px) {
    #content__inner .bulk-container {
        gap: 12px;
        padding: 14px 10px 18px;
    }

    #content__inner .bulk-container .bulk-header {
        align-items: flex-start;
        flex-direction: column;
        gap: 12px;
        padding-bottom: 12px;
    }

    #content__inner .bulk-container .bulk-header h3 {
        font-size: 1.15rem;
    }

    #content__inner .bulk-container .header-buttons {
        width: 100%;
    }

    #content__inner .bulk-container .header-buttons .btn {
        flex: 1 1 0;
        padding: 0 8px;
        font-size: .7rem;
    }

    #content__inner .bulk-container .bulk-left,
    #content__inner .bulk-container .bulk-right {
        padding: 15px;
    }

    #content__inner .bulk-container .submit-area {
        margin: 14px -15px -15px;
        padding: 12px 15px 15px;
    }

    #content__inner .bulk-container .submit-btn {
        width: 100% !important;
    }

    #content__inner .bulk-container .template-content {
        min-height: 260px;
    }
}

#addGroupModal .modal-dialog {
    width: min(500px, calc(100vw - 32px));
    max-width: 500px;
    margin: 18px auto;
}

#addGroupModal .modal-content {
    overflow: hidden;
    border: 1px solid var(--shell-line);
    border-radius: 16px;
    background: #ffffff;
    box-shadow: 0 24px 70px rgba(19, 46, 55, .22);
}

#addGroupModal .group-modal-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 18px 22px;
    border-bottom: 1px solid var(--shell-line);
    background: linear-gradient(120deg, #ffffff, #f1f8f7);
}

#addGroupModal .group-modal-icon {
    display: inline-flex;
    flex: 0 0 42px;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: var(--shell-accent-soft);
    color: var(--shell-accent);
    font-size: 1rem;
}

#addGroupModal .group-modal-title {
    margin: 0;
    color: var(--shell-ink);
    font-family: inherit;
    font-size: 1.18rem;
    font-weight: 600;
}

#addGroupModal .group-modal-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    margin-left: auto;
    padding: 0;
    border: 1px solid var(--shell-line);
    border-radius: 9px;
    background: #ffffff;
    color: var(--shell-muted);
    cursor: pointer;
    transition: border-color .16s ease, color .16s ease, background-color .16s ease;
}

#addGroupModal .group-modal-close:hover,
#addGroupModal .group-modal-close:focus-visible {
    border-color: rgba(22, 129, 132, .35);
    background: var(--shell-accent-soft);
    color: var(--shell-accent);
    outline: none;
}

#addGroupModal .group-modal-form {
    display: block;
}

#addGroupModal .group-modal-body {
    padding: 20px 22px 8px;
}

#addGroupModal .group-modal-field {
    margin: 0 0 16px;
}

#addGroupModal .group-modal-label {
    display: block;
    margin: 0 0 7px;
    color: #40555d;
    font-size: .78rem;
    font-weight: 600;
}

#addGroupModal .form-control {
    width: 100%;
    min-height: 44px;
    padding: 10px 13px;
    border: 1px solid var(--shell-line);
    border-radius: 9px;
    background: #fbfdfd;
    color: var(--shell-ink);
    font-family: inherit;
    font-size: .82rem;
    box-shadow: none;
}

#addGroupModal .form-control:focus {
    border-color: rgba(22, 129, 132, .5);
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(22, 129, 132, .09);
}

#addGroupModal textarea.form-control {
    min-height: 112px;
    resize: vertical;
    line-height: 1.5;
}

#addGroupModal .group-modal-help {
    margin: -5px 0 14px;
    padding: 10px 12px;
    border-left: 3px solid rgba(22, 129, 132, .45);
    border-radius: 0 7px 7px 0;
    background: #f3f8f7;
    color: var(--shell-muted);
    font-size: .72rem;
    line-height: 1.5;
}

#addGroupModal .group-modal-help b {
    color: var(--shell-ink);
}

#addGroupModal .group-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 9px;
    padding: 14px 22px 20px;
    border-top: 1px solid var(--shell-line);
    background: #ffffff;
}

#addGroupModal .group-modal-footer .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-height: 42px;
    margin: 0;
    padding: 0 15px;
    border: 1px solid var(--shell-line);
    border-radius: 9px;
    font-family: inherit;
    font-size: .78rem;
    font-weight: 600;
}

#addGroupModal .group-modal-cancel {
    background: #ffffff;
    color: #526970;
}

#addGroupModal .group-modal-cancel:hover {
    border-color: rgba(22, 129, 132, .35);
    background: #f5f9f9;
}

#addGroupModal .group-modal-submit {
    border-color: var(--shell-accent);
    background: var(--shell-accent);
    color: #ffffff;
}

#addGroupModal .group-modal-submit:hover,
#addGroupModal .group-modal-submit:focus-visible {
    border-color: #116d70;
    background: #116d70;
    color: #ffffff;
}

@media (max-width: 480px) {
    #addGroupModal .modal-dialog {
        width: calc(100vw - 20px);
        margin: 10px auto;
    }

    #addGroupModal .group-modal-header {
        padding: 16px;
    }

    #addGroupModal .group-modal-body {
        padding: 16px 16px 6px;
    }

    #addGroupModal .group-modal-footer {
        padding: 12px 16px 16px;
    }
}

#content__inner .redirect-links-page {
    gap: 16px;
    padding: 20px clamp(14px, 2.4vw, 30px) 24px;
}

#content__inner .redirect-links-header {
    flex: 0 0 auto;
    min-height: 72px;
    padding: 0 2px 14px;
    border-bottom: 1px solid var(--shell-line);
}

#content__inner .redirect-links-header .management-page-subtitle {
    margin-top: 5px;
}

#content__inner .redirect-links-add {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 42px;
    padding: 0 15px;
    border: 1px solid var(--shell-accent);
    border-radius: 9px;
    background: var(--shell-accent);
    color: #ffffff;
    font: inherit;
    font-size: .82rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color .16s ease, border-color .16s ease, transform .16s ease;
}

#content__inner .redirect-links-add:hover,
#content__inner .redirect-links-add:focus-visible {
    border-color: #116d70;
    background: #116d70;
    color: #ffffff;
    outline: none;
}

#content__inner .redirect-links-add svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

#content__inner .redirect-links-panel {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    min-width: 0;
}

#content__inner .redirect-links-table-scroll {
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    scrollbar-color: rgba(22, 129, 132, .38) transparent;
}

#content__inner .redirect-links-table-scroll::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

#content__inner .redirect-links-table-scroll::-webkit-scrollbar-thumb {
    border: 2px solid transparent;
    border-radius: 999px;
    background: rgba(22, 129, 132, .38);
    background-clip: padding-box;
}

#content__inner .redirect-links-table {
    min-width: 1080px;
}

#content__inner .redirect-links-table th:first-child,
#content__inner .redirect-links-index {
    width: 64px;
    text-align: center;
}

#content__inner .redirect-links-title {
    min-width: 150px;
    font-weight: 600;
}

#content__inner .redirect-links-message {
    width: 280px;
    min-width: 220px;
    max-width: 280px;
    color: var(--shell-muted) !important;
    line-height: 1.5;
    overflow-wrap: anywhere;
}

#content__inner .copy-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    border: 1px solid var(--shell-line);
    border-radius: 8px;
    background: #ffffff;
    color: #41666d;
    cursor: pointer;
    transition: border-color .16s ease, background-color .16s ease, color .16s ease;
}

#content__inner .copy-btn:hover,
#content__inner .copy-btn:focus-visible {
    border-color: rgba(22, 129, 132, .35);
    background: var(--shell-accent-soft);
    color: var(--shell-accent);
    outline: none;
}

#content__inner .copy-btn svg {
    width: 17px;
    height: 17px;
}

#content__inner .redirect-links-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 34px;
    min-height: 26px;
    padding: 0 8px;
    border-radius: 7px;
    background: #edf2f3;
    color: #536970;
    font-size: .76rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

#content__inner .redirect-links-count--new {
    background: var(--shell-accent-soft);
    color: var(--shell-accent);
}

#content__inner .redirect-links-count--old {
    background: #f1f3f4;
    color: #64747a;
}

#content__inner .redirect-links-table .management-table-actions {
    min-width: 94px;
    white-space: nowrap;
}

@media (max-width: 767.98px) {
    #content__inner .redirect-links-page {
        gap: 12px;
        padding: 16px 10px;
    }

    #content__inner .redirect-links-header {
        align-items: center;
        min-height: 60px;
        padding-bottom: 12px;
    }

    #content__inner .redirect-links-add {
        min-height: 38px;
        padding: 0 11px;
        font-size: .75rem;
    }

    #content__inner .redirect-links-table {
        min-width: 980px;
    }
}

@media (max-width: 480px) {
    #content__inner .redirect-links-header {
        align-items: flex-start;
        flex-direction: column;
    }

    #content__inner .redirect-links-add {
        width: 100%;
    }
}

#myModal .modal-dialog:has(.redirect-link-modal) {
    width: min(540px, calc(100vw - 32px));
    max-width: 540px;
    margin: 16px auto;
}

#myModal .modal-content:has(.redirect-link-modal) {
    overflow: hidden;
    border: 1px solid var(--shell-line);
    border-radius: 16px;
    background: #ffffff;
    box-shadow: 0 22px 60px rgba(19, 46, 55, .2);
}

#myModal .redirect-link-modal-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 18px 22px;
    border-bottom: 1px solid var(--shell-line);
    background: linear-gradient(120deg, #ffffff, #f1f8f7);
}

#myModal .redirect-link-modal-icon {
    display: inline-flex;
    flex: 0 0 42px;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: var(--shell-accent-soft);
    color: var(--shell-accent);
}

#myModal .redirect-link-modal-icon svg {
    width: 21px;
    height: 21px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

#myModal .redirect-link-modal-heading {
    min-width: 0;
}

#myModal .redirect-link-modal-kicker {
    display: block;
    margin-bottom: 3px;
    color: var(--shell-muted);
    font-size: .7rem;
    font-weight: 700;
    text-transform: uppercase;
}

#myModal .redirect-link-modal-title {
    margin: 0;
    color: var(--shell-ink);
    font-family: inherit;
    font-size: 1.2rem;
    font-weight: 600;
    line-height: 1.25;
}

#myModal .redirect-link-modal-close {
    display: inline-flex;
    flex: 0 0 36px;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    margin-left: auto;
    padding: 0;
    border: 1px solid var(--shell-line);
    border-radius: 9px;
    background: #ffffff;
    color: var(--shell-muted);
    cursor: pointer;
}

#myModal .redirect-link-modal-close:hover,
#myModal .redirect-link-modal-close:focus-visible {
    border-color: rgba(22, 129, 132, .35);
    background: var(--shell-accent-soft);
    color: var(--shell-accent);
    outline: none;
}

#myModal .redirect-link-modal-close svg,
#myModal .redirect-link-modal-submit svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

#myModal .redirect-link-modal-form {
    display: flex;
    flex-direction: column;
}

#myModal .redirect-link-modal-body {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 22px;
}

#myModal .redirect-link-modal-field {
    display: flex;
    flex-direction: column;
    gap: 7px;
    min-width: 0;
}

#myModal .redirect-link-modal-label {
    color: #40555d;
    font-size: .84rem;
    font-weight: 600;
}

#myModal .redirect-link-modal-control {
    width: 100%;
    min-height: 46px;
    padding: 10px 13px;
    border: 1px solid var(--shell-line);
    border-radius: 9px;
    background: #fbfdfd;
    color: var(--shell-ink);
    font-family: inherit;
    font-size: .86rem;
    line-height: 1.45;
    box-shadow: none;
}

#myModal .redirect-link-modal-control:focus {
    border-color: rgba(22, 129, 132, .5);
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(22, 129, 132, .09);
}

#myModal .redirect-link-modal-control::placeholder {
    color: var(--shell-muted);
    opacity: 1;
}

#myModal .redirect-link-modal-textarea {
    min-height: 116px;
    resize: vertical;
}

#myModal .redirect-link-modal-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 9px;
    padding: 14px 22px 18px;
    border-top: 1px solid var(--shell-line);
    background: #ffffff;
}

#myModal .redirect-link-modal-actions button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-height: 42px;
    padding: 0 15px;
    border: 1px solid var(--shell-line);
    border-radius: 9px;
    font-family: inherit;
    font-size: .8rem;
    font-weight: 600;
    cursor: pointer;
}

#myModal .redirect-link-modal-cancel {
    background: #ffffff;
    color: #526970;
}

#myModal .redirect-link-modal-cancel:hover,
#myModal .redirect-link-modal-cancel:focus-visible {
    border-color: rgba(22, 129, 132, .35);
    background: #f5f9f9;
    outline: none;
}

#myModal .redirect-link-modal-submit {
    border-color: var(--shell-accent) !important;
    background: var(--shell-accent);
    color: #ffffff;
}

#myModal .redirect-link-modal-submit:hover,
#myModal .redirect-link-modal-submit:focus-visible {
    border-color: #116d70 !important;
    background: #116d70;
    outline: none;
}

@media (max-width: 480px) {
    #myModal .modal-dialog:has(.redirect-link-modal) {
        width: calc(100vw - 20px);
        margin: 10px auto;
    }

    #myModal .redirect-link-modal-header {
        padding: 16px;
    }

    #myModal .redirect-link-modal-body {
        gap: 14px;
        padding: 16px;
    }

    #myModal .redirect-link-modal-actions {
        padding: 12px 16px 16px;
    }
}

#content__inner .leads-report-page {
    gap: 16px;
    padding: 20px clamp(14px, 2.4vw, 30px) 24px;
}



#content__inner .leads-report-header .management-page-subtitle {
    margin-top: 5px;
}

#content__inner .leads-report-filters {
    display: flex;
    flex: 0 0 auto;
    flex-direction: column;
    gap: 14px;
    /* padding: 16px 18px 18px; */
    /* border: 1px solid var(--shell-line); */
    /* border-radius: 11px; */
    /* background: var(--shell-surface); */
    /* box-shadow: 0 6px 18px rgba(31, 61, 72, .035); */
}

#content__inner .leads-report-filter-heading h2 {
    margin: 0;
    color: var(--shell-ink);
    font-size: .92rem;
    font-weight: 600;
}

#content__inner .leads-report-filter-grid {
    display: grid;
    grid-template-columns: minmax(140px, 1fr) minmax(140px, 1fr) minmax(160px, 1fr) auto;
    align-items: end;
    gap: 12px;
}

#content__inner .leads-report-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}

#content__inner .leads-report-field label {
    margin: 0;
    color: #526970;
    font-size: .76rem;
    font-weight: 600;
}

#content__inner .leads-report-field .form-control,
#content__inner .leads-report-field .form-select {
    width: 100%;
    min-width: 0;
    min-height: 40px;
    padding: 8px 11px;
    border: 1px solid var(--shell-line);
    border-radius: 8px;
    background-color: #fbfdfd;
    color: var(--shell-ink);
    font-family: inherit;
    font-size: .78rem;
    box-shadow: none;
}

#content__inner .leads-report-field .form-control:focus,
#content__inner .leads-report-field .form-select:focus {
    border-color: rgba(22, 129, 132, .5);
    background-color: #ffffff;
    box-shadow: 0 0 0 3px rgba(22, 129, 132, .08);
}

#content__inner .leads-report-filter-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 40px;
}

#content__inner .leads-report-filter-actions button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-height: 40px;
    padding: 0 12px;
    border: 1px solid var(--shell-line);
    border-radius: 8px;
    font-family: inherit;
    font-size: .76rem;
    font-weight: 600;
    white-space: nowrap;
    cursor: pointer;
    transition: border-color .16s ease, color .16s ease, background-color .16s ease;
}

#content__inner .leads-report-filter-button {
    border-color: var(--shell-accent) !important;
    background: var(--shell-accent);
    color: #ffffff;
}

#content__inner .leads-report-filter-button:hover,
#content__inner .leads-report-filter-button:focus-visible {
    border-color: #116d70 !important;
    background: #116d70;
    outline: none;
}

#content__inner .leads-report-filter-button svg {
    width: 15px;
    height: 15px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

#content__inner .leads-report-reset-button {
    background: #ffffff;
    color: #526970;
}

#content__inner .leads-report-reset-button:hover,
#content__inner .leads-report-reset-button:focus-visible {
    border-color: rgba(22, 129, 132, .35);
    background: var(--shell-accent-soft);
    color: var(--shell-accent);
    outline: none;
}

#content__inner .leads-report-table-panel {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    min-width: 0;
}

#content__inner .leads-report-page #data-table_wrapper {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    width: 100%;
    height: 100%;
    min-height: 0;
    margin: 0;
}

#content__inner .leads-report-page #data-table_wrapper .management-table-toolbar {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 0px;
    border-bottom: 1px solid var(--shell-line);
    background: #ffffff;
}

#content__inner .leads-report-page #data-table_wrapper .leads-table-container {
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;
    overscroll-behavior: contain;
}

#content__inner .leads-report-table {
    min-width: 760px;
}

#content__inner .leads-report-table th:first-child,
#content__inner .leads-report-table td:first-child {
    width: 78px;
    text-align: center;
}

#content__inner .leads-report-table td:nth-child(3) {
    min-width: 180px;
    font-weight: 600;
}

#content__inner .leads-report-table td:nth-child(4) {
    min-width: 150px;
    font-variant-numeric: tabular-nums;
}

#content__inner .leads-report-table td:nth-child(5) {
    color: #526970;
    white-space: nowrap;
}

@media (max-width: 991.98px) {
    #content__inner .leads-report-filter-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    #content__inner .leads-report-filter-actions {
        grid-column: 1 / -1;
        justify-content: flex-end;
    }
}

@media (max-width: 767.98px) {
    #content__inner .leads-report-page {
        gap: 12px;
        padding: 16px 10px;
    }

    #content__inner .leads-report-header {
        min-height: 60px;
        padding-bottom: 12px;
    }

    #content__inner .leads-report-filters {
        gap: 12px;
        padding: 14px;
    }

    #content__inner .leads-report-page #data-table_wrapper .management-table-toolbar {
        align-items: stretch;
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    #content__inner .leads-report-filter-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    #content__inner .leads-report-filter-actions {
        grid-column: auto;
    }

    #content__inner .leads-report-filter-actions button {
        flex: 1 1 0;
    }
}

#content__inner .company-details-page {
    gap: 16px;
    padding: 20px clamp(14px, 2.4vw, 30px) 24px;
}

#content__inner .company-details-header {
    flex: 0 0 auto;
    min-height: 72px;
    padding: 0 2px 14px;
    border-bottom: 1px solid var(--shell-line);
}

#content__inner .company-details-header .management-page-subtitle {
    margin-top: 5px;
}

#content__inner .company-details-add {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 42px;
    padding: 0 15px;
    border: 1px solid var(--shell-accent);
    border-radius: 9px;
    background: var(--shell-accent);
    color: #ffffff;
    font: inherit;
    font-size: .82rem;
    font-weight: 600;
    cursor: pointer;
    transition: border-color .16s ease, background-color .16s ease;
}

#content__inner .company-details-add:hover,
#content__inner .company-details-add:focus-visible {
    border-color: #116d70;
    background: #116d70;
    color: #ffffff;
    outline: none;
}

#content__inner .company-details-add svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

#content__inner .company-details-panel {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    min-width: 0;
}

#content__inner #companyTable_wrapper {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    width: 100%;
    height: 100%;
    min-height: 0;
    margin: 0;
}

#content__inner #companyTable_wrapper .management-table-toolbar {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
    border-bottom: 1px solid var(--shell-line);
    background: #ffffff;
}

#content__inner #companyTable_wrapper .company-table-scroll {
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;
    overscroll-behavior: contain;
}

#content__inner .company-details-table {
    min-width: 1180px;
}

#content__inner .company-details-table th:first-child,
#content__inner .company-details-table td:first-child {
    width: 68px;
    text-align: center;
}

#content__inner .company-details-table td:nth-child(2) {
    min-width: 170px;
    font-weight: 600;
}

#content__inner .company-secret {
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    max-width: 260px;
    min-height: 32px;
    padding: 0 9px;
    overflow: hidden;
    border: 1px solid var(--shell-line);
    border-radius: 7px;
    background: #f7fafa;
    color: #536970;
    font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
    font-size: .7rem;
    text-align: left;
    text-overflow: ellipsis;
    white-space: nowrap;
    cursor: pointer;
}

#content__inner .company-secret:hover,
#content__inner .company-secret:focus-visible {
    border-color: rgba(22, 129, 132, .4);
    background: var(--shell-accent-soft);
    color: var(--shell-accent);
    outline: none;
}

#content__inner .company-secret--url {
    max-width: 300px;
}

#content__inner .company-user-count {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 0 9px;
    border-radius: 7px;
    background: #f1f5f5;
    color: #526970;
    font-size: .76rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

#content__inner .company-status {
    display: inline-flex;
    align-items: center;
    min-height: 27px;
    padding: 0 9px;
    border-radius: 999px;
    font-size: .72rem;
    font-weight: 600;
    white-space: nowrap;
}

#content__inner .company-status--active {
    background: #e8f5ef;
    color: #21754d;
}

#content__inner .company-status--inactive {
    background: #fbefee;
    color: #ad4d45;
}

#content__inner .company-login {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 32px;
    padding: 0 10px;
    border: 1px solid rgba(22, 129, 132, .2);
    border-radius: 7px;
    background: var(--shell-accent-soft);
    color: var(--shell-accent);
    font-size: .74rem;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
}

#content__inner .company-login:hover,
#content__inner .company-login:focus-visible {
    border-color: rgba(22, 129, 132, .45);
    background: #d9eeeb;
    color: #116d70;
    outline: none;
}

#content__inner .company-login svg {
    width: 15px;
    height: 15px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

@media (max-width: 767.98px) {
    #content__inner .company-details-page {
        gap: 12px;
        padding: 16px 10px;
    }

    #content__inner .company-details-header {
        min-height: 60px;
        padding-bottom: 12px;
    }

    #content__inner #companyTable_wrapper .management-table-toolbar {
        align-items: stretch;
        flex-direction: column;
    }

    #content__inner .company-details-add {
        min-height: 38px;
        padding: 0 11px;
        font-size: .75rem;
    }
}

@media (max-width: 480px) {
    #content__inner .company-details-header {
        align-items: flex-start;
        flex-direction: column;
    }

    #content__inner .company-details-add {
        width: 100%;
    }
}

#content__inner .company-details-panel,
#content__inner #companyTable_wrapper,
#content__inner #companyTable_wrapper .company-table-scroll {
    min-height: 0;
}

#content__inner #companyTable_wrapper .company-table-scroll {
    height: 100%;
    max-height: none;
    overflow: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    scrollbar-color: rgba(22, 129, 132, .48) #edf3f3;
}

#content__inner #companyTable_wrapper .company-table-scroll::-webkit-scrollbar,
#content__inner #companyTable_wrapper .dataTables_scrollBody::-webkit-scrollbar {
    width: 9px;
    height: 9px;
}

#content__inner #companyTable_wrapper .company-table-scroll::-webkit-scrollbar-track,
#content__inner #companyTable_wrapper .dataTables_scrollBody::-webkit-scrollbar-track {
    border-radius: 999px;
    background: #edf3f3;
}

#content__inner #companyTable_wrapper .company-table-scroll::-webkit-scrollbar-thumb,
#content__inner #companyTable_wrapper .dataTables_scrollBody::-webkit-scrollbar-thumb {
    border: 2px solid #edf3f3;
    border-radius: 999px;
    background: rgba(22, 129, 132, .55);
}

#content__inner #companyTable_wrapper .company-table-scroll::-webkit-scrollbar-thumb:hover,
#content__inner #companyTable_wrapper .dataTables_scrollBody::-webkit-scrollbar-thumb:hover {
    background: #168184;
}

#content__inner #companyTable_wrapper .dataTables_scroll {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    min-height: 0;
}

#content__inner #companyTable_wrapper .dataTables_scrollBody {
    flex: 1 1 auto;
    min-height: 0;
    max-height: none !important;
    overflow: auto !important;
    scrollbar-width: thin;
    scrollbar-color: rgba(22, 129, 132, .48) #edf3f3;
}

#myModal .modal-dialog:has(.company-modal) {
    width: min(520px, calc(100vw - 32px));
    max-width: 520px;
    margin: 16px auto;
}

#myModal .modal-content:has(.company-modal) {
    overflow: hidden;
    border: 1px solid var(--shell-line);
    border-radius: 16px;
    background: #ffffff;
    box-shadow: 0 22px 60px rgba(19, 46, 55, .2);
}

#myModal .company-modal-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 18px 22px;
    border-bottom: 1px solid var(--shell-line);
    background: linear-gradient(120deg, #ffffff, #f1f8f7);
}

#myModal .company-modal-icon {
    display: inline-flex;
    flex: 0 0 42px;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: var(--shell-accent-soft);
    color: var(--shell-accent);
}

#myModal .company-modal-icon svg {
    width: 21px;
    height: 21px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

#myModal .company-modal-heading {
    min-width: 0;
}

#myModal .company-modal-kicker {
    display: block;
    margin-bottom: 3px;
    color: var(--shell-muted);
    font-size: .7rem;
    font-weight: 700;
    text-transform: uppercase;
}

#myModal .company-modal-title {
    margin: 0;
    color: var(--shell-ink);
    font-family: inherit;
    font-size: 1.2rem;
    font-weight: 600;
    line-height: 1.25;
}

#myModal .company-modal-close {
    display: inline-flex;
    flex: 0 0 36px;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    margin-left: auto;
    padding: 0;
    border: 1px solid var(--shell-line);
    border-radius: 9px;
    background: #ffffff;
    color: var(--shell-muted);
    cursor: pointer;
}

#myModal .company-modal-close:hover,
#myModal .company-modal-close:focus-visible {
    border-color: rgba(22, 129, 132, .35);
    background: var(--shell-accent-soft);
    color: var(--shell-accent);
    outline: none;
}

#myModal .company-modal-close svg,
#myModal .company-modal-submit svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

#myModal .company-modal-form {
    display: flex;
    flex-direction: column;
}

#myModal .company-modal-body {
    margin: 0 !important;
    padding: 0 !important;
}

#myModal .company-modal-body .card {
    margin: 0;
    border: 0;
    border-radius: 0;
    background: #ffffff;
}

#myModal .company-modal .profile {
    display: none;
}

#myModal .company-modal-fields {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 22px;
}

#myModal .company-modal-fields .row {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin: 0;
}

#myModal .company-modal-fields .col-12 {
    width: 100%;
    padding: 0;
}

#myModal .company-modal-field {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

#myModal .company-modal-label {
    color: #40555d;
    font-size: .84rem;
    font-weight: 600;
}

#myModal .company-modal-control {
    width: 100%;
    min-height: 46px;
    padding: 10px 13px;
    border: 1px solid var(--shell-line);
    border-radius: 9px;
    background: #fbfdfd;
    color: var(--shell-ink);
    font-family: inherit;
    font-size: .86rem;
    line-height: 1.45;
    box-shadow: none;
}

#myModal .company-modal-control:focus {
    border-color: rgba(22, 129, 132, .5);
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(22, 129, 132, .09);
}

#myModal .company-modal-control::placeholder {
    color: var(--shell-muted);
    opacity: 1;
}

#myModal .company-modal-help {
    color: var(--shell-muted);
    font-size: .76rem;
    line-height: 1.45;
}

#myModal .company-modal-company {
    display: flex;
    flex-direction: column;
    gap: 5px;
    padding: 12px 14px;
    border: 1px solid var(--shell-line);
    border-radius: 9px;
    background: #f6f9f9;
}

#myModal .company-modal-company-label {
    color: var(--shell-muted);
    font-size: .7rem;
    font-weight: 700;
    text-transform: uppercase;
}

#myModal .company-modal-company strong {
    color: var(--shell-ink);
    font-size: .9rem;
    font-weight: 600;
}

#myModal .company-modal-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 9px;
    padding: 14px 22px 18px;
    border-top: 1px solid var(--shell-line);
    background: #ffffff;
}

#myModal .company-modal-actions button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-height: 42px;
    padding: 0 15px;
    border: 1px solid var(--shell-line);
    border-radius: 9px;
    font-family: inherit;
    font-size: .8rem;
    font-weight: 600;
    cursor: pointer;
}

#myModal .company-modal-cancel {
    background: #ffffff;
    color: #526970;
}

#myModal .company-modal-cancel:hover,
#myModal .company-modal-cancel:focus-visible {
    border-color: rgba(22, 129, 132, .35);
    background: #f5f9f9;
    outline: none;
}

#myModal .company-modal-submit {
    border-color: var(--shell-accent) !important;
    background: var(--shell-accent);
    color: #ffffff;
}

#myModal .company-modal-submit:hover,
#myModal .company-modal-submit:focus-visible {
    border-color: #116d70 !important;
    background: #116d70;
    outline: none;
}

@media (max-width: 480px) {
    #myModal .modal-dialog:has(.company-modal) {
        width: calc(100vw - 20px);
        margin: 10px auto;
    }

    #myModal .company-modal-header {
        padding: 16px;
    }

    #myModal .company-modal-fields {
        padding: 16px;
    }

    #myModal .company-modal-actions {
        padding: 12px 16px 16px;
    }
}

#modal-profile .profile-account-dialog {
    width: min(460px, calc(100vw - 32px));
    max-width: 460px;
    margin: 16px auto;
}

#modal-invite .profile-account-dialog,
#modal-invite .list-group,
#modal-invite .profile.modal-gx-n~* {
    display: none !important;
}

#modal-invite .profile-body {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 16px 20px 20px;
}

#modal-invite .profile-body::after {
    margin-top: 12px;
    color: var(--shell-muted);
    content: "Find people to connect with";
    font-size: .84rem;
}

#modal-profile .profile-account-modal {
    overflow: hidden;
    border: 1px solid var(--shell-line);
    border-radius: 18px;
    background: #ffffff;
    box-shadow: 0 24px 70px rgba(19, 46, 55, .22);
}

#modal-profile .profile-account-header {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 30px 24px 24px;
    border-bottom: 1px solid var(--shell-line);
    background: linear-gradient(135deg, #f0f8f7, #ffffff 72%);
    text-align: center;
}

#modal-profile .profile-account-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 70px;
    height: 70px;
    margin-bottom: 13px;
    border: 4px solid #ffffff;
    border-radius: 50%;
    background: var(--shell-accent);
    box-shadow: 0 5px 15px rgba(22, 129, 132, .18);
    color: #ffffff;
    font-size: 1.7rem;
    font-weight: 600;
}

#modal-invite .profile-account-avatar svg {
    width: 30px;
    height: 30px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
}

#modal-invite .invite-modal-message {
    margin: 0;
    color: var(--shell-muted);
    font-size: .88rem;
    line-height: 1.5;
    text-align: center;
}

#modal-profile .profile-account-kicker {
    margin-bottom: 4px;
    color: var(--shell-accent);
    font-size: .7rem;
    font-weight: 700;
    text-transform: uppercase;
}

#modal-profile .profile-account-name {
    max-width: 100%;
    margin: 0;
    color: var(--shell-ink);
    font-size: 1.3rem;
    font-weight: 600;
    line-height: 1.25;
    overflow-wrap: anywhere;
}

#modal-profile .profile-account-close {
    position: absolute;
    top: 14px;
    right: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    padding: 0;
    border: 1px solid var(--shell-line);
    border-radius: 9px;
    background: #ffffff;
    color: var(--shell-muted);
    cursor: pointer;
}

#modal-profile .profile-account-close:hover,
#modal-profile .profile-account-close:focus-visible {
    border-color: rgba(22, 129, 132, .35);
    background: var(--shell-accent-soft);
    color: var(--shell-accent);
    outline: none;
}

#modal-profile .profile-account-close svg {
    width: 17px;
    height: 17px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
}

#modal-profile .profile-account-body {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 18px 20px;
}

#modal-profile .profile-account-detail {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    padding: 13px 14px;
    border: 1px solid var(--shell-line);
    border-radius: 10px;
    background: #fbfdfd;
}

#modal-profile .profile-account-detail-icon {
    display: inline-flex;
    flex: 0 0 38px;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 9px;
    background: var(--shell-accent-soft);
    color: var(--shell-accent);
}

#modal-profile .profile-account-detail-icon svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

#modal-profile .profile-account-detail-copy {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

#modal-profile .profile-account-label {
    color: var(--shell-muted);
    font-size: .72rem;
    font-weight: 600;
}

#modal-profile .profile-account-value {
    color: var(--shell-ink);
    font-size: .87rem;
    line-height: 1.4;
    overflow-wrap: anywhere;
}

#modal-profile .profile-account-password {
    font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
    letter-spacing: .04em;
}

#modal-profile .profile-account-password-toggle {
    display: inline-flex;
    flex: 0 0 36px;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    border: 1px solid var(--shell-line);
    border-radius: 8px;
    background: #ffffff;
    color: #526970;
    cursor: pointer;
}

#modal-profile .profile-account-password-toggle:hover,
#modal-profile .profile-account-password-toggle:focus-visible {
    border-color: rgba(22, 129, 132, .35);
    background: var(--shell-accent-soft);
    color: var(--shell-accent);
    outline: none;
}

#modal-profile .profile-account-password-toggle svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

#modal-profile .profile-account-eye-hide,
#modal-profile .profile-account-password-toggle[aria-pressed="true"] .profile-account-eye-show {
    display: none;
}

#modal-profile .profile-account-password-toggle[aria-pressed="true"] .profile-account-eye-hide {
    display: block;
}

#modal-profile .profile-account-footer {
    display: flex;
    justify-content: center;
    padding: 0 20px 20px;
}

#modal-profile .profile-account-logout {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 42px;
    padding: 0 16px;
    border: 1px solid #d9555d;
    border-radius: 9px;
    background: #d9555d;
    color: #ffffff;
    font-size: .82rem;
    font-weight: 600;
    text-decoration: none;
    transition: background-color .16s ease, border-color .16s ease;
}

#modal-profile .profile-account-logout:hover,
#modal-profile .profile-account-logout:focus-visible {
    border-color: #bd3d47;
    background: #bd3d47;
    color: #ffffff;
    outline: none;
}

#modal-profile .profile-account-logout svg {
    width: 17px;
    height: 17px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

@media (max-width: 480px) {
    #modal-profile .profile-account-dialog {
        width: calc(100vw - 20px);
        margin: 10px auto;
    }

    #modal-profile .profile-account-header {
        padding: 26px 18px 20px;
    }

    #modal-profile .profile-account-body {
        padding: 14px;
    }

    #modal-profile .profile-account-footer {
        padding: 0 14px 16px;
    }

    #modal-profile .profile-account-logout {
        width: 100%;
    }
}

@media (max-width: 767.98px) {
    .layout:has(.messenger-shell) {
        position: relative;
        overflow: hidden;
    }

    .layout:has(.messenger-shell) .sidebar {
        flex: 1 1 auto;
        min-height: 0;
        border-right: 0;
        border-bottom: 0;
    }

    .layout:has(.messenger-shell) > main.main {
        position: absolute !important;
        inset: 0 !important;
        z-index: 20;
        width: 100% !important;
        height: 100% !important;
        min-height: 0 !important;
        flex: 0 0 auto !important;
        overflow: hidden;
        background: var(--messenger-canvas);
        visibility: hidden !important;
        transform: translateX(100%) !important;
        transition: transform .22s ease, visibility 0s linear .22s !important;
    }

    .layout:has(.messenger-shell) > main.main.is-visible {
        visibility: visible !important;
        transform: translateX(0) !important;
        transition: transform .22s ease !important;
    }

    .layout:has(.messenger-shell) > main.main > .container {
        width: 100%;
        max-width: none;
        padding: 0 !important;
    }

    .messenger-shell {
        height: 100%;
        min-height: 0;
    }

    .chat-header {
        padding: 8px !important;
    }

    .chat-header-inner {
        gap: 6px;
    }

    .chat-profile {
        flex: 1 1 auto;
        gap: 8px;
    }

    .mobile-chat-back {
        display: inline-flex;
        flex: 0 0 36px;
        align-items: center;
        justify-content: center;
        width: 36px;
        height: 40px;
        padding: 0;
        border: 0;
        border-radius: 50%;
        background: transparent;
        color: #167c80;
        cursor: pointer;
    }

    .mobile-chat-back svg {
        width: 23px;
        height: 23px;
        fill: none;
        stroke: currentColor;
        stroke-width: 2;
        stroke-linecap: round;
        stroke-linejoin: round;
    }

    .chat-profile-img {
        flex: 0 0 36px;
        width: 36px;
        height: 36px;
    }

    .chat-name-number {
        flex: 1 1 auto;
    }

    .chat-name-number__title h5 {
        overflow: hidden;
        font-size: .9rem;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .chat-name-number__meta p {
        display: none;
    }

    .chat-actions {
        gap: 0;
    }

    .chat-actions .header-action-btn {
        width: 36px;
        height: 38px;
    }

    .chat-header__search.is-open {
        position: absolute;
        right: 8px;
        bottom: 8px;
        left: 8px;
        z-index: 4;
        width: auto;
        max-width: none;
        height: 40px;
        background: #ffffff;
    }

    .chat-header:has(.chat-header__search.is-open) {
        padding-bottom: 56px !important;
    }

    .chat-header:has(.chat-header__search.is-open) .chat-actions {
        position: static;
    }

    .chat-header__search.is-open .chat-header__search-input {
        width: auto;
    }

    .chat-search-navigation {
        top: 52px;
        right: 8px;
    }

    .messenger-shell:has(.chat-header__search.is-open) .chat-search-navigation {
        top: 108px;
    }

    .chat-main {
        flex: 1 1 auto;
        min-height: 0;
    }

        .messenger-shell .chat-body-inner {
        padding: 10px 21px 12px !important;
    }

    .chat-message__inner {
        max-width: 94%;
        min-width: 0;
    }

    .chat-message__type,
    .chat-message__media,
    .chat-message__file,
    .chat-message__template,
    .chat-message__text {
        max-width: min(84vw, 400px);
    }

    .chat-message__bubble {
        max-width: min(84vw, 400px);
        font-size: .88rem;
    }

    .chat-message__img,
    .chat-message__video {
        max-width: min(78vw, 320px);
    }

    .chat-message__audio {
        max-width: 78vw;
    }

    .chat-footer {
        padding: 0 7px calc(7px + env(safe-area-inset-bottom)) !important;
    }

    .messenger-shell .chat-footer form.chat-form[data-emoji-form] {
        padding: 4px 5px;
    }

    .chat-form-inner {
        gap: 3px;
    }

    .chat-attach-toggle,
    .messenger-shell .chat-form .btn-icon,
    .chat-send-actions button {
        width: 38px;
        height: 38px;
    }

    .messenger-shell .chat-footer .chat-input-wrap input {
        min-height: 40px;
        font-size: 16px;
    }
}

@media (max-width: 767.98px) {
    .layout {
        padding-bottom: calc(68px + env(safe-area-inset-bottom));
    }

    #tab-content-chats .user-sidebar-main,
    #tab-content-chats .user-sidebar-main > .hide-scrollbar,
    #tab-content-chats .user-sidebar-main > .hide-scrollbar > .container,
    #chat-table_wrapper,
    #chat-table {
        width: 100% !important;
        max-width: 100% !important;
    }

    #chat-table {
        table-layout: fixed;
    }

    #chat-table tbody,
    #chat-table tbody tr,
    #chat-table tbody td {
        width: 100% !important;
    }

    #chat-table tbody tr td > a.card,
    #chat-table tbody tr td > a.card .card-body {
        width: 100% !important;
    }

    #chat-table tbody tr td > a.card .card-body {
        margin-right: 0 !important;
    }

    .layout:has(.welcome-empty-state) > .sidebar {
        flex: 1 1 auto;
        min-height: 0;
        height: auto;
        border-bottom: 0;
    }

    .layout:has(.welcome-empty-state) > main.main {
        display: none !important;
    }

    .layout:has(.messenger-shell) > main.main {
        bottom: calc(68px + env(safe-area-inset-bottom)) !important;
        height: auto !important;
    }

    .layout:has(.messenger-shell) > main.main.is-visible .chat-footer {
        padding-bottom: 7px !important;
    }

    .navigation {
        position: fixed !important;
        top: auto !important;
        right: 0;
        bottom: 0;
        left: 0;
        z-index: 1000;
        display: flex !important;
        flex: 0 0 auto !important;
        align-items: stretch !important;
        width: 100%;
        height: calc(68px + env(safe-area-inset-bottom));
        min-height: 0;
        padding: 5px 8px calc(5px + env(safe-area-inset-bottom)) !important;
        border-top: 1px solid rgba(181, 200, 202, .2);
        background: #13323b !important;
        box-sizing: border-box;
    }

    .navigation-header,
    .navigation-footer {
        display: none !important;
    }

    .navigation-main {
        display: flex;
        flex: 1 1 auto;
        align-items: stretch;
        width: 100%;
        min-width: 0;
        min-height: 0;
        overflow: visible;
    }

    .navigation-main > .navbar-nav {
        position: static !important;
        display: flex !important;
        flex: 1 1 auto !important;
        flex-direction: row !important;
        align-items: stretch !important;
        justify-content: space-around !important;
        width: 100% !important;
        height: 100% !important;
        min-height: 0 !important;
        margin: 0 !important;
        padding: 0 !important;
        overflow: visible !important;
    }

    .navigation-main > .navbar-nav > .nav-item {
        display: block !important;
        flex: 1 1 0 !important;
        width: auto !important;
        height: 100%;
        min-height: 0 !important;
        margin: 0 !important;
        position: static !important;
        background: transparent !important;
    }

    .navigation-main > .navbar-nav > .nav-item:nth-child(n+5) {
        display: none !important;
    }

    .navigation.has-mobile-nav-more .navigation-main > .navbar-nav {
        flex: 0 0 calc(100% - 52px) !important;
        width: calc(100% - 52px) !important;
    }

    .navigation .mobile-nav-more-toggle[hidden],
    .navigation .mobile-nav-more-menu[hidden] {
        display: none !important;
    }

    .navigation .mobile-nav-more-toggle {
        position: absolute;
        right: 8px;
        bottom: calc(5px + env(safe-area-inset-bottom));
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 2px;
        width: 46px;
        height: 58px;
        padding: 0;
        border: 0;
        border-radius: 9px;
        background: transparent;
        color: #b5c8ca;
        cursor: pointer;
    }

    .navigation .mobile-nav-more-toggle:hover,
    .navigation .mobile-nav-more-toggle:focus-visible,
    .navigation.is-mobile-nav-expanded .mobile-nav-more-toggle {
        background: rgba(121, 199, 174, .16);
        color: #8ad5bd;
        outline: none;
    }

    .mobile-nav-more-toggle svg {
        width: 18px;
        height: 18px;
        fill: none;
        stroke: currentColor;
        stroke-width: 2;
        stroke-linecap: round;
        stroke-linejoin: round;
        transition: transform .18s ease;
    }

    .navigation .mobile-nav-more-toggle::after {
        content: "More";
        color: inherit;
        font-size: 9px;
        font-weight: 500;
        line-height: 1.1;
    }

    .navigation.is-mobile-nav-expanded .mobile-nav-more-toggle svg {
        transform: rotate(180deg);
    }

    .navigation .mobile-nav-more-menu {
        position: fixed;
        right: 8px;
        bottom: calc(68px + env(safe-area-inset-bottom) + 8px);
        z-index: 1002;
        display: none;
        flex-direction: column;
        width: min(220px, calc(100vw - 16px));
        max-height: min(60dvh, 360px);
        padding: 5px;
        overflow-x: hidden;
        overflow-y: auto;
        border: 1px solid rgba(181, 200, 202, .22);
        border-radius: 12px;
        background: #13323b;
        box-shadow: 0 10px 28px rgba(13, 31, 36, .28);
        scrollbar-width: thin;
    }

    .navigation.is-mobile-nav-expanded .mobile-nav-more-menu {
        display: flex;
    }

    .mobile-nav-more-menu > .nav-item {
        display: block !important;
        flex: 0 0 44px !important;
        width: 100% !important;
        height: 44px;
        min-height: 44px !important;
        margin: 0 !important;
        position: static !important;
        background: transparent !important;
    }

    .mobile-nav-more-menu .nav-link {
        display: flex !important;
        align-items: center;
        justify-content: flex-start;
        gap: 12px;
        width: 100% !important;
        height: 44px !important;
        margin: 0 !important;
        padding: 0 10px !important;
        border-radius: 8px;
    }

    .mobile-nav-more-menu .nav-link::after {
        display: block;
        flex: 1 1 auto;
        min-width: 0;
        content: attr(data-mobile-label);
        overflow: hidden;
        color: inherit;
        font-size: .76rem;
        line-height: 1.2;
        text-align: left;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .mobile-nav-more-menu .nav-link svg {
        width: 21px;
        height: 21px;
    }

    .navigation-main .nav-link {
        display: flex !important;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 3px;
        width: 100% !important;
        height: 100% !important;
        margin: 0 !important;
        padding: 4px 2px !important;
        border-radius: 9px;
        color: #b5c8ca !important;
        text-decoration: none;
    }

    .navigation-main .nav-link::after {
        content: attr(data-mobile-label);
        max-width: 100%;
        overflow: hidden;
        font-size: 9px;
        font-weight: 500;
        line-height: 1.1;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .navigation-main .nav-link svg {
        width: 20px;
        height: 20px;
    }

    .navigation-main .nav-link:hover,
    .navigation-main .nav-link:focus-visible,
    .navigation-main .nav-link.active {
        background: rgba(121, 199, 174, .16);
        color: #8ad5bd !important;
        outline: none;
    }
}

@media (max-width: 767.98px) {
    #myModal.modal.show {
                display: flex !important;
        align-items: center;
        justify-content: center;
        padding: 12px;
        overflow-x: hidden;
        overflow-y: auto;
    }

    #myModal .modal-dialog {
        width: calc(100vw - 24px);
        max-width: 500px;
        margin: auto;
    }

    #myModal .modal-content {
        width: 100%;
        height: auto;
        min-height: 0;
        max-height: calc(100dvh - 24px);
        overflow-x: hidden;
        overflow-y: auto;
    }

    #myModal .modal-content:has(.chat-modal-shell) {
        overflow: hidden;
    }

     #myModal .modal-content > .chat-modal-shell {
        flex: 0 1 auto;
        width: 100%;
        height: auto;
        min-height: 0;
        max-height: calc(100dvh - 24px);
    }
}

@media (max-width: 767.98px) {
    .layout:not(:has(.messenger-shell)):not(:has(.welcome-empty-state)) > .sidebar {
        display: none !important;
    }

    .layout:not(:has(.messenger-shell)):not(:has(.welcome-empty-state)) > main.main {
        flex: 1 1 auto;
        width: 100%;
        height: auto !important;
        min-height: 0;
    }
}

.mobile-chat-home-item,
.mobile-page-back {
    display: none !important;
}

@media (max-width: 767.98px) {
    .navigation-main .mobile-chat-home-item {
        display: flex !important;
    }

    .mobile-page-back {
        display: inline-flex !important;
        flex: 0 0 38px;
        align-items: center;
        justify-content: center;
        width: 38px;
        height: 38px;
        border: 1px solid var(--shell-line);
        border-radius: 10px;
        background: #ffffff;
        color: var(--shell-ink);
        text-decoration: none;
    }

    .mobile-page-back:active,
    .mobile-page-back:focus-visible {
        border-color: var(--shell-accent);
        background: var(--shell-accent-soft);
        color: var(--shell-accent);
        outline: none;
    }

    .mobile-page-back svg {
        width: 19px;
        height: 19px;
    }

    .management-page-header.has-mobile-page-back {
        display: grid;
        grid-template-columns: 38px minmax(0, 1fr);
        align-items: start;
        justify-content: initial;
        gap: 8px 10px;
    }

    .management-page-header.has-mobile-page-back > .mobile-page-back {
        grid-column: 1;
        grid-row: 1;
    }

    .management-page-header.has-mobile-page-back > .management-page-heading {
        grid-column: 2;
        grid-row: 1;
        min-width: 0;
    }

    .management-page-header.has-mobile-page-back > :not(.mobile-page-back):not(.management-page-heading) {
        grid-column: 2;
        grid-row: 2;
        justify-self: start;
    }

    #content__inner .bulk-container > .bulk-header.has-mobile-page-back {
        align-items: center;
        justify-content: flex-start;
        flex-wrap: wrap;
        gap: 10px;
    }

    #content__inner .bulk-container > .bulk-header.has-mobile-page-back h3 {
        flex: 1 1 0;
        min-width: 0;
        font-size: 1.08rem;
    }

    #content__inner .bulk-container > .bulk-header.has-mobile-page-back .header-buttons {
        flex: 1 1 100%;
        width: 100%;
        justify-content: flex-start;
        flex-wrap: wrap;
        gap: 8px;
    }

    .template-page-header > .template-header.has-mobile-page-back {
        align-items: flex-start;
        justify-content: flex-start;
        flex-wrap: wrap;
        gap: 10px;
    }

    .template-page-header > .template-header.has-mobile-page-back > .template-header-left {
        flex: 1 1 0;
        min-width: 0;
    }

    .template-page-header > .template-header.has-mobile-page-back > .template-header-actions {
        flex: 1 1 100%;
        width: 100%;
        flex-wrap: wrap;
    }
}
