/* =============================================================================
   PharmaNov — complemento do design system.

   REGRA: nenhuma cor de marca aqui. Só neutros, semânticos e variáveis
   (--brand-*, --sidebar-*) geradas pelo /theme.css. Mexer em cor de marca
   neste arquivo quebra o white-label.

   O app.css herdado do projeto Plataforma assume sidebar clara. As regras de
   sidebar escura abaixo entram em ação quando o Brand::css detecta que a cor
   escolhida precisa de texto claro — é o que dá ao master a identidade escura
   sem duplicar o CSS inteiro.
   ========================================================================== */

/* --- Sidebar adaptativa (clara ou escura conforme a cor escolhida) -------- */

.sidebar__head,
.sidebar__foot {
    border-color: var(--sidebar-borda, var(--line));
}

.sidebar__name  { color: var(--sidebar-ativo, var(--ink)); }
.sidebar__role,
.sidebar__label { color: var(--sidebar-texto, var(--muted)); opacity: .78; }

.nav-link-app        { color: var(--sidebar-texto, var(--ink-2)); }
.nav-link-app:hover  { background: var(--sidebar-hover, var(--canvas)); color: var(--sidebar-ativo, var(--ink)); }

/* Item ativo: mantém o realce da marca em sidebar clara e inverte para um
   véu translúcido em sidebar escura (soft da marca sumiria no fundo). */
.nav-link-app.is-active {
    color: var(--sidebar-ativo, var(--brand-primary-ink));
    background: var(--sidebar-hover, var(--brand-primary-soft));
}

.sidebar__nav::-webkit-scrollbar-thumb { background: var(--sidebar-borda, var(--line-strong)); }

/* --- Módulo ainda não liberado ------------------------------------------- */

.nav-link-app.is-soon {
    opacity: .42;
    cursor: not-allowed;
}

.nav-link-app.is-soon:hover { background: transparent; }

.nav-link-app.is-soon .nav-link-app__badge {
    background: var(--sidebar-borda, var(--line));
    color: var(--sidebar-texto, var(--muted));
}

/* --- Ajustes de conteúdo -------------------------------------------------- */

/* Célula de tabela com rótulo + detalhe abaixo, sem inventar classe nova
   em cada listagem. */
.cell-stack { line-height: 1.3; }
.cell-stack strong { display: block; font-weight: 600; }
.cell-stack small { color: var(--muted); font-size: .76rem; }

/* Bolinha de status usada nas listagens de farmácia/usuário. */
.dot {
    display: inline-block;
    width: 8px; height: 8px;
    border-radius: 50%;
    margin-right: 6px;
    vertical-align: middle;
}
.dot--ok      { background: var(--ok); }
.dot--warn    { background: var(--warn); }
.dot--danger  { background: var(--danger); }
.dot--muted   { background: var(--line-strong); }

/* Prévia do tema na aba Aparência: quadrado de cor + rótulo. */
.swatch {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: var(--brand-radius, 12px);
    background: var(--surface);
}
.swatch__chip {
    width: 34px; height: 34px;
    border-radius: 9px;
    border: 1px solid rgba(0,0,0,.06);
    flex-shrink: 0;
}
.swatch__label { font-size: .78rem; color: var(--muted); line-height: 1.25; }
.swatch__label strong { display: block; color: var(--ink); font-size: .85rem; }

/* Uma linha de rótulo → valor, para painéis de detalhe. */
.kv { display: grid; grid-template-columns: 130px 1fr; gap: 6px 12px; font-size: .875rem; }
.kv dt { color: var(--muted); font-weight: 500; }
.kv dd { margin: 0; }

@media (max-width: 575.98px) {
    .kv { grid-template-columns: 1fr; gap: 2px 0; }
    .kv dd { margin-bottom: 10px; }
}

/* =============================================================================
   Assistente IA — widget flutuante (portal do prescritor)
   ========================================================================== */

.chat { position: fixed; right: 20px; bottom: 20px; z-index: 1050; }

.chat__bolha {
    width: 56px; height: 56px;
    border: 0; border-radius: 50%;
    background: var(--brand-primary);
    color: var(--brand-on-primary);
    font-size: 1.4rem;
    box-shadow: var(--shadow-lg);
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: transform .15s ease;
}
.chat__bolha:hover { transform: scale(1.06); }
.chat.is-aberto .chat__bolha { transform: scale(0.9); opacity: .85; }

