:root {
    --app-primary: #0e479e;
    --app-primary-strong: #08316f;
    --app-accent: #0f766e;
    --app-bg: #eef2f7;
    --app-surface: #ffffff;
    --app-surface-soft: #f8fafc;
    --app-border: #d9e2ec;
    --app-text: #172033;
    --app-muted: #64748b;
    --app-muted-strong: #475569;
    --app-outbound: #dbeafe;
    --app-inbound: #ffffff;
    --app-bot: #f0fdfa;
    --app-danger: #b91c1c;
    --shadow-soft: 0 18px 60px rgba(15, 23, 42, 0.12);
}

* {
    box-sizing: border-box;
}

html,
body {
    width: 100%;
    height: 100%;
    margin: 0;
    overflow: hidden;
    background: var(--app-bg);
    color: var(--app-text);
    font-family: "Segoe UI", Roboto, Arial, sans-serif;
}

body {
    overscroll-behavior: none;
}

button,
input,
textarea {
    font: inherit;
}

button {
    cursor: pointer;
}

.travel-shell {
    /* Corte 2A-1: era 100vw/100vh (assumia ocupar a janela inteira). Agora este bloco vive
       dentro do AppShell (Login/Error/NaoEncontrado, via MainLayout) ou dentro de
       .crm-shell-content (chat em /atendimentos, via CrmAppShell) - em ambos os casos o
       espaco correto ja e o do elemento pai, nao o da janela do navegador. */
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.travel-crm {
    display: grid;
    grid-template-columns: minmax(300px, 360px) minmax(440px, 1fr) minmax(280px, 330px);
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: linear-gradient(180deg, #f8fafc 0, #eef2f7 100%);
}

.travel-crm.details-closed {
    grid-template-columns: minmax(300px, 360px) minmax(440px, 1fr);
}

.conversation-list,
.chat-panel,
.details-panel {
    height: 100%;
    min-width: 0;
    min-height: 0;
    overflow: hidden;
}

.conversation-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 22px;
    border-right: 1px solid var(--app-border);
    background: var(--app-surface);
}

.workspace-header,
.chat-header,
.contact-heading,
.conversation-title-row,
.conversation-meta-row,
.chat-actions,
.composer {
    display: flex;
    align-items: center;
}

.workspace-header,
.chat-header {
    flex: 0 0 auto;
    justify-content: space-between;
    gap: 16px;
}

.brand-heading {
    display: flex;
    align-items: center;
    min-width: 0;
}

.brand-heading img {
    display: block;
    width: min(210px, 100%);
    max-height: 74px;
    object-fit: contain;
    object-position: left center;
}

.eyebrow {
    margin: 0 0 4px;
    color: var(--app-muted);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0;
    text-transform: uppercase;
}

h1,
h2,
h3,
p {
    margin-top: 0;
}

/* <FocusOnNavigate Selector="h1"> (Routes.razor) foca o titulo da pagina a cada
   troca de rota para leitores de tela. Em navegacao por mouse/toque isso pisca um
   contorno preto no titulo. Suprimimos so o foco NAO-teclado; :focus-visible
   preserva o anel para quem navega pelo teclado. */
h1:focus:not(:focus-visible) {
    outline: none;
}

.workspace-header h1,
.chat-header h2,
.details-panel h2 {
    margin: 0;
    font-size: 1.3rem;
    line-height: 1.2;
}

.ticket-actions-row {
    align-items: center;
    margin-top: 4px;
}

.ticket-action-chip {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    min-height: 24px;
    border: 1px solid var(--app-border);
    border-radius: 999px;
    padding: 3px 10px;
    background: var(--app-surface-soft);
    color: var(--app-primary);
    font-size: 0.72rem;
    font-weight: 700;
    white-space: nowrap;
}

.ticket-action-chip:hover:not(:disabled) {
    border-color: #bbd3fb;
    background: #e7f0fc;
}

.ticket-action-chip:disabled {
    opacity: 0.6;
    cursor: default;
}

.workspace-pill,
.status-badge,
.channel-badge {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    min-height: 24px;
    border-radius: 999px;
    padding: 4px 9px;
    font-size: 0.72rem;
    font-weight: 700;
    white-space: nowrap;
}

.workspace-pill {
    color: var(--app-primary);
    background: #e0ecff;
}

.workspace-account {
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
}

.workspace-account form {
    margin: 0;
}

.header-icon-button,
.icon-button,
.chat-icon-action {
    display: inline-grid;
    place-items: center;
    flex: 0 0 auto;
    width: 36px;
    height: 36px;
    border: 1px solid var(--app-border);
    border-radius: 8px;
    padding: 0;
    background: var(--app-surface-soft);
    color: var(--app-muted-strong);
}

.header-icon-button:hover,
.icon-button:hover,
.chat-icon-action:hover:not(:disabled) {
    border-color: #bbd3fb;
    background: #e7f0fc;
    color: var(--app-primary);
}

.header-icon-button svg,
.icon-button svg,
.chat-icon-action svg,
.icon-text-button svg,
.composer-icon-button svg,
.composer-inline-action svg,
.user-menu-dropdown svg,
.position-card-icon svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
}

.icon-button.danger:hover {
    border-color: #fecaca;
    background: #fef2f2;
    color: var(--app-danger);
}

.chat-icon-action.active {
    border-color: #fecaca;
    background: #fee2e2;
    color: #991b1b;
}

.icon-text-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
}

.workspace-user {
    max-width: 110px;
    overflow: hidden;
    color: var(--app-muted);
    font-size: 0.78rem;
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.logout-button {
    border: 0;
    padding: 4px;
    background: transparent;
    color: var(--app-primary);
    font-size: 0.78rem;
    font-weight: 800;
    cursor: pointer;
}

.logout-button:hover {
    text-decoration: underline;
}

.user-menu {
    position: relative;
}

.user-menu-trigger {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    padding: 0;
}

.user-menu-avatar {
    width: 32px;
    height: 32px;
    font-size: 0.72rem;
}

.user-menu-copy {
    display: grid;
    min-width: 0;
    text-align: left;
}

.user-menu-copy strong,
.user-menu-copy small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-menu-copy strong {
    font-size: 0.78rem;
}

.user-menu-copy small {
    color: var(--app-muted);
    font-size: 0.7rem;
    font-weight: 700;
}

.user-menu-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    z-index: 30;
    display: grid;
    min-width: 240px;
    overflow: hidden;
    border: 1px solid var(--app-border);
    border-radius: 8px;
    background: var(--app-surface);
    box-shadow: var(--shadow-soft);
}

