html,
body {
    min-height: 100%;
}

body {
    margin: 0;
    background: #eef1f2;
    color: #1f2c33;
    font-size: 14px;
    overflow: hidden;
}

.via-app {
    display: grid;
    grid-template-columns: 64px 1fr;
    height: 100vh;
    overflow: hidden;
}

.via-nav {
    background: linear-gradient(180deg, #06151a 0%, #0a1d24 55%, #07161c 100%);
    color: #e8eef1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 16px 0 12px;
    gap: 16px;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow: visible;
    z-index: 300;
    box-shadow: inset -1px 0 0 rgba(255, 255, 255, 0.06);
}

.via-brand {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background: linear-gradient(135deg, #12b981 0%, #078669 100%);
    color: #fff;
    display: grid;
    place-items: center;
    font-weight: 700;
    font-size: 13px;
    letter-spacing: 0;
    text-decoration: none;
    box-shadow: 0 10px 22px rgba(0, 168, 132, 0.25);
}

.via-nav nav {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    width: 100%;
    min-height: 0;
    flex: 1 1 auto;
    position: relative;
    padding: 8px 0;
    overflow-y: visible;
    overflow-x: visible;
    scroll-behavior: auto;
    scrollbar-width: none;
    overscroll-behavior: contain;
}

.via-nav nav::-webkit-scrollbar {
    display: none;
}

.via-nav nav::before,
.via-nav nav::after {
    content: none;
    position: absolute;
    left: 0;
    right: 0;
    height: 24px;
    pointer-events: none;
    z-index: 2;
}

.via-nav nav::before {
    top: 0;
    background: linear-gradient(180deg, rgba(6, 21, 26, 0.96) 0%, rgba(6, 21, 26, 0) 100%);
}

.via-nav nav::after {
    bottom: 0;
    background: linear-gradient(0deg, rgba(6, 21, 26, 0.96) 0%, rgba(6, 21, 26, 0) 100%);
}

.via-nav-groups {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    position: relative;
}

.via-nav-group {
    position: relative;
    width: 100%;
    display: flex;
    justify-content: center;
}

.via-nav-group-toggle,
.via-nav-link-bottom {
    width: 48px;
    height: 48px;
    color: #e5edf0;
    display: grid;
    place-items: center;
    text-decoration: none;
    border-radius: 12px;
    background: transparent;
    border: 0;
    cursor: pointer;
    transition: background-color 0.16s ease, color 0.16s ease, transform 0.16s ease, box-shadow 0.16s ease;
}

.via-nav-group-toggle svg,
.via-nav-link-bottom svg {
    width: 22px;
    height: 22px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.9;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.via-nav-group-toggle:hover,
.via-nav-group-toggle:focus-visible,
.via-nav-link-bottom:hover,
.via-nav-link-bottom:focus-visible {
    background: #1f333b;
    color: #ffffff;
    transform: translateX(1px);
    box-shadow: inset 0 0 0 1px rgba(229, 237, 240, 0.08), 0 10px 22px rgba(0, 0, 0, 0.18);
    outline: 0;
}

.via-nav-group.active > .via-nav-group-toggle,
.via-nav-group-link.active {
    background: #152a33;
    color: #ffffff;
}

.via-nav-group-panel {
    position: absolute;
    left: 100%;
    top: 50%;
    transform: translateY(-50%) translateX(14px);
    min-width: 220px;
    max-width: 280px;
    background: rgba(10, 18, 24, 0.98);
    border-radius: 20px;
    padding: 14px;
    box-shadow: 0 26px 42px rgba(0, 0, 0, 0.22);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s ease;
    z-index: 500;
}

.via-nav-group:hover .via-nav-group-panel,
.via-nav-group.active .via-nav-group-panel,
.via-nav-group.open .via-nav-group-panel {
    opacity: 1;
    visibility: visible;
    transform: translateY(-50%) translateX(0);
    pointer-events: auto;
}

.via-nav-group-title {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #d1d9e1;
    margin-bottom: 10px;
}

.via-nav-group-link {
    display: grid;
    grid-template-columns: 28px 1fr;
    gap: 10px;
    align-items: center;
    padding: 10px 12px;
    border-radius: 12px;
    color: #e5edf0;
    text-decoration: none;
    transition: background-color 0.16s ease, color 0.16s ease;
    margin-bottom: 6px;
}

.via-nav-group-link:last-child {
    margin-bottom: 0;
}

.via-nav-group-link:hover,
.via-nav-group-link.active {
    background: rgba(255, 255, 255, 0.06);
    color: #ffffff;
}

.via-nav-group-link-icon {
    width: 28px;
    height: 28px;
    display: grid;
    place-items: center;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.04);
}

.via-nav-group-link-icon svg {
    width: 18px;
    height: 18px;
}

.via-nav-divider {
    width: 100%;
    height: 1px;
    margin: 10px 0;
    background: rgba(229, 237, 240, 0.06);
}

@media (max-width: 991.98px) {
    .via-nav {
        position: sticky;
        top: 0;
        height: auto;
        padding: 12px 0;
    }
    .via-app {
        grid-template-columns: 64px 1fr;
        height: auto;
    }
    .via-nav-group-panel {
        left: 100%;
        top: 0;
        transform: translateY(0) translateX(14px);
        max-width: 280px;
        width: min(92vw, 280px);
        border-radius: 24px;
        padding: 16px;
    }
}

.via-nav a {
    position: relative;
}

.via-nav a:not(.via-brand) {
    width: 48px;
    height: 48px;
    color: #e5edf0;
    display: grid;
    place-items: center;
    text-decoration: none;
    border-radius: 12px;
    transition: background-color 0.16s ease, color 0.16s ease, transform 0.16s ease, box-shadow 0.16s ease;
}

.via-nav a:not(.via-brand) svg {
    width: 22px;
    height: 22px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.9;
    stroke-linecap: round;
    stroke-linejoin: round;
    transition: transform 0.16s ease;
}

.via-nav a.active,
.via-nav a:not(.via-brand):hover,
.via-nav a:not(.via-brand):focus-visible {
    background: #1f333b;
    color: #ffffff;
    box-shadow: inset 0 0 0 1px rgba(229, 237, 240, 0.08), 0 10px 22px rgba(0, 0, 0, 0.2);
    outline: 0;
}

.via-nav a:not(.via-brand):hover,
.via-nav a:not(.via-brand):focus-visible {
    transform: translateX(1px);
}

.via-nav a:not(.via-brand):hover svg,
.via-nav a:not(.via-brand):focus-visible svg {
    transform: scale(1.04);
}

.via-nav a[data-tooltip]::after,
.via-nav a[data-tooltip]::before,
.via-nav-group-toggle[data-tooltip]::after,
.via-nav-group-toggle[data-tooltip]::before {
    opacity: 0;
    pointer-events: none;
    position: absolute;
    transition: opacity 0.14s ease, transform 0.14s ease;
    z-index: 500;
}

.via-nav a[data-tooltip]::after,
.via-nav-group-toggle[data-tooltip]::after {
    content: attr(data-tooltip);
    left: calc(100% + 12px);
    top: 50%;
    transform: translateY(-50%) translateX(-4px);
    background: #1f2937;
    color: #fff;
    border-radius: 6px;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.22);
    font-size: 12px;
    font-weight: 600;
    line-height: 1;
    padding: 8px 10px;
    white-space: nowrap;
}

.via-nav a[data-tooltip]::before,
.via-nav-group-toggle[data-tooltip]::before {
    content: "";
    left: calc(100% + 6px);
    top: 50%;
    transform: translateY(-50%) translateX(-4px);
    border: 6px solid transparent;
    border-right-color: #1f2937;
}

.via-nav a[data-tooltip]:hover::after,
.via-nav a[data-tooltip]:hover::before,
.via-nav a[data-tooltip]:focus-visible::after,
.via-nav a[data-tooltip]:focus-visible::before,
.via-nav-group-toggle[data-tooltip]:hover::after,
.via-nav-group-toggle[data-tooltip]:hover::before,
.via-nav-group-toggle[data-tooltip]:focus-visible::after,
.via-nav-group-toggle[data-tooltip]:focus-visible::before {
    opacity: 1;
    transform: translateY(-50%) translateX(0);
}

.via-main {
    min-width: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(84, 101, 111, 0.28) transparent;
}

.via-main::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.via-main::-webkit-scrollbar-track {
    background: transparent;
}

.via-main::-webkit-scrollbar-thumb {
    background: rgba(84, 101, 111, 0.22);
    border-radius: 999px;
}

.via-topbar {
    position: sticky;
    top: 0;
    z-index: 250;
    height: 48px;
    min-height: 48px;
    background: #f0f2f5;
    border-bottom: 1px solid #d9dee2;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 18px;
}

.chat-shell {
    flex: 0 0 auto;
    height: calc(100vh - 48px);
    min-height: 0;
    display: grid;
    grid-template-columns: 360px 1fr;
    overflow: hidden;
}

.chat-list-panel,
.template-list {
    min-width: 0;
    background: #fff;
    border-right: 1px solid #d9dee2;
    display: grid;
    grid-template-rows: auto auto 1fr;
    overflow: hidden;
}

.panel-head {
    padding: 14px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.panel-head-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.panel-head h1,
.simple-page h1,
.logs-page h1 {
    font-size: 20px;
    margin: 0;
}

.panel-head span,
.editor-head span {
    font-size: 12px;
    color: #667781;
}

.search-box {
    padding: 0 12px 12px;
}

.conversation-list,
.template-items {
    min-height: 0;
    overflow-y: auto;
}

.conversation-item,
.template-item {
    width: 100%;
    border: 0;
    background: #fff;
    padding: 12px 16px 12px 42px;
    text-align: left;
    border-top: 1px solid #f0f2f5;
    display: grid;
    gap: 3px;
    cursor: pointer;
    position: relative;
}

.template-item {
    padding: 12px 16px;
}

.conversation-item-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
}

.conversation-item-head strong {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.conversation-item-head time {
    flex: 0 0 auto;
    color: #667781;
    font-size: 11px;
    line-height: 17px;
    text-align: right;
}

.template-item-wrap {
    border-top: 1px solid #f0f2f5;
}

.template-item-wrap .template-item {
    border-top: 0;
}

.template-item-wrap .submit-meta-btn {
    margin: 0 16px 12px;
}

.conversation-item:hover,
.conversation-item.active,
.template-item:hover {
    background: #f0f2f5;
}

.conversation-item.batch-selected {
    background: #e7f7f2;
    box-shadow: inset 3px 0 0 #00a884;
}

.conversation-item.active.batch-selected {
    background: #d9fdd3;
}

.conversation-item.has-new-message {
    box-shadow: inset 4px 0 0 #00a884;
    background: #eefaf6;
}

.conversation-select-check {
    position: absolute;
    left: 14px;
    top: 16px;
    width: 16px;
    height: 16px;
    accent-color: #00a884;
}

.batch-actions-bar {
    margin-top: 8px;
    padding: 9px;
    border: 1px solid #cfe7df;
    border-radius: 8px;
    background: #eefaf6;
    display: grid;
    gap: 8px;
}

.batch-actions-bar strong {
    color: #0b6b52;
    font-size: 12px;
}

.batch-actions-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.batch-actions-buttons .btn {
    font-size: 11px;
    padding: 2px 7px;
}

.conversation-item strong,
.template-item strong {
    font-size: 14px;
}

.conversation-item span,
.conversation-item small,
.template-item span {
    color: #667781;
    font-size: 12px;
}

.conversation-item .conversation-assignee {
    width: fit-content;
    margin-top: 3px;
    padding: 2px 7px;
    border-radius: 999px;
    background: #fff3cd;
    color: #8a6d1d;
    font-weight: 600;
}

.conversation-item .conversation-assignee.active {
    background: #d9fdd3;
    color: #0b6b52;
}

.conversation-item .conversation-channel {
    width: fit-content;
    margin-top: 4px;
    padding: 2px 7px;
    border-radius: 999px;
    background: #eef6f3;
    color: #24735b;
    font-size: 11px;
    font-weight: 700;
}

.conversation-badge {
    flex: 0 0 auto;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: 999px;
    background: #00a884;
    color: #fff;
    display: inline-grid;
    place-items: center;
    font-size: 11px;
    font-weight: 700;
    line-height: 20px;
}

.conversation-preview {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.chat-window {
    min-width: 0;
    height: 100%;
    background: #efeae2;
    position: relative;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.chat-empty {
    height: 100%;
    display: grid;
    place-items: center;
    color: #667781;
}

.chat-content {
    height: 100%;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
}

.chat-header {
    min-height: 72px;
    background: #f0f2f5;
    border-bottom: 1px solid #d9dee2;
    padding: 10px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.sandbox-badge {
    display: inline-block;
    margin-top: 8px;
    padding: 4px 8px;
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffecb5;
    border-radius: 999px;
    font-size: 11px;
}

.chat-header span {
    display: block;
    color: #667781;
    font-size: 12px;
}

.chat-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 4px;
}

.protocol-badge {
    max-width: 230px;
    padding: 4px 9px;
    border-radius: 999px;
    background: #e7f7f2;
    color: #0b6b52;
    border: 1px solid #b7e4d5;
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.protocol-badge.closed {
    background: #f3f4f6;
    border-color: #d1d5db;
    color: #4b5563;
}

.via-admin-scroll {
    height: calc(100vh - 48px);
    overflow: auto;
}

.chat-close-btn {
    width: 28px;
    height: 28px;
    border: 1px solid transparent;
    border-radius: 8px;
    background: transparent;
    color: #667781;
    display: grid;
    place-items: center;
    padding: 0;
    font-size: 22px;
    line-height: 1;
}

.chat-close-btn:hover,
.chat-close-btn:focus-visible {
    background: #ffffff;
    border-color: #d9dee2;
    color: #111b21;
    outline: 0;
}

.chat-action-buttons {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.attendance-actions-panel {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    width: 56px;
    z-index: 90;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 8px 0;
    background: #f3f4f6;
    border-right: 1px solid #e5e7eb;
}

.chat-content > .chat-header,
.chat-content > .wa-chat-body,
.chat-content > .chat-composer-area {
    margin-left: 72px;
}

.action-icon-btn {
    width: 40px;
    height: 40px;
    border: 1px solid transparent;
    border-radius: 8px;
    background: transparent;
    color: #1f2937;
    display: grid;
    place-items: center;
    padding: 0;
    position: relative;
}

.action-icon-btn svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.action-icon-btn:hover,
.action-icon-btn:focus-visible {
    background: #ffffff;
    border-color: #99f6e4;
    color: #10b981;
    outline: 0;
}

.action-icon-btn:disabled {
    color: #9ca3af;
    cursor: not-allowed;
    opacity: .55;
}

.action-icon-btn::after {
    content: attr(data-tooltip);
    position: absolute;
    left: calc(100% + 10px);
    top: 50%;
    transform: translateY(-50%) translateX(-4px);
    min-width: max-content;
    max-width: 220px;
    padding: 7px 9px;
    border-radius: 6px;
    background: #1f2937;
    color: #fff;
    font-size: 12px;
    line-height: 1.2;
    box-shadow: 0 6px 14px rgba(11, 20, 26, .18);
    opacity: 0;
    pointer-events: none;
    transition: opacity .12s ease .12s, transform .12s ease .12s;
    z-index: 150;
}

.action-icon-btn::before {
    content: "";
    position: absolute;
    left: calc(100% + 4px);
    top: 50%;
    transform: translateY(-50%);
    border: 6px solid transparent;
    border-right-color: #1f2937;
    opacity: 0;
    pointer-events: none;
    transition: opacity .12s ease .12s;
    z-index: 151;
}

.action-icon-btn:hover::after,
.action-icon-btn:hover::before,
.action-icon-btn:focus-visible::after,
.action-icon-btn:focus-visible::before {
    opacity: 1;
}

.action-icon-btn:hover::after,
.action-icon-btn:focus-visible::after {
    transform: translateY(-50%) translateX(0);
}

.actions-panel-selected {
    display: none;
}

.chat-content.is-batch-mode .attendance-actions-panel {
    background: #ecfdf5;
    border-right-color: #99f6e4;
}

.batch-actions-bar {
    margin-top: 10px;
    padding: 10px 12px;
    border: 1px solid #b7e4d5;
    border-radius: 8px;
    background: #ecfdf5;
    color: #075e54;
}

.batch-actions-bar strong,
.batch-actions-bar small {
    display: block;
}

.batch-actions-bar small {
    margin-top: 2px;
    color: #24735b;
    font-size: 11px;
}

@media (max-width: 991.98px) {
    .attendance-actions-panel {
        top: auto;
        bottom: 78px;
        left: 16px;
        right: auto;
        width: auto;
        height: 56px;
        max-width: calc(100% - 32px);
        align-items: center;
        justify-content: flex-start;
        padding: 0 8px;
        border-right: 0;
        border: 1px solid #e5e7eb;
        border-radius: 8px;
        box-shadow: 0 4px 14px rgba(11, 20, 26, .12);
        overflow-x: auto;
        overflow-y: visible;
    }

    .chat-content > .chat-header,
    .chat-content > .wa-chat-body,
    .chat-content > .chat-composer-area {
        margin-left: 0;
    }

    .chat-action-buttons {
        flex-direction: row;
        gap: 6px;
    }

    .action-icon-btn {
        flex: 0 0 40px;
    }

    .action-icon-btn::after {
        left: 50%;
        top: auto;
        bottom: calc(100% + 10px);
        transform: translateX(-50%) translateY(4px);
    }

    .action-icon-btn::before {
        left: 50%;
        top: auto;
        bottom: calc(100% + 4px);
        transform: translateX(-50%);
        border-color: transparent;
        border-top-color: #1f2937;
    }

    .action-icon-btn:hover::after,
    .action-icon-btn:focus-visible::after {
        transform: translateX(-50%) translateY(0);
    }
}

.conversation-event {
    display: flex;
    justify-content: center;
    margin: 8px 0;
}

.conversation-event span {
    background: rgba(255, 255, 255, .75);
    color: #667781;
    border-radius: 999px;
    padding: 4px 10px;
    font-size: 11px;
}

/* CHAT PADRÃO WHATSAPP */

.wa-chat-body {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
    background: #efeae2;
    padding: 16px 24px 24px;
    overflow-y: auto;
    overflow-x: hidden;
}

.wa-date-separator {
    display: table;
    margin: 12px auto;
    padding: 6px 12px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.9);
    color: #667781;
    font-size: 12px;
    font-weight: 600;
    box-shadow: 0 1px 1px rgba(0, 0, 0, 0.08);
}

.new-messages-notice {
    position: absolute;
    right: 24px;
    bottom: 82px;
    z-index: 120;
    border: 0;
    border-radius: 999px;
    background: #00a884;
    color: #fff;
    padding: 7px 14px;
    font-size: 12px;
    font-weight: 700;
    box-shadow: 0 2px 8px rgba(11, 20, 26, .18);
}

.new-messages-notice.d-none {
    display: none;
}

.wa-msg-row {
    width: 100%;
    display: flex;
    align-items: flex-end;
    margin: 1px 0; /* Espaçamento entre balões reduzido */
}

.wa-bubble {
    display: inline-flex;
    flex-direction: column;
    width: auto;
    min-width: 80px; /* Garantir espaço para meta e ícone */
    max-width: 72%;
    padding: 6px 7px 3px 9px; /* Padding ajustado para compactar */
    border-radius: 7.5px;
    box-shadow: 0 1px 0.5px rgba(11, 20, 26, .13);
    font-size: 14.2px;
    line-height: 19px;
    color: #111b21;
    overflow-wrap: anywhere;
    word-break: break-word;
    white-space: normal;
    position: relative;
}

.wa-author {
    font-size: 12.5px;
    line-height: 15px;
    font-weight: 700;
    color: #075e54;
    margin-bottom: 2px;
}

.wa-meta {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 3px;
    margin-top: -4px; /* Sobe a hora para colar no texto se houver espaço */
    font-size: 11px;
    line-height: 15px;
    color: #667781;
    text-align: right;
    user-select: none;
    pointer-events: none;
}

.wa-checks {
    display: inline-block;
    min-width: 16px;
    margin-left: 1px;
    font-size: 13px;
    line-height: 13px;
    letter-spacing: 0;
    color: #8696a0;
    transform: translateY(1px);
}

.wa-checks.pending {
    letter-spacing: 0;
}

.wa-checks.read {
    color: #00a884;
}

.wa-content {
    display: block;
    margin: 0;
    padding: 0;
}

.wa-text {
    display: inline; /* Importante para a hora subir na mesma linha se houver espaço */
}

.wa-media-img {
    display: block;
    width: auto;
    max-width: 260px;
    max-height: 260px;
    border-radius: 8px;
    object-fit: cover;
    margin-bottom: 6px;
}

.wa-msg-image {
    display: block;
    max-width: 260px;
    max-height: 320px;
    width: auto;
    height: auto;
    border-radius: 8px;
    object-fit: cover;
    cursor: pointer;
    margin-bottom: 6px;
}

.wa-media-video {
    display: block;
    width: 280px;
    max-width: 100%;
    border-radius: 8px;
    margin-bottom: 6px;
}

.wa-audio-message {
    width: min(320px, 70vw);
    display: grid;
    gap: 4px;
}

.wa-audio-message audio {
    width: 100%;
    height: 38px;
}

.wa-audio-message span,
.audio-preview-card span {
    color: #667781;
    font-size: 11px;
}

.wa-audio-download {
    color: #0b7a75;
    font-size: 11px;
    text-decoration: none;
    width: fit-content;
}

.wa-audio-download:hover {
    text-decoration: underline;
}

.audio-preview-card {
    display: grid;
    gap: 8px;
    padding: 12px;
    border-radius: 10px;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
}

.audio-preview-card audio {
    width: 100%;
}

.document-preview-card {
    display: flex;
    align-items: center;
    gap: 12px;
    background: #f8f9fa;
    border-radius: 10px;
    padding: 12px;
    border: 1px solid #dee2e6;
}

.document-preview-icon {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    background: #e9ecef;
    border-radius: 12px;
    font-size: 20px;
}

.wa-doc-link {
    display: block;
    color: #027eb5;
    text-decoration: none;
    font-weight: 600;
}

.wa-unavailable {
    font-size: 13px;
    color: #667781;
    font-style: italic;
}

/* COMPOSER */

.chat-composer-area {
    background: #f0f2f5;
    padding: 10px 16px;
    border-top: 1px solid #d1d7db;
    flex-shrink: 0;
    position: relative;
    z-index: 100;
}

.whatsapp-composer {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #fff;
    border-radius: 24px;
    padding: 2px 12px;
}

.composer-input-wrapper {
    flex: 1;
    display: flex;
    align-items: center;
}

.composer-input {
    width: 100%;
    border: 0;
    padding: 9px 2px;
    font-size: 15px;
    color: #111b21;
    outline: none;
    background: transparent;
}

.btn-icon {
    background: none;
    border: 0;
    padding: 6px;
    color: #54656f;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color .2s;
}

.btn-icon:hover {
    background-color: rgba(0, 0, 0, .05);
}

.send-btn {
    color: #00a884;
}

.audio-record-btn {
    color: #54656f;
    position: relative;
}

.audio-record-btn.recording {
    color: #d93025;
}

.record-dot {
    display: none;
    position: absolute;
    top: 5px;
    right: 5px;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #d93025;
}

.audio-record-btn.recording .record-dot {
    display: block;
}

.audio-recording-bar {
    margin-top: 8px;
    min-height: 42px;
    padding: 7px 10px;
    border-radius: 22px;
    background: #fff;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 1px 2px rgba(11, 20, 26, .08);
}

.audio-recording-bar strong {
    font-variant-numeric: tabular-nums;
    color: #d93025;
}

.audio-recording-bar span:not(.recording-pulse) {
    color: #54656f;
    font-size: 13px;
}

.recording-pulse {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #d93025;
    box-shadow: 0 0 0 0 rgba(217, 48, 37, .45);
    animation: via-recording-pulse 1.2s infinite;
}

@keyframes via-recording-pulse {
    70% { box-shadow: 0 0 0 9px rgba(217, 48, 37, 0); }
    100% { box-shadow: 0 0 0 0 rgba(217, 48, 37, 0); }
}

/* ANEXOS */

.attach-menu {
    position: absolute;
    bottom: 60px;
    left: 16px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 15px rgba(0, 0, 0, .1);
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    z-index: 1000;
}

.attach-item {
    background: none;
    border: 0;
    padding: 8px 12px;
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    text-align: left;
    border-radius: 8px;
    color: #111b21;
    font-size: 14px;
}

.attach-item:hover {
    background: #f5f6f6;
}

.attach-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-size: 16px;
}

.bg-purple {
    background: #bf59cf;
    color: #fff;
}

.bg-blue {
    background: #007bfc;
    color: #fff;
}

.bg-green {
    background: #00a884;
    color: #fff;
}

.bg-red {
    background: #d3396d;
    color: #fff;
}

.whatsapp-media-preview {
    background: #fff;
    border-radius: 8px;
    margin-bottom: 4px;
    padding: 8px;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, .05);
}

.media-preview-box {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* TEMPLATES */

.template-shell,
.logs-page {
    flex: 1;
    min-height: 0;
    display: grid;
    overflow: hidden;
}

.template-shell {
    grid-template-columns: 360px 1fr;
}

.template-editor {
    min-width: 0;
    overflow: auto;
    padding: 18px;
    background: #f7f8fa;
}

.editor-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.editor-head h2 {
    font-size: 20px;
    margin: 0;
}

.template-vars {
    display: grid;
    gap: 8px;
}

.wa-preview {
    min-height: 160px;
    background: #efeae2;
    border: 1px solid #d9dee2;
    border-radius: 8px;
    padding: 18px;
}

.wa-preview .preview-bubble {
    background: #d9fdd3;
    border-radius: 8px;
    padding: 10px;
    max-width: 320px;
    box-shadow: 0 1px 1px rgba(11, 20, 26, .12);
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.preview-header {
    font-weight: 700;
    margin-bottom: 6px;
}

.preview-footer {
    color: #667781;
    font-size: 12px;
    margin-top: 8px;
}

.preview-button {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid rgba(0, 0, 0, .08);
    color: #008069;
    text-align: center;
}

.format-toolbar,
.button-row {
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
}

.composer-row,
.media-row {
    background: #f0f2f5;
    border-top: 1px solid #d9dee2;
    padding: 8px 12px;
    display: flex;
    gap: 8px;
}

.media-row {
    border-top: 0;
    padding-top: 6px;
}

.status {
    width: fit-content;
    padding: 2px 7px;
    border-radius: 999px;
    font-style: normal;
    font-size: 11px;
    background: #e9edef;
    color: #54656f;
}

.status-aprovado {
    background: #d9fdd3;
    color: #0b6b52;
}

.status-rejeitado,
.status-falha {
    background: #ffe0df;
    color: #b3261e;
}

.status-pendente,
.status-rascunho {
    background: #fff3cd;
    color: #8a6d1d;
}

.status-pausado {
    background: #e9edef;
    color: #54656f;
}

/* PÁGINAS SIMPLES / LOGS / AUTH */

.simple-page {
    padding: 22px;
    overflow: auto;
}

.config-grid {
    margin-top: 18px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
}

.config-grid div {
    background: #fff;
    border: 1px solid #d9dee2;
    border-radius: 8px;
    padding: 14px;
}

.config-grid span {
    color: #667781;
    font-size: 12px;
    display: block;
}

.admin-hub {
    padding: 22px;
}

.admin-hub-status {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 14px;
    margin-bottom: 24px;
}

.admin-hub-card {
    background: #fff;
    border: 1px solid #d9dee2;
    border-radius: 16px;
    padding: 22px;
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.06);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 170px;
}

.admin-hub-card h2,
.admin-hub-card h3 {
    margin-top: 8px;
    margin-bottom: 14px;
}

.admin-hub-card p {
    color: #55606b;
    margin-bottom: 18px;
}

.admin-hub-card ul {
    margin-bottom: 18px;
    padding-left: 1rem;
}

.admin-hub-card ul li {
    margin-bottom: 8px;
}

.admin-hub-card ul li strong {
    font-weight: 700;
}

.admin-hub-card a {
    color: #0d6efd;
    text-decoration: none;
    font-weight: 600;
}

.admin-hub-card a:hover,
.admin-hub-card a:focus-visible {
    text-decoration: underline;
}

.admin-hub-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    padding: 0.5rem 0.85rem;
}

.admin-hub-badge-success {
    background: #eff7ef;
    color: #0f6d3f;
}

.admin-hub-badge-warning {
    background: #fff4e5;
    color: #a65905;
}

.admin-hub-badge-danger {
    background: #fde7e9;
    color: #8f1d2f;
}

@media (max-width: 767.98px) {
    .admin-hub {
        padding: 18px;
    }

    .admin-hub-status,
    .config-grid {
        grid-template-columns: 1fr;
    }
}

.logs-page {
    grid-template-columns: 1fr 360px;
    gap: 0;
}

.logs-col {
    min-width: 0;
    overflow: auto;
    padding: 18px;
    background: #fff;
    border-right: 1px solid #d9dee2;
}

.auth-body {
    min-height: 100vh;
    display: grid;
    place-items: center;
    background: #111b21;
    overflow: auto;
}

.auth-card {
    width: min(390px, calc(100vw - 28px));
    background: #fff;
    border-radius: 10px;
    padding: 28px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, .24);
}

.auth-brand {
    width: 44px;
    height: 44px;
    border-radius: 8px;
    background: #00a884;
    color: #fff;
    display: grid;
    place-items: center;
    font-weight: 700;
    margin-bottom: 16px;
}

.auth-card h1 {
    font-size: 22px;
    margin: 0;
}

.auth-card p,
.users-head p {
    color: #667781;
    margin-bottom: 18px;
}

/* USUÁRIOS / DEPARTAMENTOS */

.users-page {
    height: calc(100vh - 48px);
}

.users-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.users-table {
    max-height: calc(100vh - 150px);
    overflow: auto;
    background: #fff;
    border: 1px solid #d9dee2;
    border-radius: 8px;
}

.department-checks {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 8px;
}

.department-checks label {
    border: 1px solid #d9dee2;
    border-radius: 8px;
    padding: 8px 10px;
    display: flex;
    gap: 8px;
    align-items: center;
}

.departments-admin {
    margin-top: 18px;
}

.department-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.department-pill {
    border: 1px solid #d9dee2;
    background: #fff;
    border-radius: 8px;
    padding: 9px 12px;
    display: grid;
    text-align: left;
}

.department-pill span {
    color: #667781;
    font-size: 12px;
}

/* MODELOS */

.via-page {
    height: calc(100vh - 48px);
    overflow: hidden;
    display: flex;
    min-height: 0;
}

.via-models-page {
    background: #f7f8fa;
}

.via-models-list {
    width: 32%;
    min-width: 280px;
    border-right: 1px solid #e5e7eb;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: #fff;
}

.models-head {
    min-height: 58px;
    padding: 10px 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    border-bottom: 1px solid #f0f2f5;
}

.models-head h1,
.preview-title h2 {
    font-size: 18px;
    margin: 0;
}

.models-head span,
.preview-title span {
    display: block;
    color: #667781;
    font-size: 12px;
}

.models-search {
    padding: 10px 12px;
    border-bottom: 1px solid #f0f2f5;
}

.via-models-list-body {
    flex: 1;
    overflow-y: auto;
    min-height: 0;
}

.via-model-editor {
    width: 68%;
    display: flex;
    overflow: hidden;
    min-width: 0;
}

.via-model-form {
    width: 55%;
    min-width: 0;
    overflow-y: auto;
    padding: 12px 14px;
    background: #fff;
    border-right: 1px solid #e5e7eb;
}

.via-model-preview {
    width: 45%;
    min-width: 0;
    overflow-y: auto;
    padding: 12px 14px;
    background: #efeae2;
}

.via-compact-input {
    min-height: 34px;
    font-size: 13px;
}

.via-template-body {
    min-height: 130px;
    max-height: 220px;
    resize: vertical;
    font-size: 13px;
}

.via-model-form .form-label {
    margin-bottom: 3px;
    color: #3b4a54;
    font-size: 12px;
    font-weight: 600;
}

.editor-head.compact {
    margin-bottom: 10px;
    gap: 10px;
}

.editor-head.compact h2 {
    font-size: 18px;
}

.body-label-row,
.buttons-head,
.preview-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.format-toolbar {
    margin-bottom: 0;
}

.format-toolbar .btn,
.buttons-head .btn,
.models-head .btn,
.preview-title .btn {
    --bs-btn-padding-y: .2rem;
    --bs-btn-padding-x: .45rem;
    font-size: 12px;
}

.compact-vars {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.button-rows {
    display: grid;
    gap: 6px;
}

.button-row {
    display: grid;
    grid-template-columns: 135px 1fr 1fr 34px;
    gap: 6px;
    margin-bottom: 0;
}

.live-preview {
    min-height: 320px;
    border: 0;
    border-radius: 0;
    padding: 12px 0;
}

.components-box {
    margin-top: 10px;
    background: rgba(255, 255, 255, .8);
    border: 1px solid #d9dee2;
    border-radius: 8px;
    overflow: hidden;
}

.components-box:empty {
    display: none;
}

.components-box h3 {
    font-size: 13px;
    margin: 0;
    padding: 8px 10px;
    background: #f0f2f5;
}

.components-box pre {
    max-height: 260px;
    overflow: auto;
    margin: 0;
    padding: 10px;
    font-size: 12px;
    white-space: pre-wrap;
}

.via-models-list .template-item {
    padding: 9px 12px;
    gap: 2px;
}

.via-models-list .template-item.active {
    background: #e7f7f2;
}

.via-models-list .template-item strong {
    font-size: 13px;
}

.via-models-list .template-item span {
    font-size: 11px;
}

.via-models-list .template-item-wrap .submit-meta-btn {
    margin: 0 12px 9px;
    padding: 2px 8px;
    font-size: 12px;
}

.wa-system-event {
    display: flex;
    justify-content: center;
    margin: 12px 0;
    width: 100%;
}

.wa-system-event span {
    background: rgba(255, 255, 255, 0.85);
    color: #54656f;
    padding: 5px 12px;
    border-radius: 8px;
    font-size: 12px;
    box-shadow: 0 1px 0.5px rgba(11, 20, 26, 0.13);
    text-align: center;
    max-width: 85%;
}

/* MODELOS - ADMIN NOVO */

.via-models-admin {
    background: #f7f8fa;
    display: block;
    min-height: calc(100vh - 48px);
    overflow: visible;
}

.models-workspace {
    min-width: 0;
    overflow: visible;
    padding: 22px;
}

.models-admin-head,
.models-head-actions,
.models-table-foot,
.model-panel-title,
.panel-badges,
.model-panel-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.models-admin-head {
    justify-content: space-between;
    margin-bottom: 18px;
}

.models-admin-head h1 {
    font-size: 22px;
    margin: 0;
}

.models-admin-head span,
.models-table-foot,
.model-panel-title small,
.model-detail-list span {
    color: #667781;
    font-size: 12px;
}

.models-stat-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(120px, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}

.model-stat-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 14px;
    display: grid;
    gap: 4px;
}

.model-stat-card strong {
    font-size: 22px;
}

.model-stat-card small,
.model-stat-card span {
    color: #667781;
    font-size: 12px;
}

.model-stat-card.success strong { color: #0b6b52; }
.model-stat-card.warning strong { color: #99630d; }
.model-stat-card.danger strong { color: #b3261e; }
.model-stat-card.muted strong { color: #54656f; }

.models-filter-bar {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 12px;
    display: grid;
    grid-template-columns: minmax(210px, 1.5fr) repeat(6, minmax(130px, 1fr)) auto auto;
    gap: 8px;
    margin-bottom: 14px;
}

.models-filter-bar .form-control,
.models-filter-bar .form-select {
    min-height: 38px;
    font-size: 13px;
}

.models-table-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
}

.models-admin-table {
    font-size: 13px;
}

.models-admin-table thead {
    background: #f8fafb;
}

.model-row {
    cursor: pointer;
}

.model-row.active,
.model-row:hover {
    background: #eefaf6;
}

.model-name-cell {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 220px;
}

.model-name-cell strong,
.model-name-cell small {
    display: block;
}

.model-name-cell small {
    max-width: 300px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #667781;
}

.model-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    flex: 0 0 36px;
    background: #e7f7f2;
    color: #0b6b52;
    font-weight: 800;
    text-transform: uppercase;
}

.model-avatar.marketing { background: #ffe0df; color: #b3261e; }
.model-avatar.authentication { background: #e7f0ff; color: #0958d9; }

.model-badge {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    border-radius: 6px;
    padding: 3px 8px;
    font-size: 11px;
    font-weight: 700;
    border: 1px solid transparent;
}

.model-badge.success,
.model-badge.aprovado {
    background: #e7f7ee;
    border-color: #a9dfbf;
    color: #137333;
}

.model-badge.primary {
    background: #e7f0ff;
    border-color: #b8d4ff;
    color: #0958d9;
}

.model-badge.warning,
.model-badge.pendente,
.model-badge.rascunho {
    background: #fff7e6;
    border-color: #ffd591;
    color: #ad6800;
}

.model-badge.danger,
.model-badge.rejeitado {
    background: #fff1f0;
    border-color: #ffccc7;
    color: #cf1322;
}

.model-badge.muted,
.model-badge.pausado {
    background: #f3f4f6;
    border-color: #d9dee2;
    color: #54656f;
}

.models-table-foot {
    justify-content: space-between;
    padding: 12px;
    border-top: 1px solid #eef1f2;
}

.models-help-grid {
    margin-top: 12px;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.models-help-grid div {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 12px;
    display: grid;
    gap: 4px;
}

.models-help-grid span {
    color: #667781;
    font-size: 12px;
}

.model-detail-offcanvas {
    width: min(520px, 100vw) !important;
}

.model-panel-title {
    min-width: 0;
}

.model-panel-title h2 {
    font-size: 15px;
    margin: 0;
    overflow-wrap: anywhere;
}

.panel-badges {
    flex-wrap: wrap;
    margin-bottom: 14px;
}

.model-tabs {
    margin-top: 12px;
}

.model-tab-content {
    padding-top: 16px;
}

.model-detail-list {
    display: grid;
    gap: 10px;
}

.model-detail-list div {
    display: grid;
    gap: 2px;
    padding-bottom: 8px;
    border-bottom: 1px solid #eef1f2;
}

.model-detail-list strong {
    font-size: 13px;
    color: #1f2c33;
    overflow-wrap: anywhere;
}

.model-json-box {
    margin-top: 12px;
    max-height: 240px;
    overflow: auto;
    background: #f8fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 10px;
    font-size: 12px;
}

.model-buttons-list {
    display: grid;
    gap: 8px;
}

.model-button-pill {
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 10px;
    display: grid;
    gap: 2px;
}

.model-button-pill small {
    color: #667781;
}

.model-panel-actions {
    flex-wrap: wrap;
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px solid #eef1f2;
}

.model-panel-actions .btn {
    font-size: 13px;
}

.model-quick-edit {
    margin-top: 16px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 12px;
    display: grid;
    gap: 8px;
}

.model-quick-edit strong {
    font-size: 13px;
}

.template-fullscreen-body {
    background: #f7f8fa;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(360px, 42vw);
    gap: 18px;
    min-height: 0;
    max-height: calc(100vh - 70px);
    overflow-y: auto;
    padding: 18px;
}

.template-editor-pane,
.template-preview-pane {
    min-width: 0;
    max-height: calc(100vh - 118px);
    overflow-y: auto;
}

.template-editor-pane {
    display: grid;
    gap: 14px;
}

.template-editor-section,
.template-preview-pane {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 16px;
}

.template-editor-section h6,
.template-preview-pane h6 {
    margin: 0 0 12px;
    font-size: 14px;
    font-weight: 800;
}

.template-preview-pane {
    display: grid;
    align-content: start;
    gap: 14px;
}

.template-preview-pane span {
    color: #667781;
    font-size: 12px;
}

.template-phone-preview {
    margin: 0 auto;
    width: min(100%, 430px);
    min-height: 620px;
    border-radius: 28px;
    border: 10px solid #111820;
    background: #e5ddd5;
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.18);
    overflow: hidden;
}

.template-phone-top {
    height: 56px;
    background: #075e54;
    color: #fff;
    display: flex;
    align-items: center;
    padding: 0 18px;
    font-weight: 800;
}

.template-phone-preview .wa-preview {
    background: transparent;
    min-height: 540px;
    padding: 22px;
}

.template-phone-preview .preview-bubble {
    max-width: 92%;
    font-size: 14px;
}

.template-department-badge {
    margin-top: 8px;
    display: inline-flex;
    align-items: center;
    width: fit-content;
    border-radius: 999px;
    padding: 4px 10px;
    background: #e7f7ee;
    color: #137333;
    border: 1px solid #a9dfbf;
    font-size: 12px;
    font-weight: 700;
}

.models-workspace,
.template-fullscreen-body,
.template-editor-pane,
.template-preview-pane,
.model-json-box,
.model-detail-offcanvas .offcanvas-body,
.chat-list,
.message-list,
.wa-chat-body {
    scrollbar-width: thin;
    scrollbar-color: rgba(84, 101, 111, 0.32) transparent;
}

.models-workspace::-webkit-scrollbar,
.template-fullscreen-body::-webkit-scrollbar,
.template-editor-pane::-webkit-scrollbar,
.template-preview-pane::-webkit-scrollbar,
.model-json-box::-webkit-scrollbar,
.model-detail-offcanvas .offcanvas-body::-webkit-scrollbar,
.chat-list::-webkit-scrollbar,
.message-list::-webkit-scrollbar,
.wa-chat-body::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.models-workspace::-webkit-scrollbar-track,
.template-fullscreen-body::-webkit-scrollbar-track,
.template-editor-pane::-webkit-scrollbar-track,
.template-preview-pane::-webkit-scrollbar-track,
.model-json-box::-webkit-scrollbar-track,
.model-detail-offcanvas .offcanvas-body::-webkit-scrollbar-track,
.chat-list::-webkit-scrollbar-track,
.message-list::-webkit-scrollbar-track,
.wa-chat-body::-webkit-scrollbar-track {
    background: transparent;
}

.models-workspace::-webkit-scrollbar-thumb,
.template-fullscreen-body::-webkit-scrollbar-thumb,
.template-editor-pane::-webkit-scrollbar-thumb,
.template-preview-pane::-webkit-scrollbar-thumb,
.model-json-box::-webkit-scrollbar-thumb,
.model-detail-offcanvas .offcanvas-body::-webkit-scrollbar-thumb,
.chat-list::-webkit-scrollbar-thumb,
.message-list::-webkit-scrollbar-thumb,
.wa-chat-body::-webkit-scrollbar-thumb {
    background: rgba(84, 101, 111, 0.24);
    border-radius: 999px;
}

#startDepartmentGroup.single-department > label,
#startDepartmentGroup.single-department > select {
    display: none;
}

/* PROTOCOLOS ADMINISTRATIVOS */

.protocol-admin-page .form-label {
    font-size: 12px;
    font-weight: 600;
    color: #3b4a54;
}

.protocol-admin-page .table {
    font-size: 13px;
}

.protocol-detail-list {
    display: grid;
    gap: 10px;
}

.protocol-detail-list div {
    display: grid;
    gap: 2px;
    padding-bottom: 8px;
    border-bottom: 1px solid #eef1f2;
}

.protocol-detail-list div:last-child {
    border-bottom: 0;
    padding-bottom: 0;
}

.protocol-detail-list span,
.protocol-timeline time,
.protocol-timeline small {
    color: #667781;
    font-size: 12px;
}

.protocol-detail-list strong {
    font-size: 13px;
    color: #1f2c33;
    overflow-wrap: anywhere;
}

.protocol-timeline {
    display: grid;
    gap: 12px;
}

.protocol-timeline-item {
    position: relative;
    padding-left: 18px;
    border-left: 2px solid #d9dee2;
}

.protocol-timeline-item::before {
    content: "";
    position: absolute;
    left: -5px;
    top: 3px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #00a884;
}

.protocol-timeline-item strong {
    display: block;
    margin-top: 2px;
}

.protocol-timeline-item p {
    margin: 3px 0;
    color: #3b4a54;
}

/* RESPONSIVO */

@media (max-width: 900px) {
    .via-app {
        grid-template-columns: 52px 1fr;
    }

    .chat-shell,
    .template-shell,
    .logs-page {
        grid-template-columns: 300px 1fr;
    }

    .composer-row,
    .media-row,
    .button-row {
        flex-wrap: wrap;
    }

    .via-page,
    .via-model-editor {
        flex-direction: column;
    }

    .models-stat-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .models-filter-bar {
        grid-template-columns: 1fr;
    }

    .model-detail-offcanvas {
        width: 100vw !important;
    }

    .template-fullscreen-body {
        grid-template-columns: 1fr;
        overflow: auto;
    }

    .template-preview-pane {
        min-height: 520px;
    }

    .template-phone-preview {
        min-height: 520px;
    }

    .via-models-list,
    .via-model-editor,
    .via-model-form,
    .via-model-preview {
        width: 100%;
    }

    .via-models-list {
        min-height: 260px;
    }

    .button-row {
        grid-template-columns: 1fr;
    }

    .wa-chat-body {
        padding: 12px;
    }

    .wa-bubble {
        max-width: 86%;
    }

    .chat-action-buttons {
        gap: 4px;
    }
}

/* CONNECT visual identity overrides */
:root {
    --connect-ink: #152238;
    --connect-navy: #0f2747;
    --connect-blue: #1f6feb;
    --connect-cyan: #3ddbd9;
    --connect-sky: #e9f6ff;
    --connect-surface: #f4f7fb;
    --connect-border: #dbe5ef;
    --connect-muted: #65758a;
    --connect-success: #11845b;
    --connect-warning: #c17b08;
    --connect-danger: #c4364f;
}

body {
    background: var(--connect-surface);
    color: var(--connect-ink);
}

.via-app {
    grid-template-columns: 76px 1fr;
}

.via-nav {
    background: linear-gradient(180deg, #0f2747 0%, #132f55 54%, #0a1d35 100%);
    box-shadow: inset -1px 0 0 rgba(255, 255, 255, 0.08), 8px 0 24px rgba(15, 39, 71, 0.12);
}

.via-brand {
    width: 58px;
    height: 54px;
    background: linear-gradient(135deg, var(--connect-cyan) 0%, var(--connect-blue) 100%);
    color: #ffffff;
    font-weight: 800;
    border-radius: 8px;
    box-shadow: 0 12px 24px rgba(31, 111, 235, 0.28);
    display: grid;
    grid-template-rows: 1fr auto;
    gap: 1px;
    padding: 6px 4px 5px;
}

.via-brand-mark {
    display: grid;
    place-items: center;
    font-size: 19px;
    line-height: 1;
}

.via-brand-name {
    font-size: 8px;
    line-height: 1;
    letter-spacing: 0;
}

.auth-brand {
    width: auto;
    min-width: 124px;
    height: 44px;
    padding: 0 18px;
    background: linear-gradient(135deg, var(--connect-cyan) 0%, var(--connect-blue) 100%);
    color: #ffffff;
    font-size: 13px;
    font-weight: 800;
    border-radius: 8px;
    box-shadow: 0 12px 24px rgba(31, 111, 235, 0.28);
}

.via-nav a:not(.via-brand),
.via-nav-group-toggle,
.via-nav-link-bottom {
    color: #dbeafe;
}

.via-nav a.active,
.via-nav a:not(.via-brand):hover,
.via-nav a:not(.via-brand):focus-visible,
.via-nav-group-toggle:hover,
.via-nav-group-toggle:focus-visible,
.via-nav-link-bottom:hover,
.via-nav-link-bottom:focus-visible {
    background: rgba(61, 219, 217, 0.14);
    color: #ffffff;
    box-shadow: inset 3px 0 0 var(--connect-cyan), 0 10px 22px rgba(2, 14, 35, 0.24);
}

.via-nav-group.active > .via-nav-group-toggle,
.via-nav-group-link.active {
    background: rgba(61, 219, 217, 0.18);
    color: #ffffff;
}

.via-nav-group-panel,
.via-nav a[data-tooltip]::after,
.via-nav-group-toggle[data-tooltip]::after {
    background: #102845;
}

.via-nav a[data-tooltip]::before,
.via-nav-group-toggle[data-tooltip]::before {
    border-right-color: #102845;
}

.via-topbar {
    background: rgba(255, 255, 255, 0.94);
    border-bottom: 1px solid var(--connect-border);
    box-shadow: 0 10px 24px rgba(15, 39, 71, 0.06);
}

.via-topbar strong,
.auth-card h1,
.panel-head h1,
.simple-page h1,
.logs-page h1 {
    color: var(--connect-navy);
}

.auth-card h2 {
    margin: 6px 0 0;
    color: var(--connect-blue);
    font-size: 15px;
    font-weight: 700;
}

.via-topbar span,
.via-topbar small,
.panel-head span,
.editor-head span,
.conversation-item span,
.conversation-item small,
.template-item span,
.message-meta,
.wa-unavailable,
.auth-card p,
.users-head p {
    color: var(--connect-muted);
}

.btn-primary,
.btn-success {
    --bs-btn-bg: var(--connect-blue);
    --bs-btn-border-color: var(--connect-blue);
    --bs-btn-hover-bg: #175bc7;
    --bs-btn-hover-border-color: #175bc7;
    --bs-btn-active-bg: #124aa4;
    --bs-btn-active-border-color: #124aa4;
    --bs-btn-disabled-bg: #89aef2;
    --bs-btn-disabled-border-color: #89aef2;
}

.btn-outline-primary,
.btn-outline-success {
    --bs-btn-color: var(--connect-blue);
    --bs-btn-border-color: #8fb7f4;
    --bs-btn-hover-bg: var(--connect-blue);
    --bs-btn-hover-border-color: var(--connect-blue);
    --bs-btn-active-bg: var(--connect-blue);
    --bs-btn-active-border-color: var(--connect-blue);
}

.text-primary,
.text-success,
.text-purple {
    color: var(--connect-blue) !important;
}

.border-primary,
.border-success,
.border-info,
.border-purple {
    border-color: var(--connect-blue) !important;
}

.bg-primary,
.bg-success,
.text-bg-primary,
.text-bg-success {
    background-color: var(--connect-blue) !important;
    color: #ffffff !important;
}

.card,
.admin-hub-card,
.models-table-card,
.model-stat-card,
.users-table,
.audio-preview-card,
.document-preview-card {
    border-color: var(--connect-border);
    box-shadow: 0 10px 26px rgba(15, 39, 71, 0.07);
}

.card-header,
.models-table-head,
.template-editor-section,
.model-quick-edit {
    background: #ffffff;
    border-color: var(--connect-border);
}

.chat-list-panel,
.template-list,
.logs-col {
    border-right-color: var(--connect-border);
}

.conversation-item:hover,
.conversation-item.active,
.template-item:hover,
.contact-item:hover,
.contact-item.active {
    background: var(--connect-sky);
}

.conversation-item.batch-selected,
.conversation-item.has-new-message {
    background: #edf9ff;
    box-shadow: inset 3px 0 0 var(--connect-blue);
}

.conversation-item.active.batch-selected,
.conversation-item .conversation-assignee.active,
.message-out,
.wa-message-out,
.template-message-out {
    background: #dff7ff;
}

.conversation-select-check {
    accent-color: var(--connect-blue);
}

.conversation-badge,
.bg-green {
    background: var(--connect-blue);
    color: #ffffff;
}

.send-btn {
    color: var(--connect-blue);
}

.chat-window,
.wa-chat-body,
.template-preview-surface,
.template-phone-preview,
.chat-container,
.chat-main {
    background: #eef4fb;
}

.chat-header,
.chat-composer-area,
.chat-composer {
    background: #ffffff;
    border-color: var(--connect-border);
}

.whatsapp-composer,
.audio-recording-bar {
    background: #f6f9fc;
    border: 1px solid var(--connect-border);
}

.auth-body {
    background:
        radial-gradient(circle at 20% 20%, rgba(61, 219, 217, 0.24), transparent 34%),
        linear-gradient(135deg, #0f2747 0%, #173d6d 48%, #071d35 100%);
}

.auth-card {
    border: 1px solid rgba(255, 255, 255, 0.18);
    box-shadow: 0 28px 70px rgba(2, 14, 35, 0.36);
}

.connect-presentation-modal {
    background: rgba(7, 18, 35, 0.78);
    backdrop-filter: blur(10px);
}

.connect-presentation-modal .modal-dialog {
    max-width: 820px;
}

.connect-presentation-panel {
    display: grid;
    grid-template-columns: 260px minmax(0, 1fr);
    overflow: hidden;
    background: #ffffff;
    border: 0;
    border-radius: 8px;
    box-shadow: 0 36px 96px rgba(2, 14, 35, 0.42);
}

.connect-presentation-brand {
    min-height: 420px;
    padding: 34px 28px;
    background:
        linear-gradient(150deg, rgba(61, 219, 217, 0.24), transparent 42%),
        linear-gradient(180deg, #0f2747 0%, #153b68 100%);
    color: #ffffff;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.connect-presentation-brand::after {
    content: "Comunicação institucional, atendimento digital e relacionamento com cidadãos.";
    color: rgba(255, 255, 255, 0.76);
    font-size: 13px;
    line-height: 1.5;
}

.connect-presentation-symbol {
    width: 58px;
    height: 58px;
    display: grid;
    place-items: center;
    border-radius: 8px;
    background: linear-gradient(135deg, var(--connect-cyan), var(--connect-blue));
    color: #ffffff;
    font-size: 28px;
    font-weight: 800;
    box-shadow: 0 18px 34px rgba(0, 0, 0, 0.24);
}

.connect-presentation-brand span {
    display: block;
    margin-top: 18px;
    font-size: 24px;
    font-weight: 800;
}

.connect-presentation-content {
    padding: 42px 46px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.connect-presentation-kicker {
    width: fit-content;
    margin-bottom: 14px;
    padding: 6px 10px;
    border-radius: 999px;
    background: #e9f6ff;
    color: var(--connect-blue);
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
}

.connect-presentation-content h2 {
    margin: 0 0 8px;
    color: var(--connect-navy);
    font-size: 40px;
    line-height: 1;
    font-weight: 800;
}

.connect-presentation-content strong {
    display: block;
    color: var(--connect-blue);
    font-size: 18px;
    line-height: 1.35;
    margin-bottom: 22px;
}

.connect-presentation-content p {
    color: #3c4c63;
    font-size: 15px;
    line-height: 1.62;
    margin: 0 0 12px;
}

.connect-presentation-content .btn {
    align-self: flex-start;
    min-width: 154px;
    margin-top: 12px;
    padding: 10px 18px;
    font-weight: 700;
}

.admin-hub-badge-success,
.model-badge.success,
.model-badge.aprovado,
.protocol-badge {
    background: #e8f8f2;
    border-color: #b9ead8;
    color: var(--connect-success);
}

.admin-hub-badge-warning,
.model-badge.warning,
.model-badge.pendente,
.model-badge.rascunho {
    background: #fff7e8;
    border-color: #ffdca4;
    color: var(--connect-warning);
}

.admin-hub-badge-danger,
.model-badge.danger,
.model-badge.rejeitado {
    background: #ffedf1;
    border-color: #ffc6d1;
    color: var(--connect-danger);
}

.template-phone-top {
    background: var(--connect-navy);
    color: #ffffff;
}

@media (max-width: 991.98px) {
    .via-app {
        grid-template-columns: 76px 1fr;
    }
}

@media (max-width: 575.98px) {
    .connect-presentation-modal .modal-dialog {
        margin: 12px;
    }

    .connect-presentation-panel {
        grid-template-columns: 1fr;
    }

    .connect-presentation-brand {
        min-height: auto;
        padding: 22px;
    }

    .connect-presentation-brand::after {
        margin-top: 22px;
    }

    .connect-presentation-content {
        padding: 26px 22px 24px;
    }

    .connect-presentation-content h2 {
        font-size: 32px;
    }

    .connect-presentation-content .btn {
        align-self: stretch;
        width: 100%;
    }
}
