/* OSPrimeApp 5.7 - Revenda Pro: conferencia de compra e de venda

   Reaproveita .delivery-check (o item do checklist de retirada da OS) para que
   os dois checklists do sistema tenham o mesmo desenho. Aqui ficam so a grade
   e as caixas que envolvem a lista. */
/* Ações da compra pertencem ao final do formulário, sem cobrir os campos. */
html body.premium-ui #devicePurchaseModal #devicePurchaseForm .device-purchase-actions {
  position: static !important; inset: auto !important; transform: none !important;
  z-index: auto !important; margin: 24px 0 0 !important; padding: 20px 0 0 !important;
  border: 0 !important; border-top: 1px solid #334155 !important;
  background: transparent !important; box-shadow: none !important; backdrop-filter: none !important;
}
html body.premium-ui #devicePurchaseCheckList { grid-template-columns: minmax(0,1fr); gap: 24px; margin-top: 24px; }
html body.premium-ui #devicePurchaseCheckList .purchase-check-group { min-width: 0; padding: 0; margin: 0; border: 0; }
html body.premium-ui #devicePurchaseCheckList legend { padding: 0; margin-bottom: 12px; color: #e8f0ff; font-size: 15px; font-weight: 650; }
html body.premium-ui #devicePurchaseCheckList .purchase-check-items { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; }
html body.premium-ui #devicePurchaseCheckList .delivery-check {
  display: flex !important; align-items: center; gap: 12px; min-height: 60px;
  padding: 14px !important; border: 1px solid #334155; border-radius: 8px;
  background: #101c2d; cursor: pointer; text-transform: none !important;
}
html body.premium-ui #devicePurchaseCheckList .delivery-check span { font-size: 14px !important; line-height: 1.5 !important; font-weight: 500 !important; text-transform: none !important; letter-spacing: 0 !important; color: #e0e9f5; min-width: 0; overflow-wrap: anywhere; }
html body.premium-ui #devicePurchaseCheckList input[type="checkbox"] { appearance: auto; flex: 0 0 22px; width: 22px !important; height: 22px !important; min-height: 22px !important; margin: 0; accent-color: #38bdf8; }
html body.premium-ui #devicePurchaseCheckList .delivery-check:has(input:checked) { background: #102c2a; border-color: #408b79; }
html body.premium-ui #devicePurchaseCheckList .delivery-check:focus-within { outline: 2px solid #69caff; outline-offset: 2px; }
html body.premium-ui #devicePurchaseModal .purchase-check-progress { display: grid; gap: 8px; min-width: 170px; }
html body.premium-ui #devicePurchaseCheckProgress { width: 100%; height: 8px; accent-color: #38bdf8; }
@media(max-width:768px){
  html body.premium-ui #devicePurchaseCheckList .purchase-check-items { grid-template-columns: minmax(0,1fr); }
  html body.premium-ui #devicePurchaseModal .purchase-check-head { flex-wrap: wrap; }
  html body.premium-ui #devicePurchaseModal .purchase-check-progress { width: 100%; }
}
body.premium-ui .resale-check-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 10px 0;
}
body.premium-ui .resale-check-block {
  margin: 4px 0 2px;
  padding: 14px;
  border: 1px solid rgba(75, 111, 160, .34);
  border-radius: 14px;
  background: rgba(12, 25, 42, .55);
}
body.premium-ui .resale-check-block > b {
  font-size: 13px;
  color: #e8f0ff;
}
body.premium-ui .resale-check-device {
  padding: 12px 14px;
  border: 1px solid rgba(75, 111, 160, .34);
  border-left: 3px solid var(--accent-base, #38bdf8);
  border-radius: 12px;
  background: rgba(12, 25, 42, .55);
}
body.premium-ui .resale-check-device b { display: block; font-size: 14px; color: #edf5ff; }
body.premium-ui .resale-check-device small { display: block; margin-top: 3px; color: #93a7c4; font-size: 12px; }
body.premium-ui #resaleCheckSummary { margin: 2px 0 0; }

/* Consulta por aparelho e leitura consistente das etapas da revenda. */
html body.premium-ui.mc-resale-537 #page-resale .resale-stock-tools {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(190px, 240px) auto;
  align-items: end;
  gap: 12px;
  margin: 20px 0 8px;
}
html body.premium-ui.mc-resale-537 #page-resale .resale-stock-tools label { display: flex; flex-direction: column; gap: 8px; min-width: 0; margin: 0; }
html body.premium-ui.mc-resale-537 #page-resale .resale-stock-tools label > span { font-size: 13px; font-weight: 650; color: #afbed2; text-transform: none !important; letter-spacing: 0 !important; }
html body.premium-ui.mc-resale-537 #page-resale .resale-stock-tools :is(input,select) { width: 100%; min-width: 0; height: 44px; font-size: 14px; border-radius: 8px; }
html body.premium-ui.mc-resale-537 #page-resale .resale-stock-tools input::placeholder { color: #afbed2; opacity: 1; }
html body.premium-ui.mc-resale-537 #page-resale .resale-stock-count { color: #afbed2; font-size: 13px; margin: 12px 0 16px; }
html body.premium-ui.mc-resale-537 #page-resale .resale-stock-empty { padding: 28px 20px !important; color: #afbed2; text-align: center; line-height: 1.6; }
html body.premium-ui.mc-resale-537 #page-resale .resale-section-head { gap: 16px; align-items: center; flex-wrap: wrap; }
html body.premium-ui.mc-resale-537 #page-resale .resale-tab-panel > .resale-box { background: transparent !important; border: 0 !important; box-shadow: none !important; padding: 8px 0 0 !important; }
html body.premium-ui.mc-resale-537 #page-resale .resale-funnel-step { grid-template-columns: minmax(0,1fr) auto !important; grid-template-rows: auto auto !important; gap: 6px !important; padding: 14px !important; }
html body.premium-ui.mc-resale-537 #page-resale .resale-funnel-icon { display: none !important; }
html body.premium-ui.mc-resale-537 #page-resale .resale-funnel-step > span:not(.resale-funnel-icon) { display: block !important; grid-area: 1 / 1 !important; color: #edf3fc; font-size: 13px; font-weight: 700; }
html body.premium-ui.mc-resale-537 #page-resale .resale-funnel-step b { grid-area: 1 / 2 !important; font-size: 20px !important; font-variant-numeric: tabular-nums; }
html body.premium-ui.mc-resale-537 #page-resale .resale-funnel-step small { grid-area: 2 / 1 / 3 / 3 !important; font-size: 12px !important; color: #afbed2 !important; font-weight: 400 !important; letter-spacing: 0 !important; }
html body.premium-ui.mc-resale-537 #page-resale .resale-tabs .btn-tab { min-height: 44px !important; font-size: 13px !important; border-radius: 8px !important; box-shadow: none !important; }
html body.premium-ui.mc-resale-537 #page-resale .resale-summary .resale-card { border-radius: 12px !important; box-shadow: none !important; }
html body.premium-ui.mc-resale-537 #page-resale .resale-summary .kpi-label { color: #afbed2 !important; font-size: 12px !important; }
html body.premium-ui #page-resale #resaleSummary[hidden] { display: none !important; }
html body.premium-ui.mc-resale-537 #page-resale .resale-stock-tools :is(input,select,button):focus-visible { outline: 3px solid #699fff; outline-offset: 3px; }
html body.premium-ui.mc-resale-537 #page-resale #deviceStockTable .mini-btn { min-height: 40px !important; }
@media(max-width:900px) {
  html body.premium-ui.mc-resale-537 #page-resale .resale-stock-tools { grid-template-columns: minmax(0,1fr) auto; }
  html body.premium-ui.mc-resale-537 #page-resale .resale-stock-search { grid-column: 1 / -1; }
}
@media(max-width:520px) {
  html body.premium-ui.mc-resale-537 #page-resale .resale-tabs { display: grid !important; grid-template-columns: repeat(2,minmax(0,1fr)) !important; gap: 8px !important; }
  html body.premium-ui.mc-resale-537 #page-resale .resale-stock-tools { grid-template-columns: minmax(0,1fr); }
  html body.premium-ui.mc-resale-537 #page-resale .resale-funnel { display: grid !important; grid-template-columns: repeat(2,minmax(0,1fr)) !important; }
  html body.premium-ui.mc-resale-537 #page-resale .resale-funnel-step:last-child { grid-column: 1 / -1; }
}

@media (max-width: 720px) {
  body.premium-ui .resale-check-list { grid-template-columns: 1fr; }
}

/* Selo da conferencia nas listagens de estoque e de vendas.
   Cinza = ninguem conferiu; ambar = ficou item pendente (com explicacao,
   que a regra exige); verde = passou tudo. Clicar abre o registro. */
body.premium-ui .resale-check-badge {
  display: inline-block;
  margin-top: 5px;
  padding: 3px 8px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 800;
  line-height: 1.5;
  white-space: nowrap;
  cursor: pointer;
}
body.premium-ui button.resale-check-badge:hover { filter: brightness(1.18); }
body.premium-ui .resale-check-badge.ok {
  border-color: rgba(44, 172, 111, .45);
  background: rgba(18, 59, 44, .75);
  color: #72e6a8;
}
body.premium-ui .resale-check-badge.parcial {
  border-color: rgba(233, 179, 68, .45);
  background: rgba(233, 179, 68, .12);
  color: #e7b744;
}
body.premium-ui .resale-check-badge.vazio {
  border-color: rgba(113, 132, 155, .35);
  background: rgba(113, 132, 155, .12);
  color: #93a7c4;
  cursor: default;
}

/* O "PDF/WhatsApp" flutuando no alto de uma célula vazia.

   O legacy alinha TODAS as células de #deviceSalesTable pelo topo:

     body.premium-ui.mc-resale-537 #page-resale #deviceSalesTable td
       { vertical-align: top !important }

   Para as células de texto está certo — cliente, aparelho e total têm duas
   linhas cada e precisam começar na mesma altura. Mas a última célula tem só
   um botão de 30px dentro de uma linha de 57px: alinhado pelo topo, ele fica
   pendurado com 27px de vazio embaixo e não se alinha com nada. É o botão
   solto da tela.

   A célula de ação passa a centralizar. As outras ficam como estão. */
html body.premium-ui.mc-resale-537 #page-resale #deviceSalesTable td.row-actions,
html body.premium-ui.mc-resale-537 #page-resale #devicePurchasesTable td.row-actions,
html body.premium-ui.mc-resale-537 #page-resale #deviceStockTable td.row-actions {
  vertical-align: middle !important;
}

/* Conferência dentro da ordem de compra.

   Mesmo desenho do bloco da conferência (.resale-check-block) para as duas
   telas contarem a mesma história — a lista em si já reaproveita o
   .resale-check-list, que por sua vez reaproveita o .delivery-check da OS.
   Aqui só entra o cabeçalho com o contador. */
body.premium-ui .purchase-check-block {
  margin: 4px 0 2px;
  padding: 14px;
  border: 1px solid rgba(75, 111, 160, .34);
  border-radius: 14px;
  background: rgba(12, 25, 42, .55);
}
body.premium-ui .purchase-check-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
body.premium-ui .purchase-check-head b {
  display: block;
  font-size: 13px;
  color: #e8f0ff;
}
body.premium-ui .purchase-check-head small {
  display: block;
  margin-top: 3px;
  color: #93a7c4;
  font-size: 12px;
}
/* O contador muda de cor quando tudo foi conferido: dá para ver de longe se a
   compra foi checada por inteiro sem contar caixinha por caixinha. */
body.premium-ui .purchase-check-resumo {
  flex: 0 0 auto;
  padding: 5px 10px;
  border: 1px solid rgba(113, 132, 155, .35);
  border-radius: 999px;
  background: rgba(113, 132, 155, .12);
  color: #93a7c4;
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}
body.premium-ui .purchase-check-resumo.completo {
  border-color: rgba(52, 221, 145, .45);
  background: rgba(52, 221, 145, .12);
  color: #34dd91;
}

/* Fotos do aparelho — na compra e na venda.

   Mesma moldura dos outros blocos da Revenda. As miniaturas ficam numa grade
   que se ajusta sozinha: com duas fotos não sobra buraco, com dez não vira
   uma fileira infinita. */
body.premium-ui .device-fotos-bloco {
  margin: 4px 0 2px;
  padding: 14px;
  border: 1px solid rgba(75, 111, 160, .34);
  border-radius: 14px;
  background: rgba(12, 25, 42, .55);
}
body.premium-ui .device-fotos-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
body.premium-ui .device-fotos-head b {
  display: block;
  font-size: 13px;
  color: #e8f0ff;
}
body.premium-ui .device-fotos-head small {
  display: block;
  margin-top: 3px;
  max-width: 52ch;
  color: #93a7c4;
  font-size: 12px;
}
/* O botão é um <label> (o input fica escondido dentro dele), então precisa dos
   44px na mão: a regra da família .btn não alcança label. */
body.premium-ui .device-foto-btn {
  flex: 0 0 auto;
  display: inline-flex !important;
  flex-direction: row !important;
  align-items: center;
  gap: 7px;
  min-height: 44px;
  margin: 0;
  padding: 0 14px;
  border: 1px solid rgba(148, 163, 184, .22);
  border-radius: 12px;
  background: rgba(30, 41, 59, .62);
  color: #e2e8f0;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
}
body.premium-ui .device-foto-btn:hover { background: rgba(56, 189, 248, .12); }
/* Sem aparelho ainda: o botão fica apagado e não convida ao clique. */
body.premium-ui .device-foto-btn.disabled {
  opacity: .45;
  cursor: not-allowed;
  pointer-events: none;
}
body.premium-ui .device-foto-btn .btn-icon svg { width: 18px; height: 18px; }

body.premium-ui .device-fotos-grade {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: 8px;
  margin-top: 10px;
}
body.premium-ui .device-fotos-grade:empty { margin-top: 0; }
body.premium-ui .device-foto {
  position: relative;
  margin: 0;
  overflow: hidden;
  border: 1px solid rgba(75, 111, 160, .34);
  border-radius: 11px;
  background: #081522;
}
body.premium-ui .device-foto img {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
}
body.premium-ui .device-foto-x {
  position: absolute;
  top: 5px;
  right: 5px;
  width: 26px;
  height: 26px;
  padding: 0;
  border: 1px solid rgba(255, 108, 131, .45);
  border-radius: 8px;
  background: rgba(8, 16, 28, .82);
  color: #ff8fa1;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
}
body.premium-ui .device-foto-x:hover { background: rgba(255, 108, 131, .22); }

@media (max-width: 768px) {
  body.premium-ui .device-fotos-head { gap: 10px; }
  body.premium-ui .device-foto-btn { width: 100%; justify-content: center; }
  body.premium-ui .device-fotos-grade { grid-template-columns: repeat(auto-fill, minmax(86px, 1fr)); }
}

/* Cores dos badges de status das ordens de compra */
body.premium-ui.mc-resale-537 #page-resale .resale-badge.quote {
  background: rgba(148, 163, 184, .12) !important;
  border: 1px solid rgba(148, 163, 184, .30) !important;
  color: #94a3b8 !important;
}
body.premium-ui.mc-resale-537 #page-resale .resale-badge.bought {
  background: rgba(250, 204, 21, .10) !important;
  border: 1px solid rgba(250, 204, 21, .28) !important;
  color: #fbbf24 !important;
}
body.premium-ui.mc-resale-537 #page-resale .resale-badge.shipped {
  background: rgba(59, 130, 246, .13) !important;
  border: 1px solid rgba(59, 130, 246, .35) !important;
  color: #93c5fd !important;
}
body.premium-ui.mc-resale-537 #page-resale .resale-badge.received {
  background: rgba(139, 92, 246, .13) !important;
  border: 1px solid rgba(139, 92, 246, .35) !important;
  color: #c4b5fd !important;
}
body.premium-ui.mc-resale-537 #page-resale .resale-badge.stock {
  background: rgba(34, 197, 94, .11) !important;
  border: 1px solid rgba(34, 197, 94, .32) !important;
  color: #86efac !important;
}
body.premium-ui.mc-resale-537 #page-resale .resale-badge.cancelled {
  background: rgba(239, 68, 68, .10) !important;
  border: 1px solid rgba(239, 68, 68, .28) !important;
  color: #fca5a5 !important;
}