.chat__painel {
    position: absolute;
    right: 0; bottom: 70px;
    width: 380px;
    max-width: calc(100vw - 40px);
    height: 520px;
    max-height: calc(100vh - 120px);
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--brand-radius, 14px);
    box-shadow: var(--shadow-lg);
    display: none;
    flex-direction: column;
    overflow: hidden;
}
.chat.is-aberto .chat__painel { display: flex; }

.chat__cabecalho {
    display: flex; align-items: center; gap: 8px;
    padding: 12px 14px;
    background: var(--brand-primary);
    color: var(--brand-on-primary);
    flex-shrink: 0;
}
.chat__cabecalho strong { font-size: .9rem; }
.chat__cabecalho small { opacity: .8; font-size: .72rem; display: block; }
.chat__fechar {
    margin-left: auto; background: transparent; border: 0;
    color: inherit; opacity: .8; cursor: pointer; font-size: 1.1rem;
}
.chat__fechar:hover { opacity: 1; }

.chat__corpo {
    flex: 1; overflow-y: auto;
    padding: 14px;
    background: var(--canvas);
    display: flex; flex-direction: column; gap: 10px;
}
.chat__corpo::-webkit-scrollbar { width: 6px; }
.chat__corpo::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 3px; }

.chat__msg { display: flex; flex-direction: column; max-width: 88%; }
.chat__msg--user { align-self: flex-end; align-items: flex-end; }
.chat__msg--ia   { align-self: flex-start; }

.chat__balao {
    padding: 9px 12px;
    border-radius: 14px;
    font-size: .85rem;
    line-height: 1.45;
    background: var(--surface);
    border: 1px solid var(--line);
    color: var(--ink);
}
.chat__balao p { margin: 0 0 8px; }
.chat__balao p:last-child { margin-bottom: 0; }

.chat__msg--user .chat__balao {
    background: var(--brand-primary);
    color: var(--brand-on-primary);
    border-color: transparent;
    border-bottom-right-radius: 4px;
}
.chat__msg--ia .chat__balao { border-bottom-left-radius: 4px; }

.chat__aviso {
    font-size: .78rem;
    color: var(--muted);
    text-align: center;
    padding: 10px 14px;
    line-height: 1.45;
}

.chat__fontes { margin-top: 6px; display: flex; flex-direction: column; gap: 4px; }
.chat__fonte {
    display: flex; align-items: center; gap: 6px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 6px 8px;
    font-size: .8rem;
}
.chat__fonte-info { flex: 1; min-width: 0; display: flex; align-items: center; gap: 6px; }
.chat__fonte a { color: var(--brand-primary); text-decoration: none; }
.chat__fonte a:hover { text-decoration: underline; }
.chat__fonte form { margin: 0; }

/* Três pontinhos enquanto o modelo responde. */
.chat__pensando { display: flex; gap: 4px; padding: 12px 14px; }
.chat__pensando span {
    width: 6px; height: 6px; border-radius: 50%;
    background: var(--muted);
    animation: chatPulse 1.2s infinite ease-in-out;
}
.chat__pensando span:nth-child(2) { animation-delay: .18s; }
.chat__pensando span:nth-child(3) { animation-delay: .36s; }

@keyframes chatPulse {
    0%, 60%, 100% { opacity: .25; transform: translateY(0); }
    30%           { opacity: 1;  transform: translateY(-3px); }
}

.chat__form {
    display: flex; gap: 8px;
    padding: 10px;
    border-top: 1px solid var(--line);
    background: var(--surface);
    flex-shrink: 0;
}
.chat__campo {
    flex: 1;
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 8px 10px;
    font-size: .85rem;
    font-family: inherit;
    resize: none;
    max-height: 90px;
}
.chat__campo:focus {
    outline: none;
    border-color: var(--brand-primary);
    box-shadow: 0 0 0 3px var(--brand-primary-soft);
}

@media (max-width: 575.98px) {
    .chat { right: 12px; bottom: 12px; }
    .chat__painel { width: calc(100vw - 24px); height: calc(100vh - 100px); }
}

@media print { .chat { display: none !important; } }