.user-menu-profile {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    border-bottom: 1px solid var(--app-border);
    padding: 12px;
    background: var(--app-surface-soft);
}

.user-menu-profile .user-menu-copy {
    flex: 1;
}

.user-menu-dropdown form {
    margin: 0;
}

.user-menu-dropdown button {
    display: flex;
    align-items: center;
    gap: 9px;
    width: 100%;
    border: 0;
    border-radius: 0;
    padding: 11px 12px;
    background: transparent;
    color: var(--app-muted-strong);
    font-weight: 800;
    text-align: left;
}

.user-menu-dropdown button:hover {
    background: var(--app-surface-soft);
    color: var(--app-primary);
}

.channel-badge.whatsapp {
    color: #065f46;
    background: #d1fae5;
}

.channel-badge.instagram {
    color: #86198f;
    background: #fae8ff;
}

.status-badge.warning {
    color: #92400e;
    background: #fef3c7;
}

.status-badge.waiting {
    color: #075985;
    background: #e0f2fe;
}

.status-badge.privileged {
    color: #991b1b;
    background: #fee2e2;
}

.search-box {
    display: grid;
    flex: 0 0 auto;
    gap: 6px;
    color: var(--app-muted-strong);
    font-size: 0.78rem;
    font-weight: 700;
}

.search-box input,
.composer textarea {
    width: 100%;
    border: 1px solid var(--app-border);
    border-radius: 8px;
    color: var(--app-text);
    background: var(--app-surface-soft);
    outline: none;
}

.search-box input {
    min-height: 42px;
    padding: 0 12px;
}

.search-box input:focus,
.composer textarea:focus {
    border-color: var(--app-primary);
    box-shadow: 0 0 0 3px rgba(14, 71, 158, 0.12);
}

.conversation-tabs {
    display: flex;
    flex: 0 0 auto;
    gap: 6px;
    overflow-x: auto;
    padding-bottom: 2px;
}

.conversation-toolbar {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 8px;
}

.conversation-tabs button,
.conversation-toolbar button,
.chat-actions button,
.composer button,
.detail-block button,
.modal-actions button {
    border: 1px solid var(--app-border);
    border-radius: 8px;
    background: var(--app-surface);
    color: var(--app-muted-strong);
    font-weight: 700;
}

.conversation-tabs button {
    min-height: 34px;
    padding: 0 12px;
}

.conversation-tabs button.active,
.conversation-toolbar button.primary,
.chat-actions button.primary,
.composer button.primary,
.detail-block button.primary,
.modal-actions button.primary {
    border-color: var(--app-primary);
    background: var(--app-primary);
    color: #ffffff;
}

.chat-actions button:not(.chat-icon-action) {
    border-radius: 999px;
    font-size: 0.82rem;
    transition: border-color 0.15s ease, background-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.chat-actions button:not(.chat-icon-action):hover:not(:disabled) {
    border-color: var(--app-primary);
    color: var(--app-primary);
}

.chat-actions button.primary:hover:not(:disabled) {
    background: var(--app-primary-strong);
    border-color: var(--app-primary-strong);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(14, 71, 158, 0.25);
}

.chat-actions button.danger {
    border-color: #fecaca;
    background: #fff1f2;
    color: #b91c1c;
}

.chat-actions button.danger:hover:not(:disabled) {
    border-color: #fca5a5;
    background: #ffe4e6;
    color: #b91c1c;
}

.chat-actions button:disabled {
    opacity: 0.55;
}

.refresh-button {
    display: inline-grid;
    place-items: center;
    width: 34px;
    height: 34px;
    padding: 0;
    border: 1px solid var(--app-border);
    border-radius: 50%;
    background: var(--app-surface);
    color: var(--app-muted-strong);
}

.refresh-button svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

.refresh-button:hover:not(:disabled) {
    border-color: var(--app-primary);
    color: var(--app-primary);
    background: var(--app-surface-soft);
}

.refresh-button:disabled {
    opacity: 0.6;
}

.refresh-button.spinning svg {
    animation: refresh-spin 0.9s linear infinite;
}

@keyframes refresh-spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.conversation-items {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 8px;
    min-height: 0;
    overflow-y: auto;
    padding-right: 4px;
}

.conversation-card {
    position: relative;
    display: grid;
    grid-template-columns: 46px minmax(0, 1fr);
    gap: 10px;
    width: 100%;
    border: 0;
    border-radius: 8px;
    padding: 10px 34px 10px 10px;
    background: transparent;
    color: inherit;
    text-align: left;
}

.conversation-card:hover,
.conversation-card.selected {
    background: #f1f6fd;
}

.conversation-card.selected {
    background: #e7f0fc;
}

.conversation-card.waiting-human {
    border-left: 3px solid #0ea5e9;
    background: #f0f9ff;
}

.conversation-card.waiting-human.selected {
    background: #e0f2fe;
}

.unread-badge {
    position: absolute;
    right: 10px;
    bottom: 9px;
    display: inline-grid;
    place-items: center;
    min-width: 20px;
    height: 20px;
    border-radius: 999px;
    padding: 0 6px;
    background: var(--app-primary);
    color: #ffffff;
    font-size: 0.72rem;
    font-weight: 800;
    line-height: 1;
}

.avatar {
    display: inline-grid;
    place-items: center;
    overflow: hidden;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--app-primary), var(--app-accent));
    color: #ffffff;
    font-size: 0.88rem;
    font-weight: 800;
}

.avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.avatar span {
    display: inline-grid;
    place-items: center;
    width: 100%;
    height: 100%;
}

.avatar span[hidden] {
    display: none;
}

.avatar.large {
    width: 54px;
    height: 54px;
}

.conversation-main {
    display: grid;
    min-width: 0;
    gap: 5px;
}

.conversation-title-row {
    justify-content: space-between;
    gap: 8px;
}

.conversation-title-row strong,
.conversation-preview {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.conversation-title-row small,
.conversation-preview,
.chat-header span,
.details-panel dd {
    color: var(--app-muted);
}

.conversation-meta-row {
    flex-wrap: wrap;
    gap: 5px;
    color: var(--app-muted-strong);
    font-size: 0.75rem;
}

.conversation-preview {
    font-size: 0.82rem;
}

.chat-panel {
    display: grid;
    grid-template-rows: auto 1fr auto;
    min-height: 0;
    overflow: hidden;
    background: #e9eef5;
}

.chat-header {
    min-height: 82px;
    padding: 18px 22px;
    border-bottom: 1px solid var(--app-border);
    background: rgba(255, 255, 255, 0.92);
}

.contact-heading {
    gap: 12px;
    min-width: 0;
}

.contact-heading-button {
    border: 0;
    padding: 0;
    background: transparent;
    color: inherit;
    text-align: left;
}

.contact-heading-button:hover h2 {
    color: var(--app-primary);
}

.chat-actions,
.composer {
    gap: 10px;
}

.chat-actions button,
.composer button,
.detail-block button,
.modal-actions button {
    min-height: 38px;
    padding: 0 14px;
}

.chat-actions .chat-icon-action {
    width: 38px;
    min-height: 38px;
    padding: 0;
}

.message-stream {
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-height: 0;
    overflow-y: auto;
    padding: 24px;
}

.message-bubble {
    width: min(72%, 620px);
    border: 1px solid var(--app-border);
    border-radius: 8px;
    padding: 10px 12px 8px;
    background: var(--app-inbound);
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.06);
}

.message-bubble.outbound {
    align-self: flex-end;
    border-color: #bbd3fb;
    background: var(--app-outbound);
}

.message-bubble.bot {
    align-self: flex-end;
    border-color: #b8efe5;
    background: var(--app-bot);
}

.message-author {
    margin-bottom: 5px;
    color: var(--app-muted-strong);
    font-size: 0.76rem;
    font-weight: 800;
}

.message-bubble p,
.whatsapp-human-format {
    margin: 0;
    line-height: 1.45;
}

.whatsapp-human-format {
    display: grid;
    gap: 4px;
}

.message-bubble time {
    display: block;
    margin-top: 7px;
    color: var(--app-muted);
    font-size: 0.72rem;
    text-align: right;
}

.delivery-status {
    display: block;
    margin-top: 6px;
    color: var(--app-muted);
    font-size: 0.72rem;
    text-align: right;
}

.delivery-status.failed {
    color: #b91c1c;
}

.system-separator {
    align-self: center;
    max-width: 90%;
    border-radius: 999px;
    padding: 6px 12px;
    color: var(--app-muted-strong);
    background: rgba(255, 255, 255, 0.78);
    font-size: 0.78rem;
    font-weight: 700;
    box-shadow: 0 4px 18px rgba(15, 23, 42, 0.08);
}

.composer {
    flex: 0 0 auto;
    padding: 14px 18px;
    border-top: 1px solid var(--app-border);
    background: var(--app-surface);
}

.composer-icon-button,
.composer-inline-action {
    flex: 0 0 auto;
}

.composer-icon-button {
    display: inline-grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    padding: 0;
}

.composer-icon-button:disabled,
.composer-inline-action:disabled {
    opacity: 0.55;
}

.composer-input-shell {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    flex: 1;
    min-width: 0;
    border: 1px solid var(--app-border);
    border-radius: 999px;
    background: var(--app-surface-soft);
}

.composer-input-shell:focus-within {
    border-color: var(--app-primary);
    box-shadow: 0 0 0 3px rgba(14, 71, 158, 0.12);
}

.composer textarea {
    min-height: 42px;
    max-height: 96px;
    border: 0;
    border-radius: 999px 0 0 999px;
    resize: vertical;
    padding: 10px 12px 10px 16px;
    background: transparent;
    box-shadow: none;
}

.composer textarea:focus {
    border-color: transparent;
    box-shadow: none;
}

.composer-inline-action {
    display: inline-grid;
    place-items: center;
    min-width: 42px;
    height: 34px;
    margin-right: 4px;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: var(--app-muted-strong);
    font-weight: 800;
}

.composer-inline-action.send {
    background: var(--app-primary);
    color: #ffffff;
}

.details-panel {
    display: flex;
    flex-direction: column;
    gap: 18px;
    padding: 22px;
    border-left: 1px solid var(--app-border);
    background: var(--app-surface);
    overflow-y: auto;
}

.details-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.details-close-button {
    display: inline-grid;
    place-items: center;
    flex: 0 0 auto;
    width: 34px;
    height: 34px;
    border: 0;
    border-radius: 50%;
    background: #edf2f7;
    color: var(--app-muted-strong);
    font-size: 1rem;
    font-weight: 800;
}

.details-close-button:hover {
    background: #dbe7f5;
    color: var(--app-primary);
}

.details-close-button.icon-only {
    font-size: 1.35rem;
    line-height: 1;
}

.details-compact {
    display: grid;
    flex-shrink: 0;
    gap: 2px;
    border: 1px solid var(--app-border);
    border-radius: 8px;
    background: var(--app-surface-soft);
    overflow: hidden;
}

.detail-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 9px 12px;
    border-bottom: 1px solid var(--app-border);
    min-width: 0;
}

.detail-row:last-child {
    border-bottom: 0;
}

