/* ficha: estilos desta frente (carregado depois de extra.css) */

/* ---------- Escolher o carro de interesse: lista do estoque já aberta, com busca ---------- */
.fx-carro-busca { margin: 0 0 var(--s2); }
.fx-carro-busca input { width: 100%; }
.fx-carro-lista { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; max-height: min(52vh, 420px); overflow-y: auto; overscroll-behavior: contain; }
.fx-carro-lista li[hidden] { display: none; }
.fx-carro-op { width: 100%; display: flex; align-items: center; gap: 12px; min-height: 60px; padding: 8px; border: 1px solid transparent; border-radius: var(--r-sm) 0 var(--r-sm) 0; background: none; color: var(--ink); font: inherit; text-align: left; cursor: pointer; }
.fx-carro-op:hover { background: var(--surface-raised); }
.fx-carro-op.on { border-color: var(--action); background: var(--surface-raised); }
.fx-carro-op .vthumb img { width: 100%; height: 100%; object-fit: cover; }
.fx-carro-tx { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.fx-carro-tx b { font-size: var(--fs-base); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fx-carro-tx span { font-size: var(--fs-sm); color: var(--ink-muted); }
.fx-carro-op > svg { flex: none; color: var(--action-ink, var(--ink)); }

/* ---------- Abas da ficha do lead: cabem no celular, rolam de lado se precisar ---------- */
.drawer .tabs { overflow-x: auto; overflow-y: hidden; scrollbar-width: none; flex-wrap: nowrap; -webkit-overflow-scrolling: touch; }
.drawer .tabs::-webkit-scrollbar { display: none; }
.drawer .tabs .tab { flex: none; white-space: nowrap; }
@media (max-width: 480px) { .drawer .tabs { gap: var(--s4); } }

/* ---------- Nada de texto vazando ---------- */
.drawer-title .dt-txt, .drawer-title h2, .drawer-title p { min-width: 0; overflow-wrap: anywhere; }
.drawer-title .nm-edit { max-width: 100%; overflow-wrap: anywhere; text-align: left; }
.drawer-body { min-width: 0; }
.drawer-body > * { min-width: 0; max-width: 100%; }
.drawer-body .kv > div { min-width: 0; overflow-wrap: anywhere; }
.drawer-body .kv b, .drawer-body .kv a { overflow-wrap: anywhere; }
.drawer-body .select-wrap, .drawer-body select { max-width: 100%; }
.fx-sel select { width: 100%; text-overflow: ellipsis; }
.drawer-body .timeline li, .drawer-body .nota p, .drawer-body .outcome p, .drawer-body .note span, .drawer-body .notice span { overflow-wrap: anywhere; }
.drawer-body .nota p { white-space: pre-wrap; }
.drawer-body .row .txt b, .drawer-body .row .txt span { overflow-wrap: anywhere; }
.drawer-body .ml-box p, .drawer-body .ml-q, .drawer-body .ml-r { overflow-wrap: anywhere; }
.drawer-body .nota-input, .drawer-body textarea, .drawer-body input { max-width: 100%; box-sizing: border-box; }

/* ---------- Linha da etapa (Conversa e Ações): situação + botão principal + ⋮ ---------- */
.fx-linha { align-items: center; row-gap: var(--s2); }
.fx-sit { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; min-width: 0; }
.fx-sit .badge { max-width: 100%; white-space: normal; overflow-wrap: anywhere; }
.fx-acts { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; justify-content: flex-end; margin-left: auto; min-width: 0; }
.fx-acts .ctx-btn { white-space: nowrap; }
.fx-acts .ctx-btn svg { width: 16px; height: 16px; }
.fx-mais { position: relative; flex: none; }
.fx-menu { position: absolute; right: 0; top: calc(100% + 6px); z-index: 40; min-width: 230px; max-width: calc(100vw - 32px); padding: 6px; display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line-soft); border-radius: var(--r-md) 0 var(--r-md) 0; box-shadow: 0 12px 32px rgba(0,0,0,.25); animation: pop .14s ease; }
.fx-menu[hidden] { display: none; }
.fx-menu button { display: flex; align-items: center; gap: 10px; padding: 11px 12px; border: 0; border-radius: 8px; background: none; color: var(--ink); font: inherit; font-size: var(--fs-base); text-align: left; cursor: pointer; }
.fx-menu button:hover, .fx-menu button:focus-visible { background: var(--surface-raised); }
.fx-menu svg { width: 18px; height: 18px; color: var(--ink-muted); flex: none; }
.fx-menu button span { overflow-wrap: anywhere; }
.fx-volta { white-space: nowrap; }

/* ---------- Atendimento e Cliente: seções separadas por uma linha fina, sem caixas ---------- */
.drawer-body.fx-body { gap: var(--s5); padding: var(--s5) var(--s4) var(--s6); }
.fx-body > .fx-sec + .fx-sec, .fx-body > .fx-sec + .fx-lgpd { border-top: 1px solid var(--line-soft); padding-top: var(--s5); }
.fx-body > .notice, .fx-body > .note { margin: 0; }
.fx-sec { min-width: 0; }
.fx-sec > .label { margin-bottom: var(--s3); }
.fx-lbl { margin: 0 0 var(--s2); font-size: var(--fs-sm); line-height: 18px; font-weight: 600; color: var(--ink-muted); }
.fx-head { display: flex; align-items: center; justify-content: space-between; gap: var(--s2); min-height: 36px; margin-bottom: 4px; }
.fx-head .fx-lbl { margin: 0; }
.fx-vazio { margin: 0 0 var(--s3); font-size: var(--fs-base); line-height: 22px; color: var(--ink-muted); }

/* ---------- Linha de lista (próximo passo, o negócio, compras): ícone 34px, título, detalhe, seta ---------- */
.fx-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.fx-list > li { min-width: 0; }
.fx-list > li + li { border-top: 1px solid var(--line-soft); }
.fx-item { display: flex; align-items: center; gap: var(--s3); width: 100%; min-width: 0; min-height: 52px; padding: var(--s2) 0; border: 0; background: none; color: inherit; font: inherit; text-align: left; }
button.fx-item { cursor: pointer; border-radius: var(--r-sm) 0 var(--r-sm) 0; }
button.fx-item:hover .fx-tx b { text-decoration: underline; text-underline-offset: 3px; }
.fx-ic { flex: none; width: 34px; height: 34px; display: grid; place-items: center; overflow: hidden; border-radius: var(--r-sm) 0 var(--r-sm) 0; background: var(--surface-raised); color: var(--ink-muted); }
.fx-ic svg { width: 18px; height: 18px; }
.fx-ic.pic img { width: 100%; height: 100%; object-fit: cover; display: block; }
.fx-tx { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.fx-tx b { font-size: var(--fs-base); line-height: 20px; font-weight: 600; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fx-tx > span { font-size: var(--fs-sm); line-height: 18px; color: var(--ink-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fx-item .chev, .fx-lapis { flex: none; color: var(--ink-muted); }
.fx-lapis svg { width: 16px; height: 16px; display: block; }
.fx-item .badge { flex: none; }
.fx-item.convite .fx-ic { background: none; border: 1px dashed var(--line); }
.fx-item.convite .fx-tx b { color: var(--accent-text); }
.fx-opc { font-weight: 400; color: var(--ink-muted); }

/* ---------- Atendimento: etapa (barra de progresso) ---------- */
.fx-etapa.mexe { cursor: pointer; }
.fx-et-top { display: flex; align-items: baseline; justify-content: space-between; gap: var(--s2) var(--s3); flex-wrap: wrap; margin-bottom: var(--s2); min-width: 0; }
.fx-et-nome { min-width: 0; max-width: 100%; padding: 0; border: 0; background: none; color: var(--ink); font: inherit; font-size: 17px; line-height: 24px; font-weight: 700; text-align: left; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
button.fx-et-nome { cursor: pointer; }
.fx-et-info { font-size: var(--fs-sm); line-height: 18px; color: var(--ink-muted); white-space: nowrap; }
.fx-temp-tx { padding: 0; border: 0; background: none; color: var(--ink); font: inherit; font-weight: 600; cursor: pointer; text-decoration: underline dotted; text-underline-offset: 3px; }
.fx-temp-tx.vazio { color: var(--ink-muted); font-weight: 400; }
.fx-stepper { margin: 0; }

/* ---------- Atendimento: próximo passo ---------- */
.fx-passo { display: flex; align-items: center; gap: var(--s2); }
.fx-passo .fx-item { flex: 1 1 auto; }
.fx-passo.late .fx-passo-q { color: var(--danger); font-weight: 600; }
.fx-passo.late .fx-ic { color: var(--danger); }
.fx-concluir { flex: none; }
.fx-sugs { display: flex; flex-wrap: wrap; gap: var(--s2); }
.fx-sugs .btn { white-space: normal; text-align: left; height: auto; min-height: 36px; padding-top: 6px; padding-bottom: 6px; max-width: 100%; }

/* ---------- Atendimento: resultado (vendido/perdido) ---------- */
.fx-pv { display: flex; gap: var(--s2); align-items: flex-start; margin: var(--s2) 0 0 !important; padding-top: var(--s2); border-top: 1px solid var(--line-soft); }
.fx-pv svg { width: 18px; height: 18px; flex: none; margin-top: 2px; color: var(--accent-text, var(--ink)); }
.fx-ja { margin: var(--s2) 0 0; }
.fx-btn-sm { height: 36px; padding: 0 var(--s3); font-size: var(--fs-md); }
.fx-btn-sm svg, .fx-btn-sm .lucide { width: 16px !important; height: 16px !important; }

/* ---------- Cliente: linha do tempo ---------- */
.fx-nota { display: flex; gap: var(--s2); align-items: flex-start; margin-bottom: var(--s3); }
.drawer-body .fx-nota-in { flex: 1 1 auto; min-width: 0; min-height: 44px; height: 44px; padding: 9px var(--s3); resize: none; transition: min-height .15s; }
.drawer-body .fx-nota-in:focus, .drawer-body .fx-nota-in.cheio { min-height: 96px; resize: vertical; }
.fx-nota .btn { flex: none; height: 44px; }
.fx-tl-f { display: flex; gap: 6px; margin-bottom: var(--s3); overflow-x: auto; scrollbar-width: none; }
.fx-tl-f::-webkit-scrollbar { display: none; }
.fx-tl-f .pill { height: 32px; padding: 0 var(--s3); font-size: var(--fs-sm); }
.fx-tl { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--s2); }
.fx-tl-p { background: var(--surface-raised); border: 1px solid var(--line-soft); border-left: 3px solid var(--mark); border-radius: var(--r-sm) 0 var(--r-sm) 0; padding: var(--s2) var(--s3); min-width: 0; }
.fx-tl-p.contato { border-left-color: var(--accent-text); }
.fx-tl-p p { margin: 2px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; font-size: var(--fs-base); line-height: 22px; }
.fx-tl-a { display: flex; justify-content: space-between; align-items: baseline; gap: 2px var(--s3); flex-wrap: wrap; padding: 2px 0 2px var(--s3); border-left: 1px solid var(--line-soft); font-size: var(--fs-md); line-height: 20px; color: var(--ink-muted); min-width: 0; }
.fx-tl-a span { min-width: 0; overflow-wrap: anywhere; }
.fx-tl-a b { font-weight: 600; color: var(--ink); }
.fx-tl-a time { font-size: var(--fs-xs); line-height: 18px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.fx-tl-mais { margin-top: var(--s2); }

/* ---------- Atendimento: barra de baixo (Registrar contato + principal + ⋮) ---------- */
.drawer-foot.fx-foot { flex-wrap: nowrap; align-items: center; justify-content: flex-end; gap: var(--s2); }
.drawer-foot.fx-foot .btn { flex: 0 1 auto; min-width: 0; height: 44px; }
.drawer-foot.fx-foot .btn span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.drawer-foot.fx-foot .fx-contato { margin-right: auto; }
.drawer-foot.fx-foot .fx-mais .iconbtn { width: 44px; height: 44px; }
.fx-foot .fx-menu { top: auto; bottom: calc(100% + 8px); }

/* ---------- Diálogos da ficha ---------- */
.fx-dl { font-size: var(--fs-md); font-weight: 600; }
.fx-pills { display: flex; flex-wrap: wrap; gap: 6px; }
.fx-pills .pill { height: auto; min-height: 40px; white-space: normal; text-align: left; padding-top: 6px; padding-bottom: 6px; max-width: 100%; }
#fx-p-tit { margin-top: var(--s2); }
.fx-pf-vals { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s3); }
.fx-carro-foot { flex-wrap: wrap; }
.fx-carro-foot [data-act="fx-novo-carro"] { margin-right: auto; }

/* ---------- Cliente: contato (rótulo à esquerda, valor à direita) ---------- */
.fx-kv { display: flex; flex-direction: column; }
.fx-kv-row { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); min-height: 44px; padding: 6px 0; min-width: 0; }
.fx-kv-row + .fx-kv-row { border-top: 1px solid var(--line-soft); }
.fx-kv-row > span { flex: none; font-size: var(--fs-md); color: var(--ink-muted); }
.fx-kv-row > b { min-width: 0; font-size: var(--fs-base); font-weight: 600; text-align: right; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fx-kv-row a { color: inherit; }
.fx-sel { display: block; min-width: 0; max-width: 60%; }

/* ---------- Cliente: LGPD e arquivo recolhidos no fim ---------- */
.fx-lgpd { padding-top: var(--s3); }
.fx-lgpd > summary { cursor: pointer; font-weight: 600; color: var(--ink-muted); list-style: none; display: flex; align-items: center; gap: var(--s2); min-height: 44px; }
.fx-lgpd > summary::-webkit-details-marker { display: none; }
.fx-lgpd > summary::before { content: ""; width: 7px; height: 7px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(-45deg); transition: transform .15s; flex: none; }
.fx-lgpd[open] > summary::before { transform: rotate(45deg); }
.fx-lgpd-in { display: flex; flex-direction: column; gap: var(--s5); padding-top: var(--s3); }

/* ---------- Diálogo de venda: pós-venda ---------- */
.sale-pv-outro { display: flex; align-items: center; gap: var(--s3); margin-top: var(--s2); flex-wrap: wrap; }
.sale-pv-outro[hidden] { display: none; }
.sale-pv-outro input { width: 120px; }
#sale-pv { flex-wrap: wrap; }

/* computador: mais respiro nas laterais */
@media (min-width: 601px) {
  .drawer-body.fx-body { padding: var(--s6); gap: var(--s6); }
  .fx-body > .fx-sec + .fx-sec, .fx-body > .fx-sec + .fx-lgpd { padding-top: var(--s6); }
}
/* celular: Registrar contato e o botão principal dividem a largura; ⋮ fica com 44px */
@media (max-width: 480px) {
  .drawer-foot.fx-foot { gap: 6px; padding-left: var(--s4); padding-right: var(--s4); }
  .drawer-foot.fx-foot .btn { flex: 1 1 0; padding: 0 var(--s3); justify-content: center; }
  .drawer-foot.fx-foot .fx-contato { margin-right: 0; }
  .drawer-foot.fx-foot .fx-contato svg, .drawer-foot.fx-foot .btn svg { display: none; }
  .fx-pf-vals { grid-template-columns: minmax(0, 1fr); }
  .fx-concluir { padding: 0 10px; }
  .fx-linha { flex-direction: column; align-items: stretch; }
  .fx-acts { justify-content: flex-start; margin-left: 0; }
  .fx-acts .ctx-btn { flex: 1 1 auto; justify-content: center; }
}
/* "O que precisa" (CRM da Motor): o que a loja marcou no site motordevenda.com */
.nec-head { display: flex; align-items: center; justify-content: space-between; gap: var(--s2); }
.nec-head .fx-lbl { margin: 0; }
.nec-list { list-style: none; margin: var(--s2) 0 0; padding: 0; display: grid; gap: var(--s2); }
.nec-list li { display: flex; gap: var(--s2); align-items: flex-start; }
.nec-list li > svg { flex: none; width: 18px; height: 18px; margin-top: 2px; color: var(--ok, #2e7d32); }
.nec-list span, .nec-check span { display: grid; gap: 2px; min-width: 0; }
.nec-list b, .nec-check b { font-size: var(--fs-base); font-weight: 600; }
.nec-list small, .nec-check small { font-size: var(--fs-sm); color: var(--ink-muted); font-weight: 400; }
.nec-tam { display: flex; gap: var(--s2); align-items: center; margin: var(--s3) 0 0; font-size: var(--fs-md); }
.nec-tam svg { width: 18px; height: 18px; color: var(--ink-muted); }
.nec-orig { margin: var(--s2) 0 0; }
.nec-campos { border: 0; padding: 0; margin: 0; display: grid; gap: var(--s2); }
.nec-campos legend { margin-bottom: var(--s2); }
.nec-check { min-height: 52px; padding-top: var(--s2); padding-bottom: var(--s2); align-items: flex-start; }
.nec-check input { margin-top: 3px; flex: none; }