/* =============================================================================
   Atendimento WhatsApp — tela cheia (lista | conversa | cliente)

   Esta é a única tela do painel que ocupa a janela inteira: quem trabalha nela
   fica o dia todo, e cada pixel de altura vale uma mensagem a mais na thread.
   O <body> recebe .page-atendimento (definido na própria view) e as regras
   abaixo zeram o padding do <main> e escondem o rodapé só aqui.
   ========================================================================== */

body.page-atendimento { overflow: hidden; }
body.page-atendimento .app { height: 100vh; height: 100dvh; min-height: 0; }
body.page-atendimento .app__main { height: 100vh; height: 100dvh; min-height: 0; overflow: hidden; }
body.page-atendimento .content {
    padding: 0; min-height: 0; overflow: hidden;
    display: flex; flex-direction: column;
}
body.page-atendimento .content > .alert { margin: 14px 16px 0; }
body.page-atendimento .app__footer { display: none; }

.atd {
    flex: 1;
    display: grid;
    grid-template-columns: minmax(0, 336px) minmax(0, 1fr) 328px;
    grid-template-rows: auto minmax(0, 1fr);
    min-height: 0;
    background: var(--surface);
    border-top: 1px solid var(--line);
    overflow: hidden;
}
.atd [hidden] { display: none !important; }

/* Faixa de "WhatsApp não conectado" — atravessa as três colunas.
   As linhas são fixas de propósito: sem o aviso a primeira linha fica com
   altura zero e as colunas continuam ocupando a janela inteira. */
.atd__aviso {
    grid-row: 1; grid-column: 1 / -1;
    display: flex; align-items: center; gap: 8px;
    padding: 9px 16px;
    background: var(--warn-soft); color: #8a5a00;
    font-size: .8rem;
    border-bottom: 1px solid var(--line);
}
.atd__aviso a { color: inherit; text-decoration: underline; }

.atd__coluna { grid-row: 2; display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.atd__coluna + .atd__coluna { border-left: 1px solid var(--line); }

.atd__cabecalho {
    padding: 11px 14px;
    border-bottom: 1px solid var(--line);
    flex-shrink: 0;
    background: var(--surface);
}

.atd__rolagem { flex: 1; overflow-y: auto; min-height: 0; }
.atd__rolagem::-webkit-scrollbar,
.atd__thread::-webkit-scrollbar { width: 7px; }
.atd__rolagem::-webkit-scrollbar-thumb,
.atd__thread::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 4px; }

/* --- Coluna 1: topo (título + status + fila), busca e filtros ------------ */

