/* ============================================================
   Modal "Detalhe do Lote" — Central de Pedidos (/anuncios?tab=pedidos)
   03/11/2026: cabeçalho deixa de espremer o título (legenda virou rótulo
   da própria barra de etapas), título do WhatsApp limpo (sem *), preço em
   selo, corrente fora da cápsula e status das clientes em texto com ponto.
   Usa só os tokens do app.css — funciona nos dois temas.
   ============================================================ */

#modalLotDetail .mld {
  max-width: 560px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  font-family: var(--font-ui);
}

/* ── Cabeçalho ─────────────────────────────────────────── */
.mld-head {
  position: relative;
  display: flex;
  gap: 16px;
  align-items: flex-start;
  padding: 20px 56px 18px 20px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.mld-photo {
  flex-shrink: 0;
  width: 84px;
  height: 84px;
  border-radius: 12px;
  overflow: hidden;
  background: var(--accent-bg);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
}
.mld-photo img { width: 100%; height: 100%; object-fit: cover; cursor: zoom-in; display: block; }
.mld-info { flex: 1; min-width: 0; }
.mld-title {
  font-size: 16px;
  font-weight: 800;
  line-height: 1.3;
  color: var(--text);
  letter-spacing: -.1px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  overflow-wrap: anywhere;
}
.mld-desc {
  margin-top: 4px;
  font-size: 13px;
  line-height: 1.4;
  color: var(--text-muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.mld-desc:empty { display: none; }
.mld-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.mld-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  padding: 5px 9px;
  border-radius: 999px;
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text-muted);
  white-space: nowrap;
}
.mld-chip i { font-size: 14px; }
.mld-chip--price { background: var(--green-bg); border-color: var(--green-border); color: var(--green); }
.mld-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 18px;
}
.mld-close:hover { background: var(--surface2); color: var(--text); }

/* ── Etapas (a legenda agora é o rótulo de cada etapa) ─── */
.mld-status { padding: 16px 20px 14px; border-bottom: 1px solid var(--border); flex-shrink: 0; }
.mld-steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.mld-step { min-width: 0; }
.mld-step__bar { height: 6px; border-radius: 3px; background: var(--border); }
.mld-step__lbl {
  margin-top: 6px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .3px;
  text-transform: uppercase;
  color: var(--subtle);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mld-step.is-done .mld-step__lbl { color: var(--text-muted); }
.mld-step.is-current .mld-step__lbl { color: var(--step-c); font-weight: 800; }
.mld-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 14px;
}
.mld-now { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 800; }
.mld-now::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
/* No escuro, os tons de status escuros (verde #047857) clareiam no texto */
:root:not([data-theme="light"]) .mld-now,
:root:not([data-theme="light"]) .mld-step.is-current .mld-step__lbl { filter: brightness(1.45); }
.mld-btns { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.mld-btn {
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  padding: 8px 14px;
  border-radius: 10px;
  border: none;
  color: #fff;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}
.mld-btn:disabled { opacity: .6; cursor: default; }
.mld-btn--back { background: transparent; color: var(--text-muted); border: 1px solid var(--border); }
.mld-btn--back:hover { background: var(--surface2); color: var(--text); }

/* ── Números do lote + Etiquetas ───────────────────────── */
.mld-stats {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 12px 20px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  font-size: 13px;
  color: var(--text-muted);
  flex-wrap: wrap;
}
.mld-stat { display: inline-flex; align-items: center; gap: 6px; }
.mld-stat i { font-size: 17px; color: var(--subtle); }
.mld-stat b { color: var(--text); font-weight: 800; }
.mld-stat--total b { color: var(--green); font-size: 15px; }
.mld-print {
  margin-left: auto;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  padding: 7px 12px;
  border-radius: 10px;
  background: var(--accent-bg);
  color: var(--accent);
  border: 1px solid var(--accent-border);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}
.mld-print i { font-size: 15px; }
.mld-print:hover { background: var(--accent-fill); border-color: var(--accent-fill); color: #fff; }

/* ── Lista de clientes ─────────────────────────────────── */
.mld-list { overflow-y: auto; padding: 14px 20px 18px; flex: 1; scrollbar-width: thin; }
.mld-list__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 10px;
}
.mld-rows { display: flex; flex-direction: column; gap: 8px; }
.mld-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  transition: background .15s, border-color .15s;
}
[data-theme="light"] .mld-row { background: #FCF7F7; }
.mld-row.is-pickable { cursor: pointer; user-select: none; }
.mld-row.is-pickable:hover { border-color: var(--accent-border); }
.mld-row.is-pos { background: var(--orange-bg); border-color: var(--orange-border); }
.mld-row.is-conf { background: rgba(249, 115, 22, .14); border: 1.5px solid rgba(249, 115, 22, .6); }
.mld-row__main { flex: 1; min-width: 0; }
.mld-row__name {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.3;
}
.mld-row.is-conf .mld-row__name > span:first-child { color: var(--lt-orange, #f97920); text-decoration: line-through; }
.mld-row__meta {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 4px;
  font-size: 12px;
  color: var(--subtle);
}
.mld-row__meta .sep { opacity: .55; }
.mld-st { display: inline-flex; align-items: center; gap: 5px; font-weight: 700; color: var(--st-c, var(--subtle)); }
.mld-st::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
/* Pago: ícones da forma de pagamento (os mesmos do Financeiro) */
.mld-pay { display: inline-flex; align-items: center; gap: 6px; line-height: 1; }
.mld-pay__logo { height: 17px; width: auto; display: block; border-radius: 3px; }
.mld-pay__pill { height: 20px; width: auto; display: block; }
.mld-pay__pill--2l { height: 20px; }
.mld-link {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: var(--accent);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  flex-shrink: 0;
}
.mld-link svg { width: 16px; height: 16px; }
.mld-link:hover { background: var(--accent-bg); }
.mld-tag {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .4px;
  padding: 2px 7px;
  border-radius: 6px;
  color: #fff;
  line-height: 1.4;
}
.mld-tag--pos { background: #d97706; }
.mld-tag--sent { background: #10b981; }
.mld-row__side { text-align: right; flex-shrink: 0; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.mld-row__amt { font-size: 15px; font-weight: 800; color: var(--green); white-space: nowrap; }
.mld-refunded {
  font-size: 11px;
  font-weight: 800;
  color: var(--lt-purple, #ad8cf9);
  background: rgba(139, 92, 246, .12);
  border: 1px solid rgba(139, 92, 246, .45);
  border-radius: 6px;
  padding: 2px 7px;
}
.mld-refund {
  font: inherit;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 6px;
  border: 1px solid var(--red-border);
  background: var(--red-bg);
  color: var(--red);
  cursor: pointer;
}
.mld-empty { text-align: center; padding: 28px; color: var(--text-muted); }

@media (max-width: 520px) {
  .mld-head { padding: 16px 52px 14px 16px; gap: 12px; }
  .mld-photo { width: 64px; height: 64px; }
  .mld-title { font-size: 15px; }
  .mld-status, .mld-stats, .mld-list { padding-left: 16px; padding-right: 16px; }
  .mld-step__lbl { font-size: 9px; letter-spacing: 0; }
  .mld-print span { display: none; }
}