/* Cores dos badges de disponibilidade do estoque */
body.premium-ui.mc-resale-537 #page-resale .resale-badge.prestock {
  background: rgba(250, 204, 21, .10) !important;
  border: 1px solid rgba(250, 204, 21, .28) !important;
  color: #fbbf24 !important;
}
body.premium-ui.mc-resale-537 #page-resale .resale-badge.in_stock {
  background: rgba(34, 197, 94, .11) !important;
  border: 1px solid rgba(34, 197, 94, .32) !important;
  color: #86efac !important;
}
body.premium-ui.mc-resale-537 #page-resale .resale-badge.reserved {
  background: rgba(139, 92, 246, .13) !important;
  border: 1px solid rgba(139, 92, 246, .35) !important;
  color: #c4b5fd !important;
}
body.premium-ui.mc-resale-537 #page-resale .resale-badge.sold {
  background: rgba(59, 130, 246, .13) !important;
  border: 1px solid rgba(59, 130, 246, .35) !important;
  color: #93c5fd !important;
}
/* Pós-venda: separe contato e agendamento para leitura rápida no celular. */
#page-resale .followup-row b,
#page-resale .followup-row small {
  display: block;
  overflow-wrap: anywhere;
}
#page-resale .followup-row small {
  margin-top: 4px;
  line-height: 1.5;
}
body.premium-ui.mc-resale-537 #page-resale .followup-row.cancelled strong {
  color: var(--text-muted, #94a3b8) !important;
  background: rgba(148, 163, 184, .08) !important;
  border-color: rgba(148, 163, 184, .22) !important;
}