.detail-label {
    flex: 0 0 auto;
    color: var(--app-muted-strong);
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.detail-value {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-align: right;
    color: var(--app-text);
    font-size: 0.85rem;
    font-weight: 700;
}

.detail-select.compact {
    flex: 1;
    min-width: 0;
    width: auto;
    max-width: 62%;
    min-height: 30px;
    padding: 3px 8px;
    font-size: 0.82rem;
}

.detail-badge {
    display: inline-block;
    border-radius: 999px;
    padding: 3px 10px;
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.detail-badge.standard {
    background: #eef2f7;
    color: var(--app-muted-strong);
}

.detail-badge.privileged {
    background: #fee2e2;
    color: #991b1b;
}

.detail-block {
    display: grid;
    gap: 8px;
    border: 1px solid var(--app-border);
    border-radius: 8px;
    padding: 12px;
    background: var(--app-surface-soft);
}

.detail-block h3 {
    margin-bottom: 4px;
    font-size: 0.95rem;
}

.detail-block button {
    width: 100%;
    background: var(--app-surface);
    text-align: left;
    border-radius: 10px;
    transition: border-color 0.15s ease, background-color 0.15s ease, color 0.15s ease;
}

.detail-block button:hover:not(:disabled) {
    border-color: var(--app-primary);
    background: var(--app-surface-soft);
    color: var(--app-primary);
}

.detail-select,
.field-stack input,
.field-stack select,
.field-stack textarea {
    width: 100%;
    border: 1px solid var(--app-border);
    border-radius: 8px;
    padding: 9px 10px;
    color: var(--app-text);
    background: var(--app-surface);
    outline: none;
}

.detail-select:disabled,
.field-stack input:disabled,
.field-stack select:disabled,
.field-stack textarea:disabled,
.money-input input:disabled,
input:disabled,
select:disabled,
textarea:disabled {
    border-color: var(--app-border);
    background: #eef1f5;
    color: var(--app-muted);
    cursor: not-allowed;
    opacity: 0.75;
}

.money-input:has(input:disabled) {
    background: #eef1f5;
}

.money-input:has(input:disabled) span {
    color: var(--app-muted);
}

button:disabled {
    cursor: not-allowed;
    opacity: 0.55;
}

.field-stack {
    display: grid;
    gap: 6px;
    color: var(--app-muted-strong);
    font-size: 0.78rem;
    font-weight: 500;
}

.field-stack textarea {
    min-height: 88px;
    resize: vertical;
}

.checkbox-row,
.inline-actions,
.modal-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.checkbox-row {
    color: var(--app-muted-strong);
    font-size: 0.85rem;
    font-weight: 700;
}

.inline-actions button {
    flex: 1;
    text-align: center;
}

.modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 20;
    background: rgba(15, 23, 42, 0.34);
}

.modal-panel {
    position: fixed;
    top: 50%;
    left: 50%;
    z-index: 21;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
    width: min(560px, calc(100vw - 32px));
    max-height: min(720px, calc(100vh - 32px));
    overflow: hidden;
    border-radius: 8px;
    background: var(--app-surface);
    box-shadow: var(--shadow-soft);
    transform: translate(-50%, -50%);
}

.modal-header,
.modal-actions {
    padding: 18px;
    border-bottom: 1px solid var(--app-border);
}

.modal-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.modal-body {
    display: grid;
    gap: 12px;
    min-height: 0;
    overflow-y: auto;
    padding: 18px;
}

.modal-actions {
    justify-content: flex-end;
    border-top: 1px solid var(--app-border);
    border-bottom: 0;
}

.modal-actions button {
    min-width: 130px;
}

.permission-note {
    margin: 0;
    border: 1px solid #fde68a;
    border-radius: 8px;
    padding: 10px 12px;
    background: #fffbeb;
    color: #92400e;
    font-size: 0.84rem;
    font-weight: 700;
}

.commercial-panel,
.commercial-section,
.commercial-form,
.commercial-list {
    display: grid;
    gap: 10px;
}

.commercial-panel {
    gap: 12px;
}

.commercial-header,
.commercial-section header,
.commercial-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.commercial-header h3,
.commercial-section h4,
.commercial-form h5 {
    margin: 0;
}

.commercial-header h3 {
    font-size: 1rem;
}

.commercial-section {
    border: 1px solid var(--app-border);
    border-radius: 8px;
    padding: 12px;
    background: var(--app-surface-soft);
}

.commercial-section header span,
.commercial-list-item span,
.commercial-list-item small,
.commercial-empty {
    color: var(--app-muted);
    font-size: 0.8rem;
    font-weight: 700;
}

.commercial-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.commercial-grid .wide {
    grid-column: 1 / -1;
}

.commercial-actions {
    justify-content: flex-end;
    flex-wrap: wrap;
}

.commercial-actions.inline {
    justify-content: flex-start;
    margin-top: 6px;
}

.commercial-actions button,
.mini-button {
    min-height: 34px;
    border: 1px solid var(--app-border);
    border-radius: 8px;
    padding: 0 10px;
    background: var(--app-surface);
    color: var(--app-muted-strong);
    font-size: 0.78rem;
    font-weight: 800;
}

.commercial-actions button.primary,
.mini-button.primary,
.commercial-section > button.primary {
    border-color: var(--app-primary);
    background: var(--app-primary);
    color: #ffffff;
}

.commercial-actions button.danger {
    border-color: #fecaca;
    background: #fff1f2;
    color: var(--app-danger);
}

.commercial-section > button {
    min-height: 36px;
    border: 1px solid var(--app-border);
    border-radius: 8px;
    padding: 0 12px;
    background: var(--app-surface);
    color: var(--app-muted-strong);
    font-weight: 800;
}

.commercial-empty {
    margin: 0;
    border: 1px dashed var(--app-border);
    border-radius: 8px;
    padding: 10px;
    background: rgba(255, 255, 255, 0.65);
}

.commercial-feedback {
    margin: 0;
    border: 1px solid #bbf7d0;
    border-radius: 8px;
    padding: 10px;
    background: #f0fdf4;
    color: #166534;
    font-size: 0.84rem;
    font-weight: 800;
}

.commercial-feedback.error {
    display: grid;
    gap: 8px;
    border-color: #fecaca;
    background: #fef2f2;
    color: var(--app-danger);
}

.commercial-feedback.error button {
    justify-self: start;
    min-height: 32px;
    border: 1px solid #fecaca;
    border-radius: 8px;
    padding: 0 10px;
    background: #ffffff;
    color: var(--app-danger);
    font-weight: 800;
}

.commercial-list-item {
    display: grid;
    gap: 3px;
    width: 100%;
    border: 1px solid var(--app-border);
    border-radius: 8px;
    padding: 10px;
    background: var(--app-surface);
    color: var(--app-text);
    text-align: left;
}

.commercial-list-item.selectable {
    cursor: pointer;
}

.commercial-list-item.selected,
.commercial-list-item.selectable:hover {
    border-color: #bbd3fb;
    background: #e7f0fc;
}

.commercial-list-item.editing {
    border-color: var(--app-primary);
}

.commercial-list-item strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.commercial-form {
    border: 1px solid #bbd3fb;
    border-radius: 8px;
    padding: 10px;
    background: #f8fbff;
}

.voucher-backdrop {
    z-index: 60;
}

.voucher-modal {
    position: fixed;
    inset: 24px;
    z-index: 61;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
    overflow: hidden;
    border-radius: 8px;
    background: var(--app-surface);
    box-shadow: var(--shadow-soft);
}

.voucher-modal-header span,
.voucher-section-card header span,
.voucher-product-card header span,
.voucher-copy,
.voucher-preview,
.voucher-validation-card header span {
    color: var(--app-muted);
}

.voucher-header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.voucher-modal-body {
    min-height: 0;
    overflow-y: auto;
    padding: 18px;
    background: var(--app-surface-soft);
}

.voucher-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(280px, 340px);
    align-items: start;
    gap: 16px;
}

