/* Glow Background */

.glow {
      position: fixed;
      border-radius: 50%;
      filter: blur(120px);
      pointer-events: none;
      width: 40vw;
      height: 40vw;
    }

    .glow-a {
      top: -10%;
      left: -10%;
      background: hsla(var(--bulma-primary-h), var(--bulma-primary-s), var(--bulma-primary-l), 0.08);
    }

    .glow-b {
      bottom: -10%;
      right: -10%;
      background: hsla(var(--bulma-info-h), var(--bulma-info-s), var(--bulma-info-l), 0.08);
    }


/* Shell de Navegação e Layout Principal Redesenhar — Aquário Travel */

.app-shell {
    display: flex;
    min-height: 100vh;
    width: 100%;
}

/* Sidebar Fixa (280px) com Design Escuro Profundo e Elegante */
/* BANNER FIXO DE IMPERSONAÇÃO — sempre visível no topo, empurra sidebar/header
   sticky pra baixo (ver body.tem-impersonacao-ativa) enquanto durar. */
.impersonacao-banner {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 40px;
    z-index: 1000;
    background: linear-gradient(90deg, #7c2d12 0%, #9a3412 100%);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    font-size: 0.82rem;
    font-weight: 600;
    padding: 0 16px;
}

.impersonacao-banner .material-symbols-outlined {
    font-size: 18px;
}

.impersonacao-banner-cronometro {
    font-family: var(--font-mono);
    background: rgba(255, 255, 255, 0.15);
    padding: 2px 10px;
    border-radius: 999px;
}

.impersonacao-banner button {
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: #fff;
    padding: 4px 12px;
    border-radius: 6px;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.impersonacao-banner button:hover {
    background: rgba(255, 255, 255, 0.25);
}

body.tem-impersonacao-ativa {
    padding-top: 40px;
}

body.tem-impersonacao-ativa .app-sidebar {
    top: 40px;
}

body.tem-impersonacao-ativa .app-top-header {
    top: 40px;
}

@media (max-width: 700px) {
    .impersonacao-banner {
        font-size: 0.72rem;
        gap: 6px;
        padding: 0 8px;
    }

    .impersonacao-banner span:not(.impersonacao-banner-cronometro):not(.material-symbols-outlined) {
        display: none;
    }
}

.app-sidebar {
    width: 280px;
    background-color: var(--aq-navy-dark);
    border-right: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 100;
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.12);
    transition: width 0.2s ease;
}

.sidebar-brand-text {
    min-width: 0;
    overflow: hidden;
}

.btn-colapsar-sidebar,
.btn-fechar-sidebar-mobile {
    display: none;
    background: none;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    padding: 6px;
    border-radius: var(--radius-sm);
    transition: all 0.15s ease;
    margin-left: auto;
    flex-shrink: 0;
}

.btn-colapsar-sidebar:hover,
.btn-fechar-sidebar-mobile:hover {
    background-color: rgba(255, 255, 255, 0.08);
    color: #ffffff;
}

.btn-colapsar-sidebar .material-symbols-outlined,
.btn-fechar-sidebar-mobile .material-symbols-outlined {
    font-size: 22px;
}

/* Backdrop do drawer mobile — escondido por padrão, só existe no breakpoint mobile */
.sidebar-backdrop {
    display: none;
}

/* Tooltip da sidebar colapsada — criado/posicionado via JS e anexado no
   <body> (ver sidebar.js), pra escapar do overflow:auto de .sidebar-nav. */
.sidebar-tooltip-flutuante {
    position: fixed;
    transform: translateY(-50%);
    background-color: var(--aq-navy-dark);
    color: #ffffff;
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    font-size: 0.78rem;
    font-weight: 600;
    white-space: nowrap;
    z-index: 500;
    box-shadow: var(--shadow-md);
    pointer-events: none;
}

.sidebar-header {
    height: 76px;
    display: flex;
    align-items: center;
    padding: 0 22px;
    gap: 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.sidebar-brand-link {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    text-decoration: none;
    max-width: 195px;
    flex: 1;
}

.sidebar-colapsada .sidebar-brand-link {
    display:none;
}

.sidebar-logo-img {
    height: 38px;
    width: auto;
    max-width: 100%;
    object-fit: contain;
}

.sidebar-badge-admin {
    font-family: var(--font-mono);
    font-size: 0.62rem;
    color: #38bdf8;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 700;
}

.sidebar-nav {
    flex: 1;
    padding: 20px 14px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    overflow-y: auto;
}

.nav-section-title {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    font-weight: 700;
    color: #64748b;
    padding: 16px 12px 6px 12px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-radius: var(--radius-md);
    color: #94a3b8;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
    position: relative;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-link:hover {
    background-color: rgba(255, 255, 255, 0.05);
    color: #ffffff;
}

.nav-link.active {
    background-color: rgba(37, 99, 235, 0.15);
    color: #ffffff;
    font-weight: 600;
}

.nav-link.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 6px;
    bottom: 6px;
    width: 4px;
    border-radius: 0 4px 4px 0;
    background-color: var(--aq-accent-blue);
}

.nav-link.active .material-symbols-outlined {
    color: #60a5fa;
}

.sidebar-footer {
    padding: 16px 18px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    display: flex;
    align-items: center;
    gap: 12px;
    background-color: rgba(0, 0, 0, 0.2);
}

.user-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #60a5fa;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
    font-family: var(--font-mono);
}

.user-info {
    flex: 1;
    overflow: hidden;
}

.user-name {
    font-size: 0.82rem;
    font-weight: 600;
    color: #f1f5f9;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-role {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    color: #64748b;
    letter-spacing: 0.04em;
}

/* Área de Conteúdo Principal */
.app-main-wrapper {
    margin-left: 280px;
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    transition: margin-right 0.2s ease;
}

/* Header Glassmorphism (76px height) */
.app-top-header {
    height: 76px;
    background-color: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--aq-neutral-border);
    position: sticky;
    top: 0;
    z-index: 90;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 36px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03);
}