.atd__topo { display: flex; align-items: center; gap: 8px; }
.atd__titulo { font-size: 1.02rem; font-weight: 700; letter-spacing: -.02em; line-height: 1.15; }
.atd__status {
    display: flex; align-items: center;
    font-size: .72rem; color: var(--muted);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.atd__status .dot { margin-right: 5px; }

.atd__fila {
    flex-shrink: 0;
    background: var(--warn-soft); color: #8a5a00;
    border-radius: 999px; padding: 2px 9px;
    font-size: .7rem; font-weight: 700; white-space: nowrap;
}

.atd__busca { position: relative; margin-top: 10px; }
.atd__busca > i {
    position: absolute; left: 11px; top: 50%; transform: translateY(-50%);
    color: var(--muted); font-size: .82rem; pointer-events: none;
}
.atd__busca input {
    width: 100%;
    border: 1px solid var(--line); background: var(--canvas); color: var(--ink);
    border-radius: 999px; padding: 7px 12px 7px 31px; font-size: .82rem;
}
.atd__busca input:focus {
    outline: none; background: var(--surface);
    border-color: var(--brand-primary); box-shadow: 0 0 0 3px var(--brand-primary-soft);
}

/* Filtros em uma linha só: rolam na horizontal em vez de empurrar a lista. */
.atd__filtros {
    display: flex; gap: 5px; margin-top: 9px;
    overflow-x: auto; scrollbar-width: none;
}
.atd__filtros::-webkit-scrollbar { display: none; }
.atd__filtro {
    flex-shrink: 0;
    font-size: .72rem; font-weight: 600;
    padding: 3px 10px; border-radius: 99px;
    border: 1px solid var(--line); background: var(--surface);
    color: var(--muted); cursor: pointer; transition: all .12s;
}
.atd__filtro:hover { color: var(--ink); border-color: var(--line-strong); }
.atd__filtro.is-ativo {
    background: var(--brand-primary-soft);
    border-color: transparent;
    color: var(--brand-primary-ink);
}

/* --- Coluna 1: itens da lista ------------------------------------------- */

.atd__conversa {
    display: flex; gap: 10px; align-items: center;
    padding: 10px 14px 10px 11px;
    border-bottom: 1px solid var(--line);
    border-left: 3px solid transparent;
    cursor: pointer;
}
.atd__conversa:hover { background: var(--canvas); }
.atd__conversa.is-ativa {
    background: var(--brand-primary-soft);
    border-left-color: var(--brand-primary);
}
.atd__conversa.is-nao-lida .atd__conversa-nome { font-weight: 700; }
.atd__conversa.is-nao-lida .atd__conversa-preview { color: var(--ink-2); font-weight: 500; }

.atd__conversa-info { flex: 1; min-width: 0; }
.atd__conversa-topo,
.atd__conversa-baixo { display: flex; align-items: center; gap: 8px; }
.atd__conversa-baixo { margin-top: 1px; }

.atd__conversa-nome {
    flex: 1; min-width: 0;
    display: flex; align-items: center;
    font-size: .865rem; font-weight: 600; color: var(--ink);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.atd__conversa-hora { flex-shrink: 0; font-size: .68rem; color: var(--muted); }
.atd__conversa-preview {
    flex: 1; min-width: 0;
    font-size: .78rem; color: var(--muted);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.atd__conversa-preview .bi { font-size: .72rem; opacity: .8; }
.atd__badge {
    flex-shrink: 0;
    display: inline-block; min-width: 18px; padding: 0 6px;
    border-radius: 99px; background: var(--brand-primary);
    color: var(--brand-on-primary); font-size: .66rem; font-weight: 700;
    line-height: 17px; text-align: center;
}

/* --- Coluna 2: cabeçalho da conversa e thread ---------------------------- */

.atd__cabecalho--thread { display: flex; align-items: center; gap: 10px; }

.atd__thread {
    flex: 1; min-height: 0; overflow-y: auto;
    display: flex; flex-direction: column;
    padding: 18px 20px;
    background-color: var(--canvas);
    background-image: radial-gradient(circle at 1px 1px, rgba(23, 23, 51, .05) 1px, transparent 0);
    background-size: 22px 22px;
}

/* Conversa curta encosta no compositor, como no WhatsApp. O `auto` no primeiro
   filho faz isso sem quebrar a rolagem quando a conversa é longa. */
.atd__thread > :first-child { margin-top: auto; }

/* Em telas largas a conversa não deve esticar de ponta a ponta. */
.atd__msg {
    flex-shrink: 0;
    display: flex;
    width: 100%; max-width: 980px;
    margin: 0 auto 7px;
}
.atd__msg--in  { justify-content: flex-start; }
.atd__msg--out { justify-content: flex-end; }
.atd__msg + .atd__msg.atd__msg--mesma { margin-top: -4px; }

.atd__data {
    flex-shrink: 0;
    display: flex; justify-content: center;
    width: 100%; max-width: 980px;
    margin: 14px auto 12px;
}
.atd__data span {
    background: var(--surface); border: 1px solid var(--line);
    border-radius: 999px; padding: 3px 13px;
    font-size: .68rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
    color: var(--muted); box-shadow: var(--shadow-sm);
}

.atd__balao {
    position: relative;
    max-width: 72%; min-width: 108px;
    padding: 8px 12px;
    border-radius: 14px;
    font-size: .865rem;
    line-height: 1.45;
    background: var(--surface);
    border: 1px solid var(--line);
    box-shadow: var(--shadow-sm);
    word-break: break-word;
    overflow-wrap: anywhere;
}
/* A hora fica ancorada no canto do balão; o padding à direita é o espaço
   reservado para ela — mais folgado no enviado, que ainda leva autor e selo. */
.atd__msg--in  .atd__balao { padding-right: 56px; border-bottom-left-radius: 5px; }
.atd__msg--out .atd__balao {
    padding-right: 88px;
    background: var(--brand-primary-soft);
    border-color: transparent;
    border-bottom-right-radius: 5px;
}
.atd__balao a { text-decoration: underline; }
.atd__balao img { max-width: 100%; border-radius: 8px; display: block; }

.atd__balao-meta {
    position: absolute; right: 11px; bottom: 7px;
    display: flex; align-items: center; gap: 4px;
    font-size: .64rem; color: var(--muted); white-space: nowrap;
    pointer-events: none;
}
.atd__balao-meta .bi-check2-all { color: var(--info); }
.atd__balao-meta .bi-exclamation-circle { color: var(--danger); }

/* --- Anexos dentro do balão --------------------------------------------- */

/* Com mídia a hora sai de cima do conteúdo e desce para baixo dele. */
.atd__msg--in  .atd__balao--midia,
.atd__msg--out .atd__balao--midia { padding: 6px; }

.atd__balao--midia .atd__balao-meta {
    position: static;
    justify-content: flex-end;
    margin-top: 3px; padding: 0 4px;
}

.atd__midia { display: block; }
/* Sem recorte: foto de receita precisa aparecer inteira no balão. */
.atd__midia img,
.atd__midia video {
    display: block;
    width: auto; height: auto;
    max-width: min(320px, 100%); max-height: 360px;
    border-radius: 10px;
    background: var(--canvas);
}
.atd__midia img { cursor: zoom-in; }

.atd__audio {
    display: block;
    width: 268px; max-width: 100%; height: 40px;
    margin: 2px 0;
}

.atd__doc {
    display: flex; align-items: center; gap: 10px;
    min-width: 200px; max-width: 300px;
    padding: 9px 12px;
    border: 1px solid var(--line); border-radius: 10px;
    background: var(--surface); color: var(--ink); text-decoration: none;
}
.atd__doc:hover { border-color: var(--brand-primary); }
.atd__doc i { font-size: 1.35rem; color: var(--brand-primary); flex-shrink: 0; }
.atd__doc span {
    font-size: .82rem;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.atd__legenda { font-size: .865rem; line-height: 1.45; margin-top: 6px; padding: 0 4px; }

/* Foto ampliada */
.atd__lupa {
    position: fixed; inset: 0; z-index: 1080;
    display: flex; align-items: center; justify-content: center;
    padding: 28px;
    background: rgba(10, 10, 25, .9);
    cursor: zoom-out;
}
.atd__lupa[hidden] { display: none; }
.atd__lupa img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 10px; }
.atd__lupa-fechar {
    position: absolute; top: 16px; right: 18px;
    width: 40px; height: 40px; border: 0; border-radius: 50%;
    background: rgba(255, 255, 255, .15); color: #fff;
    font-size: .95rem; cursor: pointer;
}
.atd__lupa-fechar:hover { background: rgba(255, 255, 255, .28); }

.atd__msg--sistema { justify-content: center; }
.atd__msg--sistema .atd__balao {
    max-width: 80%; min-width: 0;
    padding: 4px 12px;
    background: rgba(23, 23, 51, .05); border: 0; box-shadow: none;
    border-radius: 999px;
    font-size: .73rem; color: var(--muted); text-align: center;
}
.atd__msg--sistema .atd__balao-meta {
    position: static; display: inline-flex; margin-left: 6px; opacity: .75;
}

/* --- Coluna 2: compositor ------------------------------------------------ */

.atd__envio {
    display: flex; align-items: flex-end; gap: 8px;
    padding: 11px 14px;
    border-top: 1px solid var(--line); flex-shrink: 0; background: var(--surface);
}
.atd__campo {
    flex: 1;
    border: 1px solid var(--line); border-radius: 20px;
    background: var(--canvas);
    padding: 9px 15px; font-size: .875rem; font-family: inherit; line-height: 1.45;
    resize: none; max-height: 132px; overflow-y: auto;
}
.atd__campo:focus {
    outline: none; background: var(--surface);
    border-color: var(--brand-primary);
    box-shadow: 0 0 0 3px var(--brand-primary-soft);
}
.atd__enviar {
    flex-shrink: 0;
    width: 40px; height: 40px; padding: 0; border: 0; border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--brand-primary); color: var(--brand-on-primary);
    font-size: 1rem; cursor: pointer; transition: background .12s;
}
.atd__enviar:hover { background: var(--brand-primary-hover); }
.atd__anexo {
    flex-shrink: 0;
    width: 40px; height: 40px; padding: 0; border: 0; border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center;
    background: transparent; color: var(--muted);
    font-size: 1.1rem; cursor: pointer; transition: background .12s, color .12s;
}
.atd__anexo:hover { background: var(--canvas); color: var(--brand-primary); }

/* --- Coluna 3 e estados vazios ------------------------------------------ */

.atd__vazio {
    flex: 1; display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    color: var(--muted); font-size: .87rem; padding: 24px; text-align: center;
}
.atd__vazio .bi { font-size: 2.2rem; opacity: .28; margin-bottom: 8px; }

@media (max-width: 1399.98px) {
    .atd { grid-template-columns: minmax(0, 300px) minmax(0, 1fr) 288px; }
}
@media (max-width: 1199.98px) {
    .atd { grid-template-columns: 280px minmax(0, 1fr); }
    .atd__coluna--cliente { display: none; }
}
@media (max-width: 767.98px) {
    .atd { grid-template-columns: minmax(0, 1fr); }
    .atd__coluna--lista { display: none; }
    .atd__coluna + .atd__coluna { border-left: 0; }
    .atd.is-lista .atd__coluna--lista { display: flex; }
    .atd.is-lista .atd__coluna--thread { display: none; }
    .atd__thread { padding: 14px 12px; }
    .atd__balao { max-width: 86%; }
}

/* ---------------------------------------------------------------------------
   Quadro de vendas (kanban de orçamentos)
   Neutros e semânticos daqui; cor de marca só via variáveis do theme.css.
--------------------------------------------------------------------------- */

.kanban {
    display: flex; gap: 14px; align-items: flex-start;
    overflow-x: auto; padding-bottom: 10px;
    scroll-snap-type: x proximity;
}
.kanban::-webkit-scrollbar { height: 8px; }
.kanban::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 4px; }

.kanban__col {
    flex: 0 0 268px; scroll-snap-align: start;
    background: var(--canvas); border: 1px solid var(--line);
    border-radius: var(--brand-radius); display: flex; flex-direction: column;
    max-height: calc(100vh - 265px);
}

.kanban__head { padding: 12px 14px 10px; border-bottom: 1px solid var(--line); }
.kanban__titulo { display: flex; align-items: center; gap: 7px; font-size: .84rem; font-weight: 700; color: var(--ink); }
.kanban__titulo i { color: var(--brand-primary); font-size: .95rem; }
.kanban__contagem {
    margin-left: auto; background: var(--surface); border: 1px solid var(--line);
    color: var(--muted); font-size: .72rem; font-weight: 700;
    min-width: 22px; text-align: center; border-radius: 999px; padding: 1px 6px;
}
.kanban__valor { font-size: .74rem; color: var(--muted); margin-top: 3px; min-height: 1em; }

.kanban__lista {
    padding: 10px; display: flex; flex-direction: column; gap: 8px;
    overflow-y: auto; flex: 1; min-height: 70px;
}
.kanban__lista::-webkit-scrollbar { width: 6px; }
.kanban__lista::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 3px; }