.voucher-main,
.voucher-side {
    display: flex;
    flex-direction: column;
    gap: 14px;
    min-width: 0;
}

.voucher-section-card,
.voucher-validation-card,
.voucher-product-card,
.voucher-passenger-card {
    border: 1px solid var(--app-border);
    border-radius: 8px;
    background: var(--app-surface);
}

.voucher-section-card,
.voucher-validation-card {
    overflow: hidden;
}

.voucher-section-card > header,
.voucher-validation-card > header,
.voucher-product-card > header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    border-bottom: 1px solid var(--app-border);
    padding: 14px;
    background: #f8fbff;
}

.voucher-section-card h3,
.voucher-validation-card h3 {
    margin: 0 0 4px;
    font-size: 0.98rem;
}

.voucher-section-body {
    display: grid;
    gap: 12px;
    padding: 14px;
}

.voucher-copy {
    margin: 0;
    line-height: 1.45;
}

.voucher-summary-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
}

.voucher-summary-grid span {
    display: grid;
    gap: 4px;
    min-width: 0;
    border: 1px solid var(--app-border);
    border-radius: 8px;
    padding: 10px;
    background: var(--app-surface-soft);
}

.voucher-summary-grid strong,
.voucher-summary-grid small {
    overflow-wrap: break-word;
    white-space: normal;
}

.voucher-summary-grid small {
    color: var(--app-muted);
    font-weight: 700;
}

.voucher-passenger-list,
.voucher-product-list,
.voucher-validation-list,
.voucher-preview {
    display: grid;
    gap: 10px;
}

.voucher-passenger-card,
.voucher-product-card {
    padding: 12px;
}

.voucher-product-card {
    display: grid;
    gap: 12px;
}

.voucher-product-card > header {
    margin: -12px -12px 0;
}

.voucher-metadata-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    border-top: 1px dashed var(--app-border);
    padding-top: 12px;
}

.voucher-metadata-grid .wide {
    grid-column: 1 / -1;
}

.voucher-advanced-json {
    border: 1px dashed var(--app-border);
    border-radius: 8px;
    padding: 10px;
    background: var(--app-surface-soft);
}

.voucher-advanced-json summary {
    color: var(--app-muted-strong);
    font-weight: 800;
    cursor: pointer;
}

.voucher-advanced-json textarea {
    width: 100%;
    min-height: 120px;
    margin-top: 10px;
    border: 1px solid var(--app-border);
    border-radius: 8px;
    padding: 10px;
    color: var(--app-text);
    background: var(--app-surface);
    font-family: Consolas, "Courier New", monospace;
    font-size: 0.82rem;
}

.voucher-validation-card {
    flex: 0 0 auto;
}

.voucher-validation-list p {
    display: grid;
    gap: 4px;
    margin: 0;
    border-radius: 8px;
    padding: 10px;
    font-size: 0.84rem;
}

.voucher-validation-list .blocking {
    border: 1px solid #fecaca;
    background: #fef2f2;
    color: var(--app-danger);
}

.voucher-validation-list .warning {
    border: 1px solid #fde68a;
    background: #fffbeb;
    color: #92400e;
}

.voucher-preview p {
    margin: 0;
    line-height: 1.45;
}

.voucher-modal-footer {
    background: var(--app-surface);
}

/* Painel comercial resumido (CommercialPanel) */

.summary-card {
    display: grid;
    gap: 8px;
    border: 1px solid var(--app-border);
    border-radius: 8px;
    padding: 12px;
    background: var(--app-surface-soft);
}

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

.summary-card-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.request-history {
    display: grid;
    gap: 8px;
    border: 1px dashed var(--app-border);
    border-radius: 8px;
    padding: 10px;
    background: var(--app-surface);
}

.summary-chip.active {
    border-color: var(--app-primary);
    background: rgba(14, 71, 158, 0.08);
}

.summary-card header h4 {
    margin: 0;
    font-size: 0.95rem;
}

.summary-card-title {
    margin: 0;
    font-size: 0.98rem;
    font-weight: 600;
    color: var(--app-text);
}

.summary-card-meta {
    display: flex;
    flex-direction: column;
    gap: 6px;
    color: var(--app-muted);
    font-size: 0.82rem;
    font-weight: 500;
    margin-top: 2px;
}

