/* Hubfy · Vendas (pedidos da Cakto ao vivo, detalhe e abandonos) e Configurações → Produtos Cakto. */

/* ---------- cabeçalho: ao vivo ---------- */
.ao-vivo { display: inline-flex; align-items: center; gap: 6px; font-weight: 590; color: var(--text); }
.ao-vivo i { position: relative; width: 7px; height: 7px; border-radius: 50%; background: var(--green); }
.ao-vivo i::after { content: ""; position: absolute; inset: -4px; border-radius: 50%; background: var(--green); opacity: 0; animation: ao-vivo 2s ease-out infinite; }
.ao-vivo.off { color: var(--text-2); }
.ao-vivo.off i { background: var(--gray); }
.ao-vivo.off i::after { display: none; }
@keyframes ao-vivo { 0% { transform: scale(.4); opacity: .55; } 100% { transform: scale(1.6); opacity: 0; } }

/* ---------- barra e aviso ---------- */
.tela-vendas { gap: 14px; }
.vd-aviso {
  display: flex; align-items: center; gap: 12px; padding: 11px 12px 11px 13px; border-radius: 16px;
  background: var(--card); border: 1px solid var(--card-borda); box-shadow: var(--sombra-card);
}
.vd-aviso-ic { flex: none; width: 32px; height: 32px; display: grid; place-items: center; border-radius: 10px; background: color-mix(in srgb, var(--orange) 15%, transparent); color: var(--orange-ink); }
.vd-aviso-txt { flex: 1; min-width: 0; display: grid; gap: 1px; }
.vd-aviso-txt b { font-size: 13.5px; font-weight: 650; }
.vd-aviso-txt small { font-size: 12.5px; color: var(--text-3); }
.vd-aviso .btn { flex: none; }