.header-breadcrumbs {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.88rem;
    color: var(--aq-neutral-muted);
}

.btn-hamburguer-mobile {
    display: none;
    background: none;
    border: none;
    color: var(--aq-neutral-text);
    cursor: pointer;
    padding: 6px;
    border-radius: var(--radius-sm);
    margin-right: 6px;
}

.btn-hamburguer-mobile:hover {
    background-color: var(--aq-surface-subtle);
}

.btn-hamburguer-mobile .material-symbols-outlined {
    font-size: 24px;
}

/* Mini-logo que aparece na navbar quando a sidebar está colapsada (desktop) */
.header-logo-mini {
    display: none;
    align-items: center;
    justify-content: center;
    height: 34px;
    margin-right: 8px;
    flex-shrink: 0;
}

.header-logo-img {
    height: 32px;
    width: auto;
    object-fit: contain;
}

@media (min-width: 769px) {
    .app-shell.sidebar-colapsada .header-logo-mini {
        display: flex;
    }
}

.breadcrumb-current {
    font-weight: 600;
    color: var(--aq-navy-dark);
}

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

.header-icon-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid var(--aq-neutral-border);
    background: var(--aq-surface-white);
    color: var(--aq-neutral-text);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.header-avatar-img { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; }

/* Menu da foto (só no celular — header-mais.js): Notificações, Carrinho, Como usar, Minha Conta e Sair. */
.header-mais { display: none; }
.header-mais-btn { position: relative; padding: 0; overflow: visible; }
.header-mais-btn .header-avatar-img { width: 36px; height: 36px; }
.header-mais-menu { width: 260px; padding: 6px 0; }
.header-mais-quem { padding: 8px 16px 10px; font-size: 12px; color: var(--aq-neutral-muted, #64748b); border-bottom: 1px solid var(--aq-neutral-border); margin-bottom: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.header-mais-item { display: flex; align-items: center; gap: 12px; width: 100%; padding: 11px 16px; border: 0; background: none; font: inherit; font-size: 14px; color: var(--aq-neutral-text); text-align: left; text-decoration: none; cursor: pointer; }
.header-mais-item:hover, .header-mais-item:focus-visible { background: var(--aq-surface-subtle); color: var(--aq-navy-dark); text-decoration: none; }
.header-mais-item .material-symbols-outlined { font-size: 20px; color: var(--aq-neutral-muted, #64748b); }
.header-mais-qtd { margin-left: auto; min-width: 20px; padding: 1px 7px; border-radius: 999px; background: #ef4444; color: #fff; font-size: 11px; font-weight: 700; text-align: center; }
.header-mais-qtd-neutra { background: var(--aq-accent-blue, #2563eb); }
.header-mais-sair { border-top: 1px solid var(--aq-neutral-border); margin-top: 4px; color: #b91c1c; }
.header-mais-sair .material-symbols-outlined { color: #b91c1c; }

.header-icon-btn:hover {
    background: var(--aq-surface-subtle);
    color: var(--aq-navy-dark);
    border-color: #cbd5e1;
    transform: translateY(-1px);
}

/* Central de Notificações — sino do header */
.notif-bell-wrapper {
    position: relative;
}

.notif-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    min-width: 16px;
    height: 16px;
    padding: 0 3px;
    border-radius: 8px;
    background-color: #ef4444;
    color: #fff;
    font-size: 0.65rem;
    font-weight: 700;
    line-height: 16px;
    text-align: center;
    border: 2px solid var(--aq-surface-white);
}

.notif-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    width: 360px;
    max-width: calc(100vw - 32px);
    background: var(--aq-surface-white);
    border: 1px solid var(--aq-neutral-border);
    border-radius: var(--radius-lg, 12px);
    box-shadow: var(--shadow-md, 0 8px 24px rgba(0, 0, 0, 0.12));
    z-index: 200;
    overflow: hidden;
}

.notif-dropdown.notif-dropdown-aberto {
    display: block;
}

.notif-dropdown-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    border-bottom: 1px solid var(--aq-neutral-border);
}

.notif-dropdown-title {
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--aq-navy-dark);
}

.notif-marcar-todas {
    background: none;
    border: none;
    cursor: pointer;
    color: #2563eb;
    font-size: 0.75rem;
    font-weight: 600;
}

.notif-list {
    max-height: 380px;
    overflow-y: auto;
}

.notif-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--aq-surface-subtle);
    text-decoration: none;
    color: inherit;
    cursor: pointer;
    transition: background-color 0.15s ease;
}

.notif-item:hover {
    background-color: var(--aq-surface-subtle);
}

.notif-item-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: #2563eb;
    margin-top: 6px;
    flex-shrink: 0;
}

.notif-item-lida .notif-item-dot {
    background-color: transparent;
}

.notif-item-titulo {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--aq-navy-dark);
}

.notif-item-lida .notif-item-titulo {
    font-weight: 500;
    color: var(--aq-neutral-text);
}

.notif-item-mensagem {
    font-size: 0.78rem;
    color: var(--aq-neutral-muted, #64748b);
    margin-top: 2px;
}

.notif-item-tempo {
    font-size: 0.7rem;
    color: var(--aq-neutral-muted, #94a3b8);
    margin-top: 4px;
}

.notif-empty {
    padding: 32px 16px;
    text-align: center;
    font-size: 0.82rem;
    color: var(--aq-neutral-muted, #64748b);
}

.notif-dropdown-footer {
    display: block;
    text-align: center;
    padding: 12px 16px;
    font-size: 0.8rem;
    font-weight: 600;
    color: #2563eb;
    text-decoration: none;
    border-top: 1px solid var(--aq-neutral-border);
}

.notif-dropdown-footer:hover {
    background-color: var(--aq-surface-subtle);
}

.cbda-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    background-color: var(--aq-mint-bg);
    color: var(--aq-mint-text);
    border: 1px solid #a7f3d0;
    padding: 6px 14px;
    border-radius: 20px;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.cbda-badge .material-symbols-outlined {
    font-size: 16px;
    color: var(--aq-mint-dot);
}

/* BUSCA GLOBAL DA NAVBAR */
.busca-global-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    flex: 1;
    max-width: 480px;
    margin: 0 24px;
    background-color: var(--aq-surface-subtle);
    border: 1px solid var(--aq-neutral-border);
    border-radius: 999px;
    padding: 0 14px;
    height: 40px;
    transition: border-color 0.15s ease, background-color 0.15s ease;
}

.busca-global-wrapper:focus-within {
    border-color: var(--aq-navy-dark);
    background-color: var(--aq-surface-white);
}

.busca-global-icone {
    color: var(--aq-neutral-muted);
    font-size: 20px;
    flex-shrink: 0;
}

.busca-global-input {
    border: none;
    background: transparent;
    outline: none;
    flex: 1;
    padding: 0 10px;
    font-size: 0.85rem;
    color: var(--aq-navy-dark);
    font-family: inherit;
}

.busca-global-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    background: var(--aq-surface-white);
    border: 1px solid var(--aq-neutral-border);
    border-radius: var(--radius-lg, 12px);
    box-shadow: var(--shadow-md, 0 8px 24px rgba(0, 0, 0, 0.12));
    z-index: 200;
    max-height: 70vh;
    overflow-y: auto;
}

.busca-global-dropdown.busca-global-dropdown-aberto {
    display: block;
}

.busca-global-categoria-titulo {
    padding: 10px 16px 4px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--aq-neutral-muted);
}

.busca-global-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    text-decoration: none;
    color: inherit;
    cursor: pointer;
    transition: background-color 0.15s ease;
}