/* ==========================================================================
   FATURAMENTO, TICKET MÉDIO & KPI CARDS DA REVENDA PRO
   ========================================================================== */
.resale-summary-wrap {
  margin: 14px 0 20px !important;
  background: rgba(15, 23, 42, 0.55) !important;
  border: 1px solid rgba(148, 163, 184, 0.16) !important;
  border-radius: 16px !important;
  padding: 16px 18px !important;
  backdrop-filter: blur(12px) !important;
  -webkit-backdrop-filter: blur(12px) !important;
  box-sizing: border-box !important;
  width: 100% !important;
}
.resale-summary-header {
  display: flex !important;
  justify-content: space-between !important;
  align-items: center !important;
  flex-wrap: wrap !important;
  gap: 12px !important;
  margin-bottom: 14px !important;
  padding-bottom: 12px !important;
  border-bottom: 1px solid rgba(148, 163, 184, 0.1) !important;
}
.resale-summary-title {
  display: flex !important;
  align-items: center !important;
  gap: 12px !important;
}
.resale-summary-icon {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 36px !important;
  height: 36px !important;
  min-width: 36px !important;
  border-radius: 10px !important;
  background: linear-gradient(135deg, rgba(0, 229, 255, 0.15) 0%, rgba(2, 132, 199, 0.15) 100%) !important;
  border: 1px solid rgba(0, 229, 255, 0.3) !important;
}
.resale-summary-text {
  display: flex !important;
  flex-direction: column !important;
  gap: 2px !important;
}
.resale-summary-text b {
  font-size: 15px !important;
  color: #f1f5f9 !important;
  font-weight: 700 !important;
  letter-spacing: -0.2px !important;
  line-height: 1.2 !important;
}
.resale-summary-text small {
  font-size: 12px !important;
  color: #94a3b8 !important;
  line-height: 1.2 !important;
}
.resale-period-toggle {
  display: inline-flex !important;
  gap: 4px !important;
  background: rgba(10, 16, 28, 0.75) !important;
  padding: 3px !important;
  border-radius: 10px !important;
  border: 1px solid rgba(148, 163, 184, 0.18) !important;
}
.resale-period-btn {
  background: transparent !important;
  border: none !important;
  color: #94a3b8 !important;
  font-size: 12px !important;
  font-weight: 600 !important;
  padding: 6px 14px !important;
  border-radius: 7px !important;
  cursor: pointer !important;
  transition: all 0.18s ease !important;
  white-space: nowrap !important;
}
.resale-period-btn:hover {
  color: #f1f5f9 !important;
  background: rgba(255, 255, 255, 0.06) !important;
}
.resale-period-btn.active {
  background: #0284c7 !important;
  color: #ffffff !important;
  box-shadow: 0 2px 8px rgba(2, 132, 199, 0.45) !important;
}