.kanban__vazio { color: var(--muted); font-size: .78rem; text-align: center; margin: 14px 0; }

.kanban__rodape {
    padding: 7px 14px; border-top: 1px solid var(--line);
    font-size: .7rem; color: var(--muted); text-align: center;
}

.kanban__card {
    position: relative; background: var(--surface);
    border: 1px solid var(--line); border-radius: 10px;
    padding: 10px 11px; box-shadow: var(--shadow-sm);
    cursor: grab; transition: border-color .15s, box-shadow .15s, background .6s;
}
.kanban__card:hover { border-color: var(--brand-primary); box-shadow: var(--shadow); }
.kanban__card:active { cursor: grabbing; }

/* O link cobre o card inteiro, mas o conteúdo fica acima para o arrasto pegar. */
.kanban__link { position: absolute; inset: 0; z-index: 1; border-radius: 10px; }
.kanban__card > *:not(.kanban__link) { position: relative; z-index: 2; pointer-events: none; }

.kanban__card-topo { display: flex; align-items: baseline; gap: 6px; margin-bottom: 3px; }
.kanban__card-topo strong { font-size: .78rem; font-weight: 700; color: var(--brand-primary-ink, var(--ink)); }
.kanban__preco { margin-left: auto; font-size: .78rem; font-weight: 700; color: var(--ink); }
.kanban__card-nome { font-size: .84rem; color: var(--ink); line-height: 1.3; }
.kanban__card-meta { font-size: .72rem; color: var(--muted); margin-top: 4px; }