.busca-global-item:hover {
    background-color: var(--aq-surface-subtle);
}

.busca-global-item-icone {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background-color: var(--aq-surface-subtle);
    color: var(--aq-neutral-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.busca-global-item-icone .material-symbols-outlined {
    font-size: 18px;
}

.busca-global-item-texto {
    min-width: 0;
    flex: 1;
}

.busca-global-item-titulo {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--aq-navy-dark);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.busca-global-item-subtitulo {
    font-size: 0.75rem;
    color: var(--aq-neutral-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.busca-global-vazio,
.busca-global-carregando {
    padding: 24px 16px;
    text-align: center;
    font-size: 0.82rem;
    color: var(--aq-neutral-muted);
}

@media (max-width: 900px) {
    .busca-global-wrapper {
        display: none;
    }
}

/* Tenant Switcher Select Dropdown */
.tenant-switcher-select {
    background-color: var(--aq-mint-bg);
    color: var(--aq-mint-text);
    border: 1px solid #a7f3d0;
    padding: 6px 14px;
    border-radius: 20px;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    outline: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.tenant-switcher-select:focus {
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2);
}

.app-content-body {
    padding: 32px 36px 60px 36px;
}

/* ───────────────────────────────────────────────
   Sidebar colapsada (desktop — só ícones + tooltip)
   ─────────────────────────────────────────────── */
@media (min-width: 769px) {
    .btn-colapsar-sidebar {
        display: inline-flex;
    }

    .app-shell.sidebar-colapsada .app-sidebar {
        width: 76px;
    }

    .app-shell.sidebar-colapsada .app-main-wrapper {
        margin-left: 76px;
    }

    .app-shell.sidebar-colapsada .sidebar-header {
        padding: 0 16px;
        justify-content: center;
        gap: 0;
    }

    .app-shell.sidebar-colapsada .sidebar-brand-text,
    .app-shell.sidebar-colapsada .sidebar-logo-icon {
        display: none;
    }

    .app-shell.sidebar-colapsada .btn-colapsar-sidebar {
        margin-left: 0;
        transform: rotate(180deg);
    }

    .app-shell.sidebar-colapsada .nav-section-title {
        height: 1px;
        margin: 16px 10px 10px 10px;
        padding: 0;
        background: rgba(255, 255, 255, 0.08);
        font-size: 0;
        overflow: hidden;
    }

    .app-shell.sidebar-colapsada .nav-link {
        justify-content: center;
        padding: 12px;
        position: relative;
    }

    .app-shell.sidebar-colapsada .nav-link span:not(.material-symbols-outlined) {
        display: none;
    }

    .app-shell.sidebar-colapsada .sidebar-footer {
        justify-content: center;
        padding: 16px 8px;
    }

    .app-shell.sidebar-colapsada .user-info {
        display: none;
    }
}

/* ───────────────────────────────────────────────
   Mobile — sidebar vira drawer (escondida por padrão, some por cima do conteúdo)
   ─────────────────────────────────────────────── */
@media (max-width: 768px) {
    .app-sidebar {
        width: 280px;
        transform: translateX(-100%);
        transition: transform 0.25s ease;
        z-index: 300;
    }

    .app-shell.sidebar-mobile-aberta .app-sidebar {
        transform: translateX(0);
    }

    .app-main-wrapper {
        margin-left: 0;
    }

    .btn-colapsar-sidebar {
        display: none;
    }

    .btn-fechar-sidebar-mobile,
    .btn-hamburguer-mobile {
        display: inline-flex;
    }

    .sidebar-backdrop {
        position: fixed;
        inset: 0;
        background-color: rgba(0, 0, 0, 0.5);
        z-index: 250;
    }

    .app-shell.sidebar-mobile-aberta .sidebar-backdrop {
        display: block;
    }

    .app-top-header {
        padding: 0 16px;
    }

    .app-content-body {
        padding: 20px 16px 40px 16px;
    }

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

    /* Celular: só a foto (o resto abre nela) — e as janelas de notificações/carrinho ficam presas ao topo da tela,
       já que os botões delas não aparecem. */
    .header-so-desktop { display: none !important; }
    .header-mais { display: block; }
    .header-actions .notif-dropdown {
        position: fixed;
        top: 70px;
        left: 12px;
        right: 12px;
        width: auto;
        max-width: none;
    }
    .header-actions .header-mais-menu { left: auto; width: 260px; max-width: calc(100vw - 24px); }
    body.tem-impersonacao-ativa .header-actions .notif-dropdown { top: 110px; }

    .cbda-badge span:not(.material-symbols-outlined),
    .tenant-switcher-select {
        max-width: min(210px, 52vw); /* com só a foto ao lado, cabe o nome da entidade */
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
}

/* Assistente de Ajuda — botão flutuante + painel de chat.
   FAB e painel são posicionados de forma INDEPENDENTE (cada um com seu
   próprio position:fixed), não empilhados via flex dentro de .guia-chat-widget
   — um flex-column bottom-anchored faria o painel "empurrar" o FAB pra cima
   quando abre (o FAB deixa de ficar no canto e passa a flutuar acima do
   painel), que é exatamente o bug de o botão de fechar não ficar no mesmo
   lugar do botão de abrir. .guia-chat-widget vira só um contêiner lógico,
   sem posicionamento próprio. */
.guia-chat-widget {
    z-index: 900;
}

.guia-chat-fab {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 901;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: none;
    background: var(--aq-accent-blue);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: var(--shadow-lg);
    transition: transform 0.15s ease, background-color 0.15s ease;
}

.guia-chat-fab:hover {
    transform: scale(1.05);
    background: var(--aq-navy-hover, #1a2234);
}

.guia-chat-fab .material-symbols-outlined {
    font-size: 26px;
}

.guia-chat-fab-icon-close {
    display: none;
}

.guia-chat-widget.guia-chat-aberto .guia-chat-fab-icon-open {
    display: none;
}

.guia-chat-widget.guia-chat-aberto .guia-chat-fab-icon-close {
    display: block;
}

.guia-chat-panel {
    /* display:none aqui (em vez de confiar só no atributo [hidden]) porque
       [hidden] e .guia-chat-panel têm a mesma especificidade (0,1,0) — uma
       regra de autor com display:flex venceria o UA stylesheet do [hidden]
       e o painel ficaria sempre visível, abrindo sozinho e ignorando o
       botão de fechar. .guia-chat-aberto (0,2,0) é quem decide de verdade. */
    display: none;
    position: fixed;
    right: 24px;
    bottom: 92px;
    /* 24 (margem do FAB) + 56 (altura do FAB) + 12 (respiro) */
    z-index: 900;
    width: 380px;
    max-width: calc(100vw - 48px);
    height: 520px;
    max-height: calc(100vh - 120px);
    background: var(--color-surface, #ffffff);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--aq-neutral-border-subtle, #e2e8f0);
    flex-direction: column;
    overflow: hidden;
}

.guia-chat-widget.guia-chat-aberto .guia-chat-panel {
    display: flex;
}

.guia-chat-header-acoes {
    display: flex;
    align-items: center;
    gap: 4px;
}

.guia-chat-btn-dock {
    background: transparent;
    border: none;
    color: #fff;
    cursor: pointer;
    display: none;
    align-items: center;
    padding: 4px;
    border-radius: 6px;
    opacity: 0.85;
}

.guia-chat-btn-dock:hover {
    opacity: 1;
    background: rgba(255, 255, 255, 0.12);
}

.guia-chat-dock-icon-desafixar {
    display: none;
}

.guia-chat-widget.guia-chat-dockado .guia-chat-dock-icon-fixar {
    display: none;
}

.guia-chat-widget.guia-chat-dockado .guia-chat-dock-icon-desafixar {
    display: block;
}

/* Dockar na lateral — só em telas de desktop (a mesma faixa usada no resto
   do layout pra distinguir mobile, ver @media max-width:700px logo abaixo).
   Fica dentro do media query pra a regra nem existir em telas pequenas —
   assim, mesmo que a preferência "dockado" tenha sido salva num acesso
   anterior pelo desktop, redimensionar a janela pra largura de celular volta
   sozinho pro layout flutuante padrão, sem precisar de JS pra isso. */
@media (min-width: 701px) {
    .guia-chat-btn-dock {
        display: flex;
    }

    .guia-chat-widget.guia-chat-dockado .guia-chat-panel {
        top: 0;
        right: 0;
        bottom: 0;
        left: auto;
        width: 400px;
        max-width: 400px;
        height: 100vh;
        max-height: 100vh;
        border-radius: 0;
        border-top: none;
        border-bottom: none;
        border-right: none;
    }

    /* Só some o FAB quando o painel dockado está de fato visível — "dockado"
       sozinho é só a preferência de layout (persiste mesmo com o chat
       fechado); se escondesse o FAB nesse caso, fechar o chat dockado não
       deixaria nenhum jeito de reabri-lo. */
    .guia-chat-widget.guia-chat-dockado.guia-chat-aberto .guia-chat-fab {
        display: none;
    }

    /* Empurra o conteúdo principal (não só sobrepõe) quando o chat está
       dockado E aberto — classe no <body>, alternada via JS, porque o
       widget do chat e .app-main-wrapper são irmãos distantes no DOM (mesmo
       padrão já usado pelo banner de impersonação, ver body.tem-impersonacao-ativa
       no topo deste arquivo). Só existe dentro deste media query pelo mesmo
       motivo do resto do bloco — sem isso, redimensionar a janela pra
       largura de celular deixaria o conteúdo espremido à toa mesmo com o
       painel já revertido pro layout flutuante.  */
    body.guia-chat-dock-ativo .app-main-wrapper {
        margin-right: 400px;
    }
}

.guia-chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 14px 16px;
    background: var(--aq-navy-dark);
    color: #fff;
    flex-shrink: 0;
}

.guia-chat-header-info {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.guia-chat-header-info strong {
    display: block;
    font-size: 0.9rem;
}

.guia-chat-header-sub {
    display: block;
    font-size: 0.72rem;
    opacity: 0.75;
}

.guia-chat-fechar,
.guia-chat-btn-reiniciar {
    background: transparent;
    border: none;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    padding: 4px;
    border-radius: 6px;
    opacity: 0.85;
}

.guia-chat-fechar:hover,
.guia-chat-btn-reiniciar:hover {
    opacity: 1;
    background: rgba(255, 255, 255, 0.12);
}

.guia-chat-mensagens {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.guia-chat-mensagem {
    display: flex;
}

.guia-chat-mensagem-usuario {
    justify-content: flex-end;
}

.guia-chat-mensagem-assistente {
    justify-content: flex-start;
}

.guia-chat-bolha {
    max-width: 85%;
    padding: 10px 13px;
    border-radius: 14px;
    font-size: 0.85rem;
    line-height: 1.45;
    white-space: pre-wrap;
    word-break: break-word;
}

.guia-chat-mensagem-usuario .guia-chat-bolha {
    background: var(--aq-accent-blue);
    color: #fff;
    border-bottom-right-radius: 4px;
}

.guia-chat-mensagem-assistente .guia-chat-bolha {
    background: var(--aq-accent-light, #eff6ff);
    color: var(--aq-neutral-text, #0f172a);
    border-bottom-left-radius: 4px;
}

/* Cartão de confirmação de ação (ex: propor abrir um chamado) — mesma bolha
   base, mas com espaço pra detalhes estruturados + botões, em vez de só texto. */
.guia-chat-proposta-acao {
    max-width: 92%;
    background: var(--color-surface, #ffffff);
    border: 1px solid var(--aq-accent-border, #bfdbfe);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.guia-chat-proposta-resumo {
    font-size: 0.85rem;
}

.guia-chat-proposta-detalhes {
    margin: 0;
    background: var(--aq-accent-light, #eff6ff);
    border-radius: var(--radius-sm);
    padding: 8px 10px;
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 4px 10px;
}

.guia-chat-proposta-detalhes dt {
    font-weight: 600;
    font-size: 0.75rem;
    color: var(--aq-neutral-text-muted, #64748b);
    white-space: nowrap;
}

.guia-chat-proposta-detalhes dd {
    margin: 0;
    font-size: 0.8rem;
    word-break: break-word;
}

.guia-chat-proposta-botoes {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

.guia-chat-proposta-confirmar,
.guia-chat-proposta-cancelar {
    border: none;
    border-radius: var(--radius-sm);
    padding: 6px 14px;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
}

.guia-chat-proposta-confirmar {
    background: var(--aq-accent-blue);
    color: #fff;
}

.guia-chat-proposta-cancelar {
    background: transparent;
    color: var(--aq-neutral-text-muted, #64748b);
    border: 1px solid var(--aq-neutral-border-subtle, #e2e8f0);
}

.guia-chat-proposta-confirmar:disabled,
.guia-chat-proposta-cancelar:disabled {
    opacity: 0.6;
    cursor: default;
}

.guia-chat-digitando {
    padding: 0 16px 8px 16px;
    flex-shrink: 0;
}

.guia-chat-bolha-digitando {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 12px 14px;
}

.guia-chat-bolha-digitando span {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--aq-accent-blue);
    opacity: 0.5;
    animation: guia-chat-piscar 1.2s infinite ease-in-out;
}

.guia-chat-bolha-digitando span:nth-child(2) {
    animation-delay: 0.15s;
}

.guia-chat-bolha-digitando span:nth-child(3) {
    animation-delay: 0.3s;
}

@keyframes guia-chat-piscar {

    0%,
    80%,
    100% {
        opacity: 0.3;
        transform: scale(0.85);
    }

    40% {
        opacity: 1;
        transform: scale(1);
    }
}

.guia-chat-form {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    padding: 12px;
    border-top: 1px solid var(--aq-neutral-border-subtle, #e2e8f0);
    flex-shrink: 0;
}

.guia-chat-input {
    flex: 1;
    resize: none;
    border: 1px solid var(--aq-neutral-border-subtle, #e2e8f0);
    border-radius: var(--radius-md);
    padding: 9px 12px;
    font-size: 0.85rem;
    font-family: inherit;
    max-height: 120px;
    min-height: 38px;
}

.guia-chat-input:focus {
    outline: none;
    border-color: var(--aq-accent-blue);
}

.guia-chat-enviar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: none;
    background: var(--aq-accent-blue);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
}

.guia-chat-enviar:disabled {
    opacity: 0.6;
    cursor: default;
}

.guia-chat-enviar .material-symbols-outlined {
    font-size: 18px;
}

@media (max-width: 700px) {
    .guia-chat-widget {
        right: 16px;
        bottom: 16px;
    }

    .guia-chat-panel {
        width: calc(100vw - 32px);
        height: calc(100vh - 140px);
    }
}