html body.premium-ui.mc-resale-537 #page-resale .resale-summary,
html body #page-resale .resale-summary,
.resale-summary {
  display: grid !important;
  grid-template-columns: repeat(6, minmax(0, 1fr)) !important;
  gap: 12px !important;
  margin: 0 !important;
  padding: 0 !important;
  width: 100% !important;
  box-sizing: border-box !important;
}
html body.premium-ui.mc-resale-537 #page-resale .resale-card,
html body #page-resale .resale-card,
.resale-card {
  display: flex !important;
  flex-direction: column !important;
  justify-content: space-between !important;
  min-height: 102px !important;
  height: 100% !important;
  box-sizing: border-box !important;
  padding: 13px 14px !important;
  border-radius: 12px !important;
  background: rgba(15, 23, 42, 0.72) !important;
  border: 1px solid rgba(148, 163, 184, 0.16) !important;
  position: relative !important;
  overflow: hidden !important;
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.22) !important;
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease !important;
}
html body.premium-ui.mc-resale-537 #page-resale .resale-card:hover,
.resale-card:hover {
  transform: translateY(-2px) !important;
  border-color: rgba(148, 163, 184, 0.32) !important;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35) !important;
}
html body.premium-ui.mc-resale-537 #page-resale .resale-card.good,
.resale-card.good {
  border-left: 3px solid #10b981 !important;
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.08) 0%, rgba(15, 23, 42, 0.75) 100%) !important;
}
html body.premium-ui.mc-resale-537 #page-resale .resale-card.highlight,
.resale-card.highlight {
  border-left: 3px solid #00e5ff !important;
  background: linear-gradient(135deg, rgba(0, 229, 255, 0.09) 0%, rgba(15, 23, 42, 0.75) 100%) !important;
}
html body.premium-ui.mc-resale-537 #page-resale .resale-card.bad,
.resale-card.bad {
  border-left: 3px solid #ef4444 !important;
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.08) 0%, rgba(15, 23, 42, 0.75) 100%) !important;
}
html body.premium-ui.mc-resale-537 #page-resale .resale-card .resale-card-top,
.resale-card .resale-card-top {
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
  margin-bottom: 4px !important;
  width: 100% !important;
}
html body.premium-ui.mc-resale-537 #page-resale .resale-card .kpi-ico,
.resale-card .kpi-ico {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 24px !important;
  height: 24px !important;
  min-width: 24px !important;
  border-radius: 6px !important;
  background: rgba(148, 163, 184, 0.12) !important;
  color: #94a3b8 !important;
  flex-shrink: 0 !important;
}
html body.premium-ui.mc-resale-537 #page-resale .resale-card.good .kpi-ico,
.resale-card.good .kpi-ico {
  color: #34d399 !important;
  background: rgba(16, 185, 129, 0.15) !important;
}
html body.premium-ui.mc-resale-537 #page-resale .resale-card.highlight .kpi-ico,
.resale-card.highlight .kpi-ico {
  color: #38bdf8 !important;
  background: rgba(0, 229, 255, 0.15) !important;
}
html body.premium-ui.mc-resale-537 #page-resale .resale-card.bad .kpi-ico,
.resale-card.bad .kpi-ico {
  color: #f87171 !important;
  background: rgba(239, 68, 68, 0.15) !important;
}
html body.premium-ui.mc-resale-537 #page-resale .resale-card .kpi-ico svg,
.resale-card .kpi-ico svg {
  width: 14px !important;
  height: 14px !important;
}
html body.premium-ui.mc-resale-537 #page-resale .resale-card .kpi-label,
.resale-card .kpi-label {
  font-size: 11px !important;
  font-weight: 700 !important;
  color: #94a3b8 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.5px !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  line-height: 1.2 !important;
  flex: 1 !important;
}
html body.premium-ui.mc-resale-537 #page-resale .resale-card .kpi-val,
html body.premium-ui.mc-resale-537 #page-resale .resale-card b,
.resale-card .kpi-val,
.resale-card b {
  font-size: clamp(16px, 1.35vw, 20px) !important;
  font-weight: 800 !important;
  color: #f8fafc !important;
  font-variant-numeric: tabular-nums !important;
  letter-spacing: -0.3px !important;
  margin: 2px 0 4px !important;
  display: block !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  line-height: 1.2 !important;
}
html body.premium-ui.mc-resale-537 #page-resale .resale-card .kpi-sub,
.resale-card .kpi-sub {
  font-size: 11px !important;
  color: #64748b !important;
  font-weight: 500 !important;
  display: block !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  line-height: 1.25 !important;
}