.kanban__card.is-fantasma { opacity: .35; }
.kanban__card.is-arrastando { box-shadow: var(--shadow-lg); transform: rotate(1.5deg); }
.kanban__card.is-novo   { animation: kbFlash 1.2s ease-out; }
.kanban__card.is-movido { animation: kbFlash 1.2s ease-out; }

@keyframes kbFlash {
    0%   { background: var(--brand-primary-soft); border-color: var(--brand-primary); }
    100% { background: var(--surface); border-color: var(--line); }
}

@media (max-width: 767.98px) {
    .kanban__col { flex-basis: 84vw; max-height: none; }
    .kanban__lista { max-height: 60vh; }
}

/* Mensagens prontas no compositor do atendimento ("/" abre a lista) */
.atd__envio { position: relative; }

.atd__modelos {
    position: absolute; bottom: calc(100% + 8px); left: 0; right: 0;
    background: var(--surface); border: 1px solid var(--line);
    border-radius: 10px; box-shadow: var(--shadow-lg);
    max-height: 240px; overflow-y: auto; z-index: 20; padding: 4px;
}
.atd__modelo {
    display: flex; align-items: baseline; gap: 8px; width: 100%;
    background: none; border: 0; border-radius: 7px; text-align: left;
    padding: 7px 9px; font-size: .84rem; color: var(--ink); cursor: pointer;
}
.atd__modelo strong { color: var(--brand-primary); font-size: .8rem; }
.atd__modelo span { color: var(--muted); font-size: .78rem; }
.atd__modelo:hover,
.atd__modelo.is-marcado { background: var(--brand-primary-soft); }