/* ---------- indicadores ---------- */
.vd-kps { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.vd-kp > small.sv { color: var(--text-3); }
.kp-var { display: flex; align-items: center; gap: 4px; margin-top: 2px; font-size: 12px; font-weight: 500; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kp-var.up, .kp-var.down { font-weight: 590; }
.kp-var.up { color: var(--green-ink); }
.kp-var.down { color: var(--red-ink); }
.kp-var .i { width: 12px; height: 12px; stroke-width: 2.4; }

/* ---------- lista ---------- */
.vd-lista { padding-top: 14px; container: vdl / inline-size; }
.vd-lista-cab { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin-bottom: 12px; }
.vd-lista-cab .campo-busca { margin-left: auto; width: 260px; }
.vd-sits { margin: 0 0 12px; overflow-x: auto; scrollbar-width: none; }
.vd-sits::-webkit-scrollbar { display: none; }
.vd-sits .seg-chips { flex-wrap: nowrap; }
.vd-taxa { margin-left: auto; display: inline-flex; align-items: baseline; gap: 6px; font-size: 12.5px; color: var(--text-2); }
.vd-taxa b { font: 650 15px/1 var(--fonte-display); color: var(--text); font-variant-numeric: tabular-nums; }
.vd-taxa small { font-size: 12px; color: var(--text-3); }

.tabela-vendas th { background: transparent; border-bottom: 1px solid var(--line); padding-top: 10px; padding-bottom: 10px; }
.tabela-vendas th:first-child, .tabela-vendas td:first-child { padding-left: 18px; }
.tabela-vendas th:last-child, .tabela-vendas td:last-child { padding-right: 18px; }
.tabela-vendas td { vertical-align: middle; padding-top: 9px; padding-bottom: 9px; }
.tabela-vendas td small { display: block; margin-top: 1px; font-size: 12px; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; }
.vd-quando { width: 64px; }
.vd-h { font-weight: 590; color: var(--text); font-variant-numeric: tabular-nums; }
.vd-cli, .vd-of { max-width: 240px; overflow: hidden; text-overflow: ellipsis; }
.vd-cli b { display: block; overflow: hidden; text-overflow: ellipsis; color: var(--text); font-weight: 590; font-size: 13.5px; }
.vd-of > span { display: block; overflow: hidden; text-overflow: ellipsis; color: var(--text); }
.vd-papel .chip { height: 20px; padding: 0 7px; font-size: 11.5px; }
.vd-met { color: var(--text-2); }
.vd-valor b { color: var(--text); font-weight: 650; font-size: 13.5px; }
.vd-origem { max-width: 220px; overflow: hidden; text-overflow: ellipsis; color: var(--text-3); }
.vd-origem > span { display: block; overflow: hidden; text-overflow: ellipsis; color: var(--text-2); font-size: 12.5px; }
.vd-sem { color: var(--text-3) !important; }

/* bump e upsell logo abaixo do principal */
.vd-filho td { padding-top: 6px; padding-bottom: 6px; border-top-color: transparent; }
.vd-filho .vd-cli b, .vd-filho .vd-valor b { font-weight: 500; }
.vd-filho .vd-cli b, .vd-filho .vd-of > span { color: var(--text-2); font-size: 13px; }
.vd-filho .vd-cli small { display: none; }
.vd-ramo { display: block; width: 14px; height: 14px; margin: -8px 0 0 10px; border-left: 1.5px solid var(--line-2); border-bottom: 1.5px solid var(--line-2); border-bottom-left-radius: 6px; }

.vd-l.aberto { background: var(--fill-2); }
.vd-l.novo { animation: vd-novo 3.4s var(--ease) both; }
@keyframes vd-novo {
  0% { background: color-mix(in srgb, var(--green) 22%, transparent); }
  100% { background: transparent; }
}
.vd-l.novo > td:first-child { box-shadow: inset 3px 0 0 color-mix(in srgb, var(--green) 70%, transparent); }
.ab-l { cursor: default; }
.ab-rec { border: 0; cursor: pointer; }
.ab-rec:hover { filter: brightness(1.1); }
.vd-mais { display: flex; align-items: center; justify-content: center; gap: 12px; padding: 12px 0 6px; border-top: 1px solid var(--line); }

/* olho mágico: as contagens das abas também são números sensíveis */
.privado .tela-vendas .seg-n, .privado .tela-pm .num .sv { filter: blur(6px); user-select: none; }

/* ---------- carregando ---------- */
.vd-esq { display: grid; gap: 14px; }
.vd-esq .esq.kpi { height: 112px; border-radius: 18px; }
.vd-esq .esq.graf { height: 236px; border-radius: 20px; }
.vd-esq .esq.lista { height: 320px; border-radius: 20px; }

/* ---------- detalhe do pedido (painel) ---------- */
.vd-tiles { margin-bottom: 20px; }
.vd-tiles .tile-v { font-size: 17px; }
.vd-dl { margin: 0; display: grid; border-radius: 13px; background: var(--fill-1); border: 1px solid var(--line); overflow: hidden; }
.vd-dl-l { display: grid; grid-template-columns: 132px minmax(0, 1fr); gap: 12px; align-items: center; padding: 8px 8px 8px 13px; min-height: 38px; }
.vd-dl-l + .vd-dl-l { border-top: 1px solid var(--line); }
.vd-dl-l dt { font-size: 12.5px; color: var(--text-3); }
.vd-dl-l dd { margin: 0; display: flex; align-items: center; gap: 6px; min-width: 0; font-size: 13.5px; color: var(--text); overflow-wrap: anywhere; }
.vd-dl-l dd .ib { flex: none; margin-left: auto; width: 26px; height: 26px; }
.vd-dl-l dd.mono, .vd-dl-l code { font: 500 12.5px/1.4 ui-monospace, "SF Mono", Menlo, monospace; }
.vd-dl-l code { padding: 1px 6px; border-radius: 6px; background: var(--fill-2); color: var(--text-2); }
.vd-dl-l .link-btn { padding: 0; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vd-familia { display: grid; gap: 6px; }
.vd-fam {
  display: flex; align-items: center; gap: 10px; min-width: 0; padding: 9px 11px; border-radius: 12px; text-align: left;
  border: 1px solid var(--line); background: var(--fill-1); transition: background .15s, border-color .15s;
}
.vd-fam:hover { background: var(--fill-2); }
.vd-fam.on { border-color: var(--line-2); background: var(--fill-2); }
.vd-fam-nome { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.vd-fam b { font-size: 13px; font-weight: 650; font-variant-numeric: tabular-nums; }

/* ---------- Produtos Cakto ---------- */
.tela-pm { max-width: 1180px; }
.tela-pm .cartao-tabela { container: pm / inline-size; }
.pm-intro { margin: 0; max-width: 72ch; font-size: 14px; line-height: 1.5; color: var(--text-2); }
.tabela-pm th { background: transparent; border-bottom: 1px solid var(--line); padding-top: 10px; padding-bottom: 10px; }
.tabela-pm th:first-child, .tabela-pm td:first-child { padding-left: 18px; }
.tabela-pm th:last-child, .tabela-pm td:last-child { padding-right: 18px; }
.tabela-pm td { vertical-align: middle; }
.pm-of { min-width: 220px; max-width: 320px; white-space: normal !important; }
.pm-nome { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 8px; }
.pm-nome b { color: var(--text); font-weight: 590; font-size: 13.5px; }
.pm-of small { display: block; margin-top: 3px; font-size: 12px; color: var(--text-3); }
.pm-of code { font: 500 11.5px/1 ui-monospace, "SF Mono", Menlo, monospace; padding: 2px 5px; border-radius: 5px; background: var(--fill-2); color: var(--text-2); }
.pm-preco, .pm-v30 { color: var(--text); }
.pm-rot { display: none; }
.input-peq { height: 32px; padding: 0 10px; border-radius: 9px; font-size: 13px; }
.pm-oferta select { min-width: 190px; max-width: 240px; }
.pm-papel select { min-width: 104px; }
.pm-reais { position: relative; display: block; width: 104px; }
.pm-reais > span { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); font-size: 12.5px; color: var(--text-3); pointer-events: none; }
.pm-reais input { padding-left: 32px; text-align: right; font-variant-numeric: tabular-nums; }
.pm-ign td:not(.pm-ign-col) { opacity: .55; }
select.input:disabled, .input:disabled { opacity: .55; cursor: default; }

/* chave liga/desliga */
.chave { position: relative; display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }
.chave input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.chave i { position: relative; width: 38px; height: 23px; border-radius: 999px; background: var(--fill-3); transition: background .2s; }
.chave i::after { content: ""; position: absolute; top: 2px; left: 2px; width: 19px; height: 19px; border-radius: 50%; background: #fff; box-shadow: 0 2px 4px rgba(0, 0, 0, .25); transition: transform .22s var(--ease); }
.chave input:checked + i { background: var(--text-2); }
.chave input:checked + i::after { transform: translateX(15px); }
.chave input:focus-visible + i { outline: 2px solid var(--blue); outline-offset: 2px; }

/* ---------- telas menores ---------- */
@media (max-width: 1000px) {
  .vd-kps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .ao-vivo-txt { display: none; }
  .vd-aviso { flex-wrap: wrap; align-items: flex-start; }
  .vd-aviso-txt { flex-basis: calc(100% - 44px); }
  .vd-aviso .btn { margin-left: 44px; }
  .kp-var { font-size: 11.5px; }
  .vd-kp > small.sv { white-space: normal; }
  .vd-dl-l { grid-template-columns: 104px minmax(0, 1fr); }
}

/* No celular o subtítulo some; em Vendas fica só a bolinha "Ao vivo". */
@media (max-width: 400px) {
  .app.vista-vendas .topo-tit p { display: block; }
}

/* A lista se ajusta à largura que tem (menu aberto ou recolhido, celular): some coluna e depois vira cartão. */
@container vdl (max-width: 1040px) {
  .vd-origem { display: none; }
}
@container vdl (max-width: 860px) {
  .vd-papel { display: none; }
}
@container vdl (max-width: 680px) {
  .vd-lista-cab .campo-busca { width: 100%; margin-left: 0; order: 3; }
  .vd-taxa { margin-left: 0; width: 100%; }
  .tabela-vendas thead { display: none; }
  .tabela-vendas, .tabela-vendas tbody { display: block; }
  .tabela-vendas tr {
    position: relative; display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 12px; row-gap: 2px; align-items: center;
    grid-template-areas: "cli valor" "of sit" "quando met";
    padding: 11px 14px; border-top: 1px solid var(--line);
  }
  .tabela-vendas td { display: block; padding: 0 !important; border: 0; max-width: none; white-space: nowrap; }
  .tabela-vendas .vd-cli { grid-area: cli; }
  .tabela-vendas .vd-cli small { display: none; }
  .tabela-vendas .vd-valor { grid-area: valor; }
  .tabela-vendas .vd-of { grid-area: of; display: flex; gap: 6px; min-width: 0; font-size: 12.5px; }
  .tabela-vendas .vd-of > span { flex: 1 1 auto; min-width: 0; color: var(--text-2); }
  .tabela-vendas .vd-of small { display: none; }
  .tabela-vendas .vd-filho .vd-of > span { display: none; }
  .tabela-vendas .vd-filho .vd-of small { display: block; margin: 0; min-width: 0; font-size: 12.5px; color: var(--text-2); }
  .tabela-vendas .vd-sit { grid-area: sit; justify-self: end; }
  .tabela-vendas .vd-quando { grid-area: quando; width: auto; display: flex; gap: 6px; align-items: baseline; font-size: 12px; color: var(--text-3); }
  .tabela-vendas .vd-quando .vd-h { color: var(--text-3); font-weight: 500; }
  .tabela-vendas .vd-quando small { margin: 0; }
  .tabela-vendas .vd-met { grid-area: met; justify-self: end; font-size: 12px; color: var(--text-3); }
  .tabela-vendas .vd-papel, .tabela-vendas .vd-origem { display: none; }
  .tabela-vendas .vd-filho { padding: 6px 14px 10px 36px; border-top: 0; grid-template-areas: "cli valor" "of sit"; }
  .tabela-vendas .vd-filho .vd-quando, .tabela-vendas .vd-filho .vd-met { display: none; }
  .tabela-vendas .vd-filho::after { content: ""; position: absolute; left: 18px; top: 0; width: 10px; height: 16px; border-left: 1.5px solid var(--line-2); border-bottom: 1.5px solid var(--line-2); border-bottom-left-radius: 5px; }
  .tabela-abandonos tr { grid-template-areas: "cli sit" "of link" "quando link"; }
  .tabela-abandonos .ab-link { grid-area: link; justify-self: end; align-self: center; }
  .vd-l.novo > td:first-child { box-shadow: none; }
}

@container pm (max-width: 820px) {
  .tabela-pm thead { display: none; }
  .tabela-pm, .tabela-pm tbody { display: block; }
  .tabela-pm tr { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; gap: 12px; padding: 14px; border-top: 1px solid var(--line); }
  .tabela-pm td { display: block; padding: 0 !important; border: 0; white-space: normal; }
  .tabela-pm td.num { text-align: left; }
  .tabela-pm .pm-of { grid-column: 1 / 3; grid-row: 1; max-width: none; }
  .tabela-pm .pm-ign-col { grid-column: 3; grid-row: 1; }
  .tabela-pm .pm-oferta { grid-column: 1 / -1; }
  .tabela-pm .pm-custo { grid-column: 2 / -1; }
  .pm-rot { display: block; margin-bottom: 4px; font-size: 11.5px; font-weight: 590; color: var(--text-3); }
  .tabela-pm .num .sv { font-size: 14px; font-weight: 590; }
  .pm-oferta select, .pm-papel select { width: 100%; max-width: none; min-width: 0; }
  .pm-reais { width: 100%; }
  .pm-ign-col .chave { display: grid; justify-items: end; gap: 4px; }
  .pm-ign-col .pm-rot { margin: 0; }
}