@media(max-width: 1140px) {
  html body.premium-ui.mc-resale-537 #page-resale .resale-summary,
  .resale-summary {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  }
}
@media(max-width: 720px) {
  .resale-summary-wrap {
    padding: 12px 14px !important;
  }
  .resale-summary-header {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 10px !important;
  }
  .resale-period-toggle {
    width: 100% !important;
    display: grid !important;
    grid-template-columns: repeat(4, 1fr) !important;
  }
  .resale-period-btn {
    padding: 6px 4px !important;
    text-align: center !important;
    font-size: 11.5px !important;
  }
  html body.premium-ui.mc-resale-537 #page-resale .resale-summary,
  .resale-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 8px !important;
  }
  html body.premium-ui.mc-resale-537 #page-resale .resale-card,
  .resale-card {
    padding: 10px 12px !important;
    min-height: 88px !important;
  }
  html body.premium-ui.mc-resale-537 #page-resale .resale-card .kpi-val,
  .resale-card .kpi-val {
    font-size: 16px !important;
  }
}
@media(max-width: 380px) {
  html body.premium-ui.mc-resale-537 #page-resale .resale-summary,
  .resale-summary {
    grid-template-columns: 1fr !important;
  }
}

/* ==========================================================================
   SELETOR RÁPIDO DE MODELOS DE IPHONE (NOVA COMPRA)
   ========================================================================== */
.iphone-quick-selector {
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.8) 0%, rgba(20, 29, 48, 0.7) 100%);
  border: 1px solid rgba(56, 189, 248, 0.22);
  border-radius: 14px;
  padding: 16px 18px;
  margin: 10px 0 16px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
}
.quick-selector-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.1);
}
.quick-selector-title {
  display: flex;
  align-items: center;
  gap: 10px;
}
.apple-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  color: #f1f5f9;
}
.quick-selector-title b {
  font-size: 14px;
  color: #f8fafc;
}
.quick-selector-title small {
  display: block;
  font-size: 11.5px;
  color: #94a3b8;
}
.quick-selector-dropdown-wrap select {
  background: rgba(10, 16, 28, 0.85) !important;
  border: 1px solid rgba(56, 189, 248, 0.35) !important;
  color: #f8fafc !important;
  height: 38px !important;
  border-radius: 8px !important;
  padding: 0 12px !important;
  font-size: 13px !important;
  font-weight: 600 !important;
}
.quick-pill-section {
  margin-bottom: 12px;
}
.quick-pill-label {
  font-size: 11.5px;
  font-weight: 700;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}
.quick-pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
#quickIphonePills {
  max-height: 104px;
  overflow-y: auto;
  padding-right: 4px;
  scrollbar-width: thin;
  scrollbar-color: rgba(56, 189, 248, 0.3) transparent;
}
#quickIphonePills::-webkit-scrollbar {
  width: 5px;
}
#quickIphonePills::-webkit-scrollbar-track {
  background: transparent;
}
#quickIphonePills::-webkit-scrollbar-thumb {
  background: rgba(56, 189, 248, 0.28);
  border-radius: 4px;
}
.quick-pill {
  background: rgba(30, 41, 59, 0.7);
  border: 1px solid rgba(148, 163, 184, 0.2);
  color: #cbd5e1;
  font-size: 12px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}
.quick-pill:hover {
  background: rgba(56, 189, 248, 0.18);
  border-color: rgba(56, 189, 248, 0.45);
  color: #ffffff;
  transform: translateY(-1px);
}
.quick-pill.active {
  background: #0284c7 !important;
  border-color: #38bdf8 !important;
  color: #ffffff !important;
  box-shadow: 0 2px 10px rgba(2, 132, 199, 0.5);
}
.quick-pill-row.mini .quick-pill {
  font-size: 11.5px;
  padding: 4px 9px;
  border-radius: 6px;
}
.quick-attributes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 10px;
  background: rgba(10, 16, 28, 0.45);
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.08);
}
.quick-attr-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.quick-attr-label {
  font-size: 11px;
  font-weight: 700;
  color: #94a3b8;
}

/* ==========================================================================
   VENDAS: BUSCA, FILTROS, ESTATÍSTICAS E BADGE DE LUCRO
   ========================================================================== */
html body.premium-ui.mc-resale-537 #page-resale .resale-sales-tools {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(140px, 180px) minmax(140px, 180px) auto;
  align-items: end;
  gap: 12px;
  margin: 16px 0 10px;
}
html body.premium-ui.mc-resale-537 #page-resale .resale-sales-tools label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 0;
}
html body.premium-ui.mc-resale-537 #page-resale .resale-sales-tools label > span {
  font-size: 12px;
  font-weight: 650;
  color: #afbed2;
}
html body.premium-ui.mc-resale-537 #page-resale .resale-sales-tools :is(input,select) {
  width: 100%;
  height: 42px;
  font-size: 13.5px;
  border-radius: 8px;
}
.resale-sales-stats-bar {
  margin: 6px 0 14px;
}
.resale-sales-stats-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  font-size: 12.5px;
  color: #afbed2;
}
.resale-sales-stats-chips span {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(148, 163, 184, 0.16);
  padding: 4px 10px;
  border-radius: 8px;
}
.resale-sales-stats-chips span b {
  color: #f8fafc;
}
.resale-sales-stats-chips .profit-highlight {
  border-color: rgba(16, 185, 129, 0.35) !important;
  background: rgba(16, 185, 129, 0.12) !important;
  color: #6ee7b7 !important;
}
.resale-sales-stats-chips .profit-highlight b {
  color: #a7f3d0 !important;
}

.profit-badge {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 6px;
  font-weight: 700;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}
.profit-badge.good {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.35);
  color: #34d399;
}
.profit-badge.bad {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.35);
  color: #f87171;
}

@media(max-width:900px) {
  html body.premium-ui.mc-resale-537 #page-resale .resale-sales-tools {
    grid-template-columns: minmax(0,1fr) auto;
  }
  html body.premium-ui.mc-resale-537 #page-resale .resale-sales-search {
    grid-column: 1 / -1;
  }
}
@media(max-width:520px) {
  html body.premium-ui.mc-resale-537 #page-resale .resale-sales-tools {
    grid-template-columns: minmax(0,1fr);
  }
  .quick-attributes-grid {
    grid-template-columns: 1fr;
  }
}

/* Revenda Pro - Barra Rápida de Checklist e Card de Aparelho no PDV */
.resale-check-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  grid-column: 1 / -1;
}
.resale-check-toolbar .btn-sm {
  padding: 5px 12px;
  font-size: 12px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}