.summary-contact-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.summary-contact-row svg {
    width: 15px;
    height: 15px;
    flex: 0 0 auto;
    fill: var(--app-muted);
}

.summary-chip-list {
    display: grid;
    gap: 8px;
    margin-top: 4px;
}

.summary-chip {
    display: grid;
    gap: 2px;
    border: 1px solid var(--app-border);
    border-radius: 8px;
    padding: 8px 10px;
    background: var(--app-surface);
    color: var(--app-text);
    text-align: left;
}

.summary-chip:hover {
    border-color: var(--app-primary);
}

.summary-chip small {
    color: var(--app-muted);
    font-weight: 700;
}

/* Drawer navegavel do Pedido (RequestWorkspaceModal) */

.workspace-backdrop {
    z-index: 50;
}

.workspace-modal {
    z-index: 51;
}

.workspace-breadcrumb {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 4px;
    color: var(--app-muted);
    font-size: 0.78rem;
    font-weight: 800;
}

.breadcrumb-link {
    border: 0;
    background: none;
    padding: 0;
    color: var(--app-muted);
    font-size: 0.78rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    cursor: pointer;
}

.breadcrumb-link.active,
.breadcrumb-current {
    color: var(--app-primary);
}

.workspace-summary-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    color: var(--app-muted-strong);
    font-size: 0.85rem;
    font-weight: 700;
}

/* Modais-folha (Contato, Passageiro, Produto) */

.leaf-backdrop {
    z-index: 55;
}

.leaf-panel {
    z-index: 56;
}

.item-form-panel {
    width: min(680px, calc(100vw - 32px));
}

/* Entrada de valores monetarios */

.money-input {
    display: flex;
    align-items: center;
    gap: 6px;
    border: 1px solid var(--app-border);
    border-radius: 8px;
    padding: 0 10px;
    background: var(--app-surface);
}

.money-input span {
    color: var(--app-muted);
    font-size: 0.78rem;
    font-weight: 800;
}

.money-input input {
    flex: 1;
    border: 0;
    padding: 9px 0;
    background: transparent;
    text-align: right;
}

.money-input input:focus {
    outline: none;
}

.settings-backdrop {
    z-index: 40;
}

.settings-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    z-index: 41;
    display: grid;
    grid-template-rows: auto auto minmax(0, 1fr);
    width: min(1080px, calc(100vw - 32px));
    height: min(760px, calc(100vh - 32px));
    overflow: hidden;
    border-radius: 8px;
    background: var(--app-surface);
    box-shadow: var(--shadow-soft);
    transform: translate(-50%, -50%);
}

.settings-modal .modal-header span {
    color: var(--app-muted);
}

.settings-tabs {
    display: flex;
    gap: 8px;
    padding: 14px 18px 0;
    border-top: 1px solid var(--app-border);
}

.settings-tabs button {
    min-height: 38px;
    border: 1px solid var(--app-border);
    border-radius: 8px;
    padding: 0 14px;
    background: var(--app-surface-soft);
    color: var(--app-muted-strong);
    font-weight: 800;
}

.settings-tabs button.active {
    border-color: var(--app-primary);
    background: var(--app-primary);
    color: #ffffff;
}

.settings-body {
    min-height: 0;
    overflow: hidden;
    padding: 18px;
}

.settings-section {
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-height: 0;
    height: 100%;
    overflow: hidden;
    border: 1px solid var(--app-border);
    border-radius: 8px;
    padding: 16px;
    background: var(--app-surface-soft);
}

.settings-state {
    display: grid;
    place-content: center;
    min-height: 220px;
    color: var(--app-muted-strong);
    font-weight: 500;
    text-align: center;
}

.settings-state.error {
    color: var(--app-danger);
}

.settings-grid {
    display: grid;
    grid-template-columns: minmax(280px, 340px) minmax(0, 1fr);
    gap: 16px;
    height: 100%;
    min-height: 0;
}

.settings-list,
.settings-detail,
.settings-users {
    min-height: 0;
    border: 1px solid var(--app-border);
    border-radius: 8px;
    background: var(--app-surface-soft);
}

.settings-list,
.settings-detail,
.settings-users {
    display: flex;
    flex-direction: column;
    gap: 14px;
    overflow: hidden;
    padding: 16px;
}

.settings-panel-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.settings-panel-header h3 {
    margin-bottom: 4px;
    font-size: 1rem;
}

.settings-panel-header p,
.settings-feedback {
    margin: 0;
    color: var(--app-muted);
    font-size: 0.84rem;
}

.settings-feedback.error {
    background: #fef2f2;
    color: var(--app-danger);
}

.position-cards {
    display: grid;
    gap: 10px;
    min-height: 0;
    overflow-y: auto;
    padding-right: 4px;
}

.position-card {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    border: 1px solid var(--app-border);
    border-radius: 8px;
    padding: 12px;
    background: var(--app-surface);
}

.position-card-icon {
    display: inline-grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background: #e7f0fc;
    color: var(--app-primary);
}

.position-card-main {
    display: grid;
    gap: 3px;
    min-width: 0;
}

.position-card-main strong,
.position-card-main span,
.position-card-main small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.position-card-main span {
    color: var(--app-primary);
    font-size: 0.78rem;
    font-weight: 800;
}

.position-card-main small {
    color: var(--app-muted);
    font-size: 0.76rem;
    font-weight: 700;
}

.position-card-actions {
    display: flex;
    gap: 6px;
}

.nested-backdrop {
    z-index: 50;
}

.position-editor {
    position: fixed;
    top: 50%;
    left: 50%;
    z-index: 51;
    display: grid;
    grid-template-rows: auto auto minmax(0, 1fr) auto;
    width: min(680px, calc(100vw - 32px));
    height: min(680px, calc(100vh - 32px));
    overflow: hidden;
    border-radius: 8px;
    background: var(--app-surface);
    box-shadow: var(--shadow-soft);
    transform: translate(-50%, -50%);
}

.modal-header.compact h3 {
    margin: 0;
}

.settings-tabs.compact {
    padding-top: 10px;
}

