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

/* ============ Lista de avaliações e contratos: busca, filtros com contagem e linhas em colunas ============ */
.neg-tools { margin-bottom: var(--s3); }
.neg-tools .search { flex: 1 1 360px; max-width: 440px; }
.neg-pills { display: flex; gap: var(--s2); overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; margin-bottom: var(--s4); }
.neg-pills::-webkit-scrollbar { display: none; }
.neg-pills .pill { height: 36px; padding: 0 var(--s3); font-size: var(--fs-md); }
.neg-list { background: var(--surface); border: 1px solid var(--line-soft); border-radius: var(--r-md) 0 var(--r-md) 0; overflow: hidden; }
.neg-ul { list-style: none; margin: 0; padding: 0; }
.neg-hrow, .neg-row { display: grid; grid-template-columns: 56px minmax(0, 1.4fr) minmax(0, 1.4fr) minmax(0, 1.1fr) minmax(0, .9fr) 76px minmax(0, .8fr); gap: var(--s3); align-items: center; padding: 10px var(--s4); }
.neg-hrow { font-size: var(--fs-xs); line-height: 16px; font-weight: 600; color: var(--ink-muted); text-transform: uppercase; letter-spacing: .04em; border-bottom: 1px solid var(--line-soft); background: var(--surface-raised); }
.neg-hrow .r, .nc-val { text-align: right; }
.neg-row { width: 100%; min-height: 60px; margin: 0; border: 0; border-top: 1px solid var(--line-soft); background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.neg-ul li:first-child .neg-row { border-top: 0; }
.neg-row:hover { background: var(--surface-raised); }
.neg-row:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: -2px; }
.neg-row > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nc-num { color: var(--ink-muted); font-variant-numeric: tabular-nums; font-size: var(--fs-md); }
.nc-cli b { display: block; font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
.nc-cli small, .nc-sit small { display: block; font-size: var(--fs-xs); line-height: 16px; color: var(--ink-muted); overflow: hidden; text-overflow: ellipsis; }
.nc-sit { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; }
.nc-sit .badge { max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.nc-sit .ct-miss-txt { font-size: var(--fs-xs); }
.nc-val { font-weight: 600; font-variant-numeric: tabular-nums; }
.nc-car, .nc-data, .nc-resp { color: var(--ink-muted); font-size: var(--fs-md); }
.nc-meta { display: none; }
@media (max-width: 1180px) {
  .neg-hrow, .neg-row { grid-template-columns: 48px minmax(0, 1.4fr) minmax(0, 1.3fr) minmax(0, 1.1fr) minmax(0, .9fr) 76px; }
  .neg-hrow > span:last-child, .nc-resp { display: none; }
}
/* Celular: cartão de duas linhas (cliente e valor / Nº, carro e data com a situação) */
@media (max-width: 860px) {
  .neg-hrow { display: none; }
  .neg-row { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "cli val" "meta sit"; gap: 4px var(--s3); padding: 12px var(--s3); min-height: 0; }
  .nc-num, .nc-car, .nc-data, .nc-resp, .nc-cli small, .nc-sit small { display: none; }
  .nc-cli { grid-area: cli; }
  .nc-val { grid-area: val; }
  .nc-meta { display: block; grid-area: meta; font-size: var(--fs-sm); line-height: 20px; color: var(--ink-muted); }
  .nc-sit { grid-area: sit; align-items: flex-end; }
  .nc-sit .badge { font-size: var(--fs-xs); line-height: 16px; }
}

/* ============ Gaveta: situação no topo, um botão principal e o ⋮ ============ */
.neg-sit { padding: var(--s4); margin: 0 0 var(--s5); background: var(--surface-raised); border-radius: var(--r-md) 0 var(--r-md) 0; }
.neg-sit-top { display: flex; align-items: center; justify-content: space-between; gap: var(--s2); flex-wrap: wrap; margin-bottom: var(--s2); }
.neg-sit-top .badge { max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.neg-passo { font-size: var(--fs-xs); line-height: 16px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--ink-muted); }
.neg-steps { margin-bottom: var(--s3); }
.neg-steps i.now { background: color-mix(in srgb, var(--mark) 40%, var(--surface-high)); }
.neg-sit-txt { margin: 0; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.neg-sit-txt b { font-size: 17px; line-height: 24px; }
.neg-sit-txt > span { color: var(--ink-muted); font-size: var(--fs-md); line-height: 20px; overflow-wrap: anywhere; }
.neg-sit-meta { margin: var(--s2) 0 0; font-size: var(--fs-sm); line-height: 18px; color: var(--ink-muted); overflow-wrap: anywhere; }
.neg-sit .ct-status { display: block; margin: 0 0 2px; }
.neg-alerta { margin-top: var(--s3); }

.drawer-foot.neg-foot { flex-wrap: nowrap; align-items: center; gap: var(--s2); }
.neg-foot-info { flex: 1 1 auto; min-width: 0; color: var(--ink-muted); font-size: var(--fs-md); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.neg-foot-info:empty { flex: 1 1 0; }
.drawer-foot.neg-foot .btn-primary { min-width: 0; max-width: 100%; flex: 0 1 auto; }
.drawer-foot.neg-foot .btn-primary span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.neg-mais { position: relative; flex: none; }
.drawer-foot.neg-foot .neg-mais-btn { flex: none; width: 44px; min-width: 44px; padding: 0; justify-content: center; }
.neg-mais .ph-menu.neg-menu { position: absolute; right: 0; left: auto; top: auto; bottom: calc(100% + 8px); z-index: 60; min-width: 230px; max-width: min(320px, 86vw); 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; }
.neg-mais .ph-menu.neg-menu[hidden] { display: none; }
.neg-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; }
.neg-menu button:hover, .neg-menu button:focus-visible { background: var(--surface-raised); }
.neg-menu button svg { width: 18px; height: 18px; flex: none; color: var(--ink-muted); }
.neg-menu button.danger, .neg-menu button.danger svg { color: var(--danger); }
@media (max-width: 860px) {
  .drawer-foot.neg-foot .btn-primary { flex: 1 1 auto; }
  .neg-foot-info:empty { display: none; }
}

/* ============ Textos e campos que vazavam da gaveta ============ */
.drawer-title h2, .drawer-title p { overflow-wrap: anywhere; }
.neg-body .field, .neg-body .fgrid > * { min-width: 0; }
.neg-body input, .neg-body textarea, .neg-body select { max-width: 100%; min-width: 0; }
.neg-body .ai-row { flex-wrap: wrap; }
.neg-body .ai-row input { flex: 1 1 140px; }
.neg-body .chk-l, .neg-body .chk-gn { min-width: 0; overflow-wrap: anywhere; }
.neg-body .chk-opts { flex-wrap: wrap; }
.neg-body .chk-group summary { gap: var(--s2); }
.neg-body .av-prep-row { grid-template-columns: minmax(0, 1fr) minmax(88px, 140px) auto; }
.neg-body .av-chip { max-width: 100%; overflow-wrap: anywhere; }
.neg-body .av-sum b { overflow-wrap: anywhere; }
.neg-body .timeline li, .neg-body .ct-doc { overflow-wrap: anywhere; }
.neg-body .note > span { min-width: 0; overflow-wrap: anywhere; }
.neg-body .ct-status .ct-miss-txt, .neg-body .ct-status .ct-ok { display: inline-flex; flex-wrap: wrap; }

/* ============ Ficha do lead, aba Negócios ============ */
.neg-lead-head { display: flex; align-items: center; justify-content: space-between; gap: var(--s2); flex-wrap: wrap; margin-bottom: var(--s3); }
.neg-lead-head .label { margin: 0; }
.neg-lead-acts { display: flex; gap: var(--s2); flex-wrap: wrap; }
.neg-lead-list { list-style: none; margin: 0; padding: 0; }
.neg-lrow { display: grid; grid-template-columns: 36px minmax(0, 1fr) auto; gap: var(--s3); align-items: center; width: 100%; padding: 10px 0; border: 0; border-top: 1px solid var(--line-soft); background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.neg-lead-list li:first-child .neg-lrow { border-top: 0; }
.neg-lrow:hover .neg-ltxt b { text-decoration: underline; }
.neg-ico { width: 36px; height: 36px; display: grid; place-items: center; border-radius: var(--r-sm) 0 var(--r-sm) 0; background: var(--surface-raised); color: var(--ink-muted); }
.neg-ico svg { width: 18px; height: 18px; }
.neg-ltxt { min-width: 0; }
.neg-ltxt b { display: block; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.neg-ltxt span { display: block; font-size: var(--fs-sm); line-height: 18px; color: var(--ink-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.neg-lside { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; min-width: 0; }
.neg-lside .badge { font-size: var(--fs-xs); line-height: 16px; }
.neg-lside b { font-size: var(--fs-md); font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ============ Configurações → Avaliação de seminovos ============ */
#avcfg { display: flex; flex-direction: column; gap: var(--s4); }
.avc-regras { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.cfg-card h2 .muted { font-weight: 500; margin-left: 6px; }
.avc-list { display: flex; flex-direction: column; gap: 6px; }
.avc-item, .avc-gh { display: flex; gap: var(--s2); align-items: center; }
.avc-item input, .avc-gh input { flex: 1; min-width: 0; height: 40px; padding: 0 var(--s3); border: 1px solid var(--line); border-radius: var(--r-sm) 0 var(--r-sm) 0; background: var(--surface); color: var(--ink); font: inherit; }
.avc-gh input { font-weight: 700; }
.avc-grupo { display: flex; flex-direction: column; gap: var(--s2); align-items: flex-start; padding-top: var(--s3); border-top: 1px solid var(--line-soft); }
.avc-grupo > .avc-gh, .avc-grupo > .avc-list { width: 100%; }
.avc-grupo:first-of-type { border-top: 0; padding-top: 0; }
.cfg-card > .btn { align-self: flex-start; }
.avc-save { position: sticky; bottom: 0; z-index: 2; display: flex; gap: var(--s2); align-items: center; flex-wrap: wrap; padding: var(--s3) 0; background: var(--surface); border-top: 1px solid var(--line-soft); }
.avc-dirty { flex: 1 1 auto; text-align: right; color: var(--ink-muted); font-size: var(--fs-md); }
@media (max-width: 560px) { .avc-dirty { flex-basis: 100%; text-align: left; order: -1; } .avc-save .btn-primary { flex: 1; } }