.resale-check-toolbar .check-all-btn {
  background: rgba(16, 185, 129, 0.14);
  border: 1px solid rgba(16, 185, 129, 0.35);
  color: #34d399;
}
.resale-check-toolbar .check-all-btn:hover {
  background: rgba(16, 185, 129, 0.25);
  border-color: #34d399;
}
.resale-check-toolbar .uncheck-all-btn {
  background: rgba(148, 163, 184, 0.1);
  border: 1px solid rgba(148, 163, 184, 0.2);
  color: #94a3b8;
}
.resale-check-toolbar .uncheck-all-btn:hover {
  background: rgba(148, 163, 184, 0.2);
  color: #e2e8f0;
}

/* Card do Aparelho Selecionado no PDV */
.resale-selected-card {
  background: linear-gradient(135deg, rgba(30, 58, 95, 0.45), rgba(15, 23, 42, 0.75));
  border: 1px solid rgba(56, 189, 248, 0.35);
  border-radius: 14px;
  padding: 16px;
  margin-top: 4px;
  margin-bottom: 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
}
.resale-selected-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.resale-selected-card-title {
  display: flex;
  align-items: center;
  gap: 10px;
}
.resale-selected-card-title h3 {
  font-size: 16px;
  font-weight: 700;
  color: #f8fafc;
  margin: 0;
}
.resale-selected-card-chips {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.badge-battery {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
}
.badge-battery.good {
  background: rgba(16, 185, 129, 0.16);
  border: 1px solid rgba(16, 185, 129, 0.4);
  color: #34d399;
}
.badge-battery.warn {
  background: rgba(245, 158, 11, 0.16);
  border: 1px solid rgba(245, 158, 11, 0.4);
  color: #fbbf24;
}
.badge-battery.bad {
  background: rgba(239, 68, 68, 0.16);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #f87171;
}
.imei-copyable {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(56, 189, 248, 0.1);
  border: 1px solid rgba(56, 189, 248, 0.25);
  color: #7dd3fc;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 11.5px;
  font-family: ui-monospace, SFMono-Regular, monospace;
  cursor: pointer;
  transition: all 0.15s ease;
}
.imei-copyable:hover {
  background: rgba(56, 189, 248, 0.2);
  border-color: #38bdf8;
  color: #e0f2fe;
}
.resale-selected-finance-row {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 12.5px;
  color: #94a3b8;
}
.resale-selected-finance-row b {
  color: #f1f5f9;
}
.resale-selected-finance-row .profit-tag {
  color: #34d399;
  font-weight: 700;
}

/* Suporte à Venda de Múltiplos Celulares (PDV Revenda Pro) */
.resale-device-picker-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 8px;
}
.resale-add-device-row {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  flex-wrap: wrap;
  background: rgba(15, 23, 42, 0.4);
  padding: 12px;
  border-radius: 12px;
  border: 1px solid rgba(56, 189, 248, 0.18);
}
.resale-device-select-label {
  flex: 1 1 280px;
  margin: 0 !important;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.resale-device-select-label span {
  font-size: 13px;
  font-weight: 650;
  color: #bae6fd;
}
.resale-device-select-label select {
  height: 44px;
  border-radius: 8px;
  background: #0b1523;
  border: 1px solid #233854;
  color: #f1f5f9;
}
#resaleAddDeviceBtn {
  height: 44px;
  padding: 0 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 700;
  white-space: nowrap;
  border-radius: 8px;
  background: linear-gradient(135deg, #0284c7, #0369a1);
  color: #fff;
  border: 1px solid rgba(56, 189, 248, 0.4);
  cursor: pointer;
  transition: all 0.2s ease;
}
#resaleAddDeviceBtn:hover {
  filter: brightness(1.15);
  box-shadow: 0 0 16px rgba(56, 189, 248, 0.35);
}

/* Bloco do Carrinho de Aparelhos */
.resale-cart-devices {
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: linear-gradient(135deg, rgba(16, 28, 48, 0.65), rgba(11, 19, 34, 0.85));
  border: 1px solid rgba(56, 189, 248, 0.3);
  border-radius: 14px;
  padding: 16px;
  margin-top: 4px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}
.resale-cart-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.resale-cart-head-title {
  display: flex;
  align-items: center;
  gap: 8px;
}
.resale-cart-head-title b {
  font-size: 15px;
  color: #f8fafc;
}
.resale-cart-count-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  border-radius: 999px;
  background: rgba(56, 189, 248, 0.2);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.4);
  font-size: 12px;
  font-weight: 700;
}
.resale-cart-tip {
  font-size: 12px;
  color: #94a3b8;
}

/* Itens / Cards de Cada Aparelho no Carrinho */
.resale-cart-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.resale-cart-item {
  display: grid;
  grid-template-columns: auto minmax(180px, 1fr) auto auto;
  align-items: center;
  gap: 14px;
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(75, 111, 160, 0.3);
  border-radius: 10px;
  padding: 12px 14px;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.resale-cart-item:hover {
  border-color: rgba(56, 189, 248, 0.45);
  background: rgba(18, 30, 52, 0.75);
}
.resale-cart-icon {
  font-size: 24px;
  line-height: 1;
}
.resale-cart-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.resale-cart-info h4 {
  margin: 0;
  font-size: 14.5px;
  font-weight: 700;
  color: #f1f5f9;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.resale-cart-info-badges {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.resale-cart-price-col {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}
.resale-cart-price-col span {
  font-size: 11px;
  color: #94a3b8;
  font-weight: 600;
  text-transform: uppercase;
}
.resale-cart-price-input {
  width: 120px !important;
  height: 36px !important;
  font-size: 14px !important;
  font-weight: 700 !important;
  text-align: right;
  border-radius: 6px !important;
  padding: 4px 8px !important;
  background: #09131f !important;
  border: 1px solid #334e68 !important;
  color: #38bdf8 !important;
}
.resale-cart-remove-btn {
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.35);
  color: #f87171;
  border-radius: 8px;
  padding: 8px 10px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 650;
  transition: all 0.15s ease;
}
.resale-cart-remove-btn:hover {
  background: rgba(239, 68, 68, 0.28);
  border-color: #ef4444;
  color: #fee2e2;
}

/* Rodapé de Resumo do Carrinho */
.resale-cart-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 13px;
  color: #cbd5e1;
}
.resale-cart-summary b {
  color: #38bdf8;
  font-size: 15px;
}
.resale-cart-margin {
  color: #34d399;
  font-weight: 700;
}

