/* ===================== Listas com busca: Orçamentos e Ordens de serviço ===================== */
.lst-tools { flex-wrap: wrap; margin-bottom: var(--s4); }
.lst-tools .scroller { min-width: 0; }

.lst-box { background: var(--surface); border: 1px solid var(--line-soft); border-radius: var(--r-md); overflow: hidden; }
.lst { list-style: none; margin: 0; padding: 0; }
.lst > li + li { border-top: 1px solid var(--line-soft); }

/* mesmas colunas no título e nas linhas */
.lst-head, .lst-row {
  display: grid; align-items: center; gap: var(--s3);
  grid-template-columns: minmax(64px, .55fr) minmax(0, 1.3fr) minmax(0, 1.7fr) minmax(0, 1.4fr) minmax(0, .8fr) minmax(0, .75fr) minmax(0, .8fr);
  padding: 0 var(--s4);
}
.lst-head { min-height: 40px; background: var(--surface-raised); border-bottom: 1px solid var(--line-soft); color: var(--ink-muted); font-size: 12px; font-weight: 600; }
.lst-head > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.lst-row {
  width: 100%; min-height: 56px; margin: 0; border: 0; border-radius: 0; background: transparent; color: var(--ink);
  font: inherit; font-size: 14px; text-align: left; cursor: pointer;
}
.lst-row:hover { background: var(--surface-raised); }
.lst-row:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: -2px; }
.lst-row > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lst-num { font-weight: 600; font-variant-numeric: tabular-nums; }
.lst-cli { font-weight: 600; }
.lst-placa { color: var(--ink-muted); }
.lst-dim, .lst-resp, .lst-data { color: var(--ink-muted); }
.lst-val, .lst-data { font-variant-numeric: tabular-nums; }
.lst-row > .lst-st { display: flex; flex-wrap: wrap; gap: var(--s1); padding: var(--s2) 0; white-space: normal; }
.lst-st .badge { white-space: nowrap; }
.lst-m2 { display: none; }

/* telas médias: sai a coluna do responsável */
@media (max-width: 1080px) and (min-width: 761px) {
  .lst-head, .lst-row { grid-template-columns: minmax(60px, .55fr) minmax(0, 1.3fr) minmax(0, 1.6fr) minmax(0, 1.4fr) minmax(0, .85fr) minmax(0, .8fr); }
  .lst-head > span:last-child, .lst-row > .lst-resp { display: none; }
}

/* celular: cada item vira um cartão de duas linhas */
@media (max-width: 760px) {
  .lst-tools { flex-wrap: nowrap; }
  .lst-head { display: none; }
  .lst-row {
    grid-template-columns: auto minmax(0, 1fr) auto;
    grid-template-areas: "num cli st" "m2 m2 m2";
    row-gap: 2px; column-gap: var(--s2); padding: var(--s3) var(--s4);
  }
  .lst-num { grid-area: num; }
  .lst-cli { grid-area: cli; }
  .lst-cli::before { content: "· "; color: var(--ink-muted); font-weight: 400; }
  .lst-row > .lst-st { grid-area: st; flex-wrap: nowrap; justify-content: flex-end; padding: 0; max-width: 46vw; overflow: hidden; }
  .lst-row > .lst-car, .lst-row > .lst-val, .lst-row > .lst-data, .lst-row > .lst-resp { display: none; }
  .lst-row > .lst-m2 { display: block; grid-area: m2; color: var(--ink-muted); font-size: 13px; }
}

/* ===================== Barra fixa da gaveta (Orçamento e OS): situação + próxima ação + menu ⋮ ===================== */
.dr-barra {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s2) var(--s3);
  margin: 0 var(--s2) var(--s3); padding: var(--s2) var(--s2) var(--s2) var(--s3);
  background: var(--surface-raised); border: 1px solid var(--line-soft); border-radius: var(--r-md); color: var(--ink);
}
.dr-etapa { display: flex; align-items: center; gap: var(--s2); min-width: 0; flex: 1 1 140px; }
.dr-etapa .badge { flex: none; max-width: 60%; overflow: hidden; text-overflow: ellipsis; }
.dr-etapa small { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink-muted); font-size: 13px; line-height: 18px; }
.dr-acoes { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: var(--s2); min-width: 0; margin-left: auto; }
.dr-acoes .btn { max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.dr-mais { width: 36px; height: 36px; border-radius: var(--r-sm); }
.dr-mais:hover { background: var(--surface); }
/* menu ⋮: linhas com ícone */
.dr-mais-lista .row { min-height: 56px; }
.dr-mais-lista .row > svg.lucide { width: 20px; height: 20px; flex: none; color: var(--ink-muted); }
.dr-mais-lista .row.dr-perigo .txt b, .dr-mais-lista .row.dr-perigo > svg.lucide { color: var(--danger); }
.btn-sm { height: 36px; padding: 0 var(--s3); font-size: 14px; }
.btn-sm svg.lucide { width: 16px; height: 16px; }

@media (max-width: 560px) {
  .dr-barra { margin: 0 0 var(--s3); }
  .dr-etapa { flex-basis: 100%; }
  .dr-acoes { flex: 1 1 100%; margin-left: 0; }
  .dr-acoes .btn { flex: 1 1 auto; padding: 0 var(--s3); }
  .dr-mais { flex: none; }
}

/* celular: os selos extras da OS quebram linha em vez de sumir */
@media (max-width: 760px) { .lst-st { white-space: normal; flex-wrap: wrap; max-width: none; overflow: visible; } }