.position-editor-body {
    display: grid;
    align-content: start;
    gap: 16px;
    min-height: 0;
    overflow-y: auto;
    padding: 18px;
}

.permission-checklist.editor {
    overflow: visible;
}

.position-editor-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    border-top: 1px solid var(--app-border);
    padding: 14px 18px;
    background: var(--app-surface-soft);
}

.position-editor-footer button {
    min-width: 110px;
}

.settings-panel-header button,
.settings-inline button {
    min-height: 38px;
    border: 1px solid var(--app-border);
    border-radius: 8px;
    padding: 0 12px;
    background: var(--app-surface);
    color: var(--app-muted-strong);
    font-weight: 800;
}

.settings-panel-header button.primary {
    border-color: var(--app-primary);
    background: var(--app-primary);
    color: #ffffff;
}

.settings-inline {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
}

.settings-list-items,
.settings-user-list,
.permission-checklist {
    display: grid;
    gap: 8px;
    min-height: 0;
    overflow-y: auto;
}

.settings-list-item {
    display: grid;
    gap: 4px;
    width: 100%;
    border: 1px solid transparent;
    border-radius: 8px;
    padding: 11px 12px;
    background: var(--app-surface);
    color: var(--app-text);
    text-align: left;
}

.settings-list-item.selected,
.settings-list-item:hover {
    border-color: #bbd3fb;
    background: #e7f0fc;
}

.settings-list-item span {
    color: var(--app-muted);
    font-size: 0.78rem;
    font-weight: 700;
}

.permission-row {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: flex-start;
    gap: 10px;
    border: 1px solid var(--app-border);
    border-radius: 8px;
    padding: 12px;
    background: var(--app-surface);
}

.permission-row span {
    display: grid;
    gap: 4px;
}

.permission-row small {
    color: var(--app-muted);
}

.settings-feedback {
    border-radius: 8px;
    padding: 10px 12px;
    background: #e0f2fe;
    color: #075985;
    font-weight: 800;
}

.settings-user-list {
    padding-right: 4px;
}

.settings-user-card {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 14px;
    align-items: center;
    border: 1px solid var(--app-border);
    border-radius: 8px;
    padding: 12px;
    background: var(--app-surface);
}

.settings-user-main {
    display: grid;
    gap: 4px;
    min-width: 0;
}

.settings-user-card span,
.settings-user-card small,
.settings-user-card label span {
    overflow: hidden;
    color: var(--app-muted);
    font-size: 0.78rem;
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-list-avatar {
    width: 40px;
    height: 40px;
    font-size: 0.76rem;
}

.settings-user-actions {
    display: flex;
    gap: 6px;
}

.settings-user-card select {
    min-height: 38px;
    border: 1px solid var(--app-border);
    border-radius: 8px;
    padding: 0 10px;
    background: var(--app-surface-soft);
    color: var(--app-text);
}

.user-editor {
    position: fixed;
    top: 50%;
    left: 50%;
    z-index: 51;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
    width: min(720px, calc(100vw - 32px));
    max-height: min(760px, calc(100vh - 32px));
    overflow: hidden;
    border-radius: 8px;
    background: var(--app-surface);
    box-shadow: var(--shadow-soft);
    transform: translate(-50%, -50%);
}

.user-editor-body {
    display: grid;
    align-content: start;
    gap: 16px;
    min-height: 0;
    overflow-y: auto;
    padding: 18px;
}

.user-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.user-form-grid input,
.user-form-grid select {
    min-height: 42px;
    width: 100%;
    border: 1px solid var(--app-border);
    border-radius: 8px;
    padding: 9px 10px;
    color: var(--app-text);
    background: var(--app-surface);
}

.user-role-field {
    align-content: start;
    border: 1px solid var(--app-border);
    border-radius: 8px;
    padding: 10px 12px;
    background: var(--app-surface-soft);
}

.user-role-field small {
    color: var(--app-muted);
    font-weight: 600;
}

.position-editor-footer button.primary {
    border-color: var(--app-primary);
    background: var(--app-primary);
    color: #ffffff;
}

.blazor-error-boundary {
    padding: 1rem;
    color: #ffffff;
    background: var(--app-danger);
}

.blazor-error-boundary::after {
    content: "Ocorreu um erro.";
}


@media (max-width: 1023px) {
    .travel-crm {
        grid-template-columns: minmax(280px, 340px) minmax(0, 1fr);
    }

    .travel-crm.details-open {
        grid-template-columns: minmax(280px, 320px) minmax(0, 1fr) minmax(260px, 300px);
    }

    .travel-crm.details-closed .details-panel {
        display: none;
    }
}

@media (max-width: 767px) {
    .travel-crm {
        grid-template-columns: 1fr;
        height: 100%;
        overflow: hidden;
    }

    .conversation-list {
        height: 42vh;
        border-right: 0;
        border-bottom: 1px solid var(--app-border);
    }

    .chat-panel {
        height: 58vh;
        min-height: 520px;
    }

    .chat-header,
    .composer {
        align-items: stretch;
        flex-direction: column;
    }

    .chat-actions {
        width: 100%;
    }

    .chat-actions button,
    .composer > button {
        flex: 1;
    }

    .message-stream {
        padding: 16px;
    }

    .message-bubble {
        width: 92%;
    }

    .details-panel {
        height: auto;
        max-height: 60vh;
        border-left: 0;
        border-top: 1px solid var(--app-border);
    }

    .settings-modal {
        width: calc(100vw - 16px);
        height: calc(100vh - 16px);
    }

    .settings-tabs {
        overflow-x: auto;
    }

    .settings-body {
        padding: 12px;
        overflow-y: auto;
    }

    .settings-grid {
        grid-template-columns: 1fr;
        height: auto;
    }

    .settings-panel-header,
    .settings-user-card {
        grid-template-columns: 1fr;
    }

    .settings-panel-header {
        flex-direction: column;
    }

    .settings-inline {
        grid-template-columns: 1fr;
    }

    .position-card {
        grid-template-columns: auto minmax(0, 1fr);
    }

    .position-card-actions {
        grid-column: 1 / -1;
        justify-content: flex-end;
    }

    .position-editor {
        width: calc(100vw - 16px);
        height: calc(100vh - 16px);
    }

    .user-editor {
        width: calc(100vw - 16px);
        max-height: calc(100vh - 16px);
    }

    .user-form-grid {
        grid-template-columns: 1fr;
    }

    .settings-user-actions {
        justify-content: flex-end;
    }

    .voucher-modal {
        inset: 8px;
    }

    .voucher-modal-body {
        padding: 12px;
        overflow-y: auto;
    }

    .voucher-layout,
    .voucher-summary-grid,
    .voucher-metadata-grid {
        grid-template-columns: 1fr;
        height: auto;
    }

    .voucher-main,
    .voucher-side {
        overflow: visible;
    }

    .voucher-modal-footer {
        align-items: stretch;
        flex-direction: column;
    }
}

/* Corte 1B - Tags e Respostas rapidas (CRM/Chatbot core) */

.field-hint {
    margin: -8px 0 0;
    color: var(--app-muted);
    font-size: 0.78rem;
}

.contact-tags-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin-top: 4px;
}