/* Ficha do cliente: linha do tempo e chips de tag */
.tl { list-style: none; margin: 0; padding: 0; position: relative; }
.tl::before {
    content: ""; position: absolute; left: 11px; top: 6px; bottom: 6px;
    width: 2px; background: var(--line);
}
.tl__item { position: relative; display: flex; gap: 12px; padding-bottom: 16px; }
.tl__item:last-child { padding-bottom: 0; }
.tl__ponto {
    position: relative; z-index: 1; flex: 0 0 24px; height: 24px;
    display: flex; align-items: center; justify-content: center;
    background: var(--brand-primary-soft); color: var(--brand-primary-ink);
    border-radius: 50%; font-size: .72rem;
}
.tl__corpo { min-width: 0; padding-top: 2px; }
.tl__titulo { font-size: .86rem; font-weight: 600; color: var(--ink); }
.tl__titulo a { color: var(--brand-primary); text-decoration: none; }
.tl__titulo a:hover { text-decoration: underline; }
.tl__detalhe { font-size: .8rem; color: var(--ink-2); word-break: break-word; }
.tl__data { font-size: .72rem; color: var(--muted); margin-top: 2px; }

.chip {
    border: 1px solid var(--line-strong); background: var(--surface);
    color: var(--muted); border-radius: 999px; padding: 3px 11px;
    font-size: .76rem; font-weight: 600; cursor: pointer; transition: all .12s;
}
.chip:hover:not(:disabled) { border-color: var(--chip, var(--brand-primary)); }
.chip.is-ativa {
    background: var(--chip, var(--brand-primary));
    border-color: var(--chip, var(--brand-primary)); color: #fff;
}
.chip:disabled { cursor: default; opacity: .7; }

/* Barra de proporção dos relatórios */
.barra {
    height: 6px; background: var(--canvas); border-radius: 3px;
    overflow: hidden; margin-top: 3px;
}
.barra span { display: block; height: 100%; background: var(--brand-primary); border-radius: 3px; }

/* Diálogo do gatilho pós-movimento do kanban */
.kb-modal {
    position: fixed; inset: 0; z-index: 1060;
    background: rgba(23, 23, 51, .35);
    display: flex; align-items: center; justify-content: center; padding: 20px;
}
.kb-modal[hidden] { display: none; }
.kb-modal__caixa {
    background: var(--surface); border-radius: var(--brand-radius);
    box-shadow: var(--shadow-lg); padding: 22px; width: 100%; max-width: 460px;
}