@media(max-width: 640px) {
  .resale-cart-item {
    grid-template-columns: auto 1fr;
    grid-template-rows: auto auto;
  }
  .resale-cart-price-col {
    align-items: flex-start;
  }
}


/* OSPrimeApp 5.8 - Melhorias de Compra e Conferência de Entrega */
.purchase-dest-card {
  padding: 12px 14px;
  background: rgba(16, 28, 45, 0.7);
  border: 1px solid #334155;
  border-radius: 10px;
  margin: 6px 0 10px;
}
.purchase-dest-label {
  margin-bottom: 8px;
  font-size: 13px;
  color: #cbd5e1;
}
.purchase-dest-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
@media(max-width: 640px) {
  .purchase-dest-buttons {
    grid-template-columns: 1fr;
  }
}
.dest-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 8px;
  border: 1px solid #334155;
  background: #0f172a;
  color: #94a3b8;
  cursor: pointer;
  text-align: left;
  transition: all 0.2s ease;
}
.dest-btn:hover {
  border-color: #64748b;
  color: #f8fafc;
}
.dest-btn.active {
  background: rgba(14, 165, 233, 0.15) !important;
  border-color: #38bdf8 !important;
  color: #f8fafc !important;
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.25);
}
.dest-btn strong {
  display: block;
  font-size: 13px;
  color: #f8fafc;
}
.dest-btn small {
  display: block;
  font-size: 11px;
  color: #94a3b8;
  margin-top: 2px;
}
.dest-icon {
  font-size: 22px;
  line-height: 1;
}
.quick-brand-section {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 6px 0 12px;
}

/* Conferência da Entrega no PDV */
#resaleSaleCheckList {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  margin-top: 14px;
}
#resaleSaleCheckList .purchase-check-group.delivery-group {
  border: 1px solid #334155;
  border-radius: 10px;
  padding: 14px;
  background: rgba(15, 23, 42, 0.65);
}
#resaleSaleCheckList legend {
  padding: 0 8px;
  color: #38bdf8;
  font-size: 13px;
  font-weight: 650;
  letter-spacing: 0.3px;
}
#resaleSaleCheckList .purchase-check-items {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 8px;
  margin-top: 10px;
}
#resaleSaleCheckList .delivery-check {
  display: flex !important;
  align-items: center;
  gap: 12px;
  padding: 10px 14px !important;
  background: #101c2d;
  border: 1px solid #233549;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s ease;
}
#resaleSaleCheckList .delivery-check:hover {
  border-color: #38bdf8;
}
#resaleSaleCheckList .delivery-check:has(input:checked) {
  background: #0f2d2a !important;
  border-color: #2dd4bf !important;
}
#resaleSaleCheckList .delivery-check span {
  font-size: 13px !important;
  color: #e2e8f0;
  font-weight: 500;
  line-height: 1.4;
}
#resaleSaleCheckList input[type="checkbox"] {
  flex: 0 0 20px;
  width: 20px !important;
  height: 20px !important;
  accent-color: #2dd4bf;
  cursor: pointer;
}


/* OSPrimeApp 5.8 - Destino Compacto no Modal de Compra */
.device-dest-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.dest-segmented-control {
  display: flex;
  align-items: center;
  background: #09111e;
  border: 1px solid #233549;
  border-radius: 8px;
  padding: 3px;
  gap: 4px;
}
.dest-segment {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: 6px;
  border: 0;
  background: transparent;
  color: #94a3b8;
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}
.dest-segment:hover {
  color: #e2e8f0;
  background: rgba(255, 255, 255, 0.04);
}
.dest-segment.active {
  background: #0284c7 !important;
  color: #ffffff !important;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(2, 132, 199, 0.35);
}
.dest-segment .seg-icon {
  font-size: 14px;
}

/* PDV - Carrinho de Aparelhos Moderno */
.resale-device-picker-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 6px;
}
.resale-add-device-row {
  display: flex;
  align-items: flex-end;
  gap: 12px;
}
.resale-device-select-label {
  flex: 1;
  margin: 0;
}
.resale-add-device-row .btn {
  height: 42px;
  white-space: nowrap;
}

.resale-cart-devices {
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: #0c1827;
  border: 1px solid #1e3a5f;
  border-radius: 12px;
  padding: 16px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}