.tag-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    border: 1px solid var(--tag-color, var(--app-border));
    border-radius: 999px;
    padding: 3px 8px 3px 10px;
    background: var(--tag-color, var(--app-surface-soft));
    color: var(--tag-on-color, var(--app-text));
    font-size: 0.76rem;
    font-weight: 700;
}

.tag-chip-remove {
    display: inline-grid;
    place-items: center;
    width: 16px;
    height: 16px;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--app-muted-strong);
    font-size: 0.85rem;
    line-height: 1;
}

.tag-chip-remove:hover {
    background: rgba(0, 0, 0, 0.08);
}

.tag-chip-add {
    min-height: 26px;
    border: 1px dashed var(--app-border);
    border-radius: 999px;
    padding: 0 8px;
    background: transparent;
    color: var(--app-muted-strong);
    font-size: 0.76rem;
    font-weight: 700;
}

.quick-reply-variables {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
}

.quick-reply-variables span {
    color: var(--app-muted);
    font-size: 0.78rem;
    font-weight: 700;
}

.quick-reply-variable-chip {
    border: 1px solid var(--app-border);
    border-radius: 999px;
    padding: 3px 10px;
    background: var(--app-surface-soft);
    color: var(--app-primary);
    font-size: 0.76rem;
    font-weight: 800;
}

.quick-reply-variable-chip:hover {
    border-color: var(--app-primary);
}

.composer-quick-reply-anchor {
    position: relative;
    flex: 0 0 auto;
}

/* UNICHAT-CRM-INBOX-EXPERIENCE-COMPLETION-01 §9 — popover de Respostas Rápidas alinhado ao Design
   System Uni: tokens --crm-*, cantos arredondados, borda discreta, elevação coerente, tipografia
   sem excesso de bold, fechamento claro, foco visível. */
.quick-reply-popover {
    position: absolute;
    bottom: calc(100% + 8px);
    left: 0;
    z-index: 40;
    display: grid;
    grid-template-rows: auto auto minmax(0, 1fr);
    width: min(360px, calc(100vw - 32px));
    max-height: 360px;
    overflow: hidden;
    border: 1px solid var(--crm-color-border);
    border-radius: var(--crm-radius-lg);
    background: var(--crm-color-surface);
    box-shadow: var(--crm-shadow-md);
}

.quick-reply-popover-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 8px 10px 14px;
    border-bottom: 1px solid var(--crm-color-border);
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--crm-color-text);
}

.quick-reply-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border: 0;
    border-radius: var(--crm-radius-sm);
    background: transparent;
    color: var(--crm-color-text-muted);
    cursor: pointer;
}
.quick-reply-close:hover { background: var(--crm-color-primary-soft); color: var(--crm-color-primary); }
.quick-reply-close:focus-visible { outline: 2px solid var(--crm-color-primary); outline-offset: 1px; }
.quick-reply-close .crm-icon { width: 15px; height: 15px; }

.quick-reply-search-field {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 12px;
    border-bottom: 1px solid var(--crm-color-border);
    background: var(--crm-color-surface);
    color: var(--crm-color-text-muted);
}
.quick-reply-search-field .crm-icon { width: 15px; height: 15px; flex: 0 0 auto; }
.quick-reply-search-field:focus-within { color: var(--crm-color-primary); }

.quick-reply-search {
    flex: 1 1 auto;
    min-width: 0;
    min-height: 40px;
    border: 0;
    padding: 0;
    background: transparent;
    color: var(--crm-color-text);
    font-size: 0.82rem;
}
.quick-reply-search:focus { outline: none; }
.quick-reply-search::placeholder { color: var(--crm-color-text-muted); }

.quick-reply-popover-state {
    padding: 16px 12px;
    color: var(--crm-color-text-muted);
    font-size: 0.8rem;
    text-align: center;
}

.quick-reply-popover-state.error {
    color: var(--crm-color-danger);
}

.quick-reply-popover-list {
    display: grid;
    gap: 1px;
    margin: 0;
    padding: 6px;
    overflow-y: auto;
    list-style: none;
}

.quick-reply-popover-list button {
    display: grid;
    gap: 3px;
    width: 100%;
    border: 0;
    border-radius: var(--crm-radius-sm);
    padding: 8px 10px;
    background: transparent;
    color: var(--crm-color-text);
    text-align: left;
    cursor: pointer;
}

.quick-reply-popover-list button:hover {
    background: var(--crm-color-primary-soft);
}
.quick-reply-popover-list button:focus-visible {
    outline: 2px solid var(--crm-color-primary);
    outline-offset: -2px;
}

.quick-reply-popover-list button strong {
    color: var(--crm-color-primary);
    font-size: 0.8rem;
    font-weight: 600;
}

.quick-reply-popover-list button span {
    overflow: hidden;
    color: var(--crm-color-text-muted);
    font-size: 0.78rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}