.resale-cart-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #1e293b;
  padding-bottom: 10px;
}
.resale-cart-head-title {
  display: flex;
  align-items: center;
  gap: 10px;
}
.resale-cart-head-title b {
  font-size: 15px;
  color: #f1f5f9;
}
.resale-cart-count-badge {
  background: #0369a1;
  color: #e0f2fe;
  font-size: 11px;
  font-weight: 650;
  padding: 3px 8px;
  border-radius: 999px;
}
.resale-cart-tip {
  font-size: 12px;
  color: #94a3b8;
}
.resale-cart-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.resale-cart-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px;
  background: #112237;
  border: 1px solid #234165;
  border-radius: 10px;
  transition: border-color 0.2s ease;
}
.resale-cart-item:hover {
  border-color: #38bdf8;
}
.resale-cart-icon {
  font-size: 26px;
  line-height: 1;
}
.resale-cart-info {
  flex: 1;
  min-width: 0;
}
.resale-cart-info h4 {
  margin: 0 0 6px;
  font-size: 15px;
  font-weight: 650;
  color: #f8fafc;
}
.resale-cart-info-badges {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}
.resale-cart-info-badges .badge-battery {
  font-size: 11px;
  padding: 2px 7px;
  border-radius: 4px;
  font-weight: 600;
}
.resale-cart-info-badges .badge-battery.good { background: #064e3b; color: #a7f3d0; }
.resale-cart-info-badges .badge-battery.warn { background: #78350f; color: #fde68a; }
.resale-cart-info-badges .badge-battery.bad { background: #7f1d1d; color: #fecaca; }
.resale-cart-info-badges .imei-copyable {
  font-size: 11.5px;
  font-family: monospace;
  background: #1e293b;
  color: #38bdf8;
  padding: 2px 8px;
  border-radius: 4px;
  cursor: pointer;
}
.resale-cart-info-badges .imei-copyable:hover {
  background: #0284c7;
  color: #fff;
}
.resale-cart-info-badges .status-pill {
  font-size: 11px;
  padding: 2px 7px;
  background: #1e293b;
  color: #cbd5e1;
  border-radius: 4px;
}
.resale-cart-info-badges .muted {
  font-size: 11.5px;
  color: #94a3b8;
}

.resale-cart-price-col {
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: 140px;
}
.resale-cart-price-col span {
  font-size: 11px;
  color: #94a3b8;
  text-transform: uppercase;
}
.resale-cart-price-input {
  width: 100%;
  height: 36px;
  padding: 4px 8px;
  font-size: 14px;
  font-weight: 650;
  color: #38bdf8;
  background: #091320;
  border: 1px solid #233a55;
  border-radius: 6px;
  text-align: right;
}
.resale-cart-price-input:focus {
  border-color: #38bdf8;
  outline: none;
}
.resale-cart-remove-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 7px 12px;
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #fca5a5;
  border-radius: 6px;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
}
.resale-cart-remove-btn:hover {
  background: #dc2626;
  color: #fff;
  border-color: #dc2626;
}

.resale-cart-summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 12px;
  border-top: 1px solid #1e293b;
  font-size: 13px;
  color: #cbd5e1;
}
.resale-cart-summary b {
  color: #38bdf8;
  font-weight: 700;
}
.resale-cart-margin {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
}

/* Conferência da Entrega - Layout em 3 Colunas Modernas */
#resaleSaleCheckList {
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  gap: 14px !important;
  margin-top: 14px !important;
}
@media(max-width: 900px) {
  #resaleSaleCheckList {
    grid-template-columns: 1fr !important;
  }
}
#resaleSaleCheckList .purchase-check-group.delivery-group {
  display: flex;
  flex-direction: column;
  border: 1px solid #233549 !important;
  border-radius: 10px !important;
  padding: 12px !important;
  background: #091320 !important;
  margin: 0 !important;
}
#resaleSaleCheckList legend {
  padding: 0 6px !important;
  color: #38bdf8 !important;
  font-size: 13px !important;
  font-weight: 650 !important;
  margin-bottom: 8px !important;
}
#resaleSaleCheckList .purchase-check-items {
  display: flex !important;
  flex-direction: column !important;
  gap: 8px !important;
}
#resaleSaleCheckList .delivery-check {
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
  padding: 9px 12px !important;
  background: #0e1a2b !important;
  border: 1px solid #1a2c42 !important;
  border-radius: 7px !important;
  cursor: pointer !important;
  transition: all 0.15s ease !important;
  text-transform: none !important;
}
#resaleSaleCheckList .delivery-check:hover {
  border-color: #38bdf8 !important;
}
#resaleSaleCheckList .delivery-check:has(input:checked) {
  background: #0b2b28 !important;
  border-color: #14b8a6 !important;
}
#resaleSaleCheckList .delivery-check span {
  font-size: 12.5px !important;
  color: #e2e8f0 !important;
  font-weight: 500 !important;
  line-height: 1.35 !important;
  text-transform: none !important;
}
#resaleSaleCheckList input[type="checkbox"] {
  flex: 0 0 18px !important;
  width: 18px !important;
  height: 18px !important;
  accent-color: #14b8a6 !important;
  cursor: pointer !important;
  margin: 0 !important;
}
.resale-check-toolbar .check-all-btn {
  background: #059669 !important;
  color: #ffffff !important;
  border-color: #10b981 !important;
  font-weight: 600 !important;
}
.resale-check-toolbar .check-all-btn:hover {
  background: #047857 !important;
}


/* OSPrimeApp 5.8 - Melhorias de Compra e Venda */
.label-with-badge {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}
.badge-link-anatel {
  background: #1e293b;
  color: #38bdf8;
  border: 1px solid #334155;
  border-radius: 4px;
  font-size: 11px;
  padding: 2px 7px;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.2s ease;
}
.badge-link-anatel:hover {
  background: #0284c7;
  color: #fff;
  border-color: #38bdf8;
}

.quick-margin-pills {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 5px;
}
.margin-pill-title {
  font-size: 11px;
  color: #94a3b8;
}
.margin-pill {
  background: #0f172a;
  color: #38bdf8;
  border: 1px solid #233549;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 7px;
  cursor: pointer;
  transition: all 0.15s ease;
}
.margin-pill:hover {
  background: #0284c7;
  color: #fff;
  border-color: #0284c7;
}

/* Banner de Pós-Compra */
.purchase-post-actions-card {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.12) 0%, rgba(15, 23, 42, 0.8) 100%);
  border: 1px solid #10b981;
  border-radius: 10px;
  padding: 14px 16px;
  margin-bottom: 16px;
  animation: fadeIn 0.3s ease;
}
.post-actions-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}
.post-actions-icon {
  font-size: 24px;
}
.post-actions-head b {
  font-size: 15px;
  color: #34d399;
}
.post-actions-head p {
  margin: 2px 0 0;
  font-size: 12px;
  color: #cbd5e1;
}
.post-actions-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* Painel de Trade-in no PDV */
.resale-tradein-panel {
  background: #091320;
  border: 1px solid #1e3a5f;
  border-radius: 10px;
  padding: 12px 14px;
  margin-top: 4px;
  transition: all 0.2s ease;
}
.resale-tradein-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
}
.tradein-checkbox-label {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  user-select: none;
}
.tradein-checkbox-label input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: #0284c7;
  cursor: pointer;
}
.tradein-title {
  font-size: 13.5px;
  color: #f1f5f9;
}
.tradein-badge {
  font-size: 11.5px;
  background: #1e293b;
  padding: 3px 8px;
  border-radius: 4px;
  color: #94a3b8;
}
.resale-tradein-content {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed #233549;
}

/* Painel de Acessórios no PDV */
.resale-accessories-panel {
  background: #091320;
  border: 1px solid #1e293b;
  border-radius: 10px;
  padding: 12px 14px;
  margin-top: 4px;
}
.accessories-title {
  font-size: 13px;
  color: #cbd5e1;
  margin-bottom: 8px;
}
.accessories-pill-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.acc-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  background: #101c2d;
  border: 1px solid #233549;
  border-radius: 6px;
  font-size: 12px;
  color: #e2e8f0;
  cursor: pointer;
  user-select: none;
  transition: all 0.15s ease;
}
.acc-pill:hover {
  border-color: #38bdf8;
}
.acc-pill:has(input:checked) {
  background: rgba(14, 165, 233, 0.15);
  border-color: #0284c7;
  color: #38bdf8;
  font-weight: 600;
}
.acc-pill input[type="checkbox"] {
  width: 15px;
  height: 15px;
  accent-color: #0284c7;
  margin: 0;
}

.tax-tag-trade {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 12px;
}
