/* ==========================================================================
   VERFIBSCBS 3.12 — Aba "Revisar cesta básica"
   ========================================================================== */
main.rvAtiva > :not(.rvView):not(footer) { display: none !important; }
.rvView[hidden], .rvView [hidden] { display: none !important; }
.rvView { display: flex; flex-direction: column; gap: 18px; }
.rvSr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.rvBadge {
  margin-left: auto;
  min-width: 22px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: #fff1dc;
  color: #8a4f00;
  font-size: 11px;
  font-weight: 800;
  display: inline-grid;
  place-items: center;
}
.rvBadge[hidden] { display: none; }

.rvHead { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-end; justify-content: space-between; }
.rvHead h1 { margin: 0 0 6px; font-size: 24px; line-height: 1.2; }
.rvHead p { margin: 0; color: var(--muted); line-height: 1.5; max-width: 760px; }
.rvHead p strong { color: var(--text); }
.rvHeadActions { display: flex; flex-wrap: wrap; gap: 8px; }

.rvVazio { padding: 28px; display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.rvVazio p { margin: 0 0 6px; color: var(--muted); }

.rvTiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px; margin-bottom: 18px; }
.rvTile {
  text-align: left;
  min-height: 96px;
  padding: 14px 16px;
  border-radius: 14px;
  background: var(--surface);
  border: 2px solid var(--line);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 6px;
  cursor: pointer;
  font: inherit;
  color: var(--text);
  transition: border-color 0.15s;
}
.rvTile:hover { border-color: #c9d6f2; }
.rvTileTit { display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 700; color: var(--tile); }
.rvTileTit i { width: 10px; height: 10px; border-radius: 3px; background: var(--tile); }
.rvTile strong { font-size: 26px; line-height: 1; }
.rvTile small { font-size: 12px; color: var(--muted); }
.rvTile.on { border-color: var(--tile); }
.rvTile.ax1, .rvChip.ax1 { --tile: #1f4fc8; }
.rvTile.ax7, .rvChip.ax7 { --tile: #8a4f00; }
.rvTile.ax8, .rvChip.ax8 { --tile: #5b34b8; }
.rvTile.ax15, .rvChip.ax15 { --tile: #0e6b39; }
.rvTile.axo, .rvChip.axo { --tile: #475467; }
.rvTile.axs { --tile: #b42318; }

.rvTabela { margin-bottom: 18px; }
.rvToolbar { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.rvBusca { display: flex; align-items: center; gap: 8px; flex: 1 1 300px; max-width: 460px; min-height: 44px; padding: 0 12px; border: 1px solid #d0d5dd; border-radius: 10px; background: #fbfcfe; }
.rvBusca svg { width: 16px; height: 16px; color: var(--muted); flex: 0 0 auto; }
.rvBusca input { border: 0; outline: none; background: transparent; flex: 1; min-width: 0; font: inherit; color: var(--text); }
.rvVistas { display: flex; flex-wrap: wrap; gap: 4px; background: #f2f4f7; padding: 4px; border-radius: 10px; }
.rvVistas button { min-height: 36px; padding: 0 14px; border-radius: 8px; border: 0; background: transparent; color: #475467; font: inherit; font-weight: 600; font-size: 13px; cursor: pointer; }
.rvVistas button span { color: var(--muted); font-weight: 500; }
.rvVistas button.on { background: #ffffff; color: var(--text); box-shadow: 0 1px 2px rgba(16, 24, 40, 0.08); }

.rvScroll { overflow-x: auto; }
.rvGrid { min-width: 900px; }
.rvRow { display: grid; grid-template-columns: minmax(0, 1fr) 120px 200px 70px 220px; gap: 12px; align-items: center; padding: 9px 16px; border-bottom: 1px solid #eef1f5; background: #ffffff; }
.rvRow.susp { background: #fffaf0; }
.rvHeadRow { background: #f8fafc; font-size: 11px; font-weight: 700; color: #475467; text-transform: uppercase; letter-spacing: 0.03em; padding-top: 10px; padding-bottom: 10px; }
.rvProd { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.rvProd strong { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rvLista { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rvMotivo { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; color: #8a4f00; }
.rvMotivo svg { width: 14px; height: 14px; flex: 0 0 auto; }
.rvNcm { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 12px; }
.rvChip { display: inline-block; padding: 4px 10px; border-radius: 999px; font-size: 11px; font-weight: 700; color: var(--tile); background: color-mix(in srgb, var(--tile) 10%, #ffffff); white-space: nowrap; }
.rvNum { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
.rvCenter { text-align: center; }
.rvDec { display: flex; gap: 6px; justify-content: center; }
.rvDec button { min-height: 38px; padding: 0 12px; border-radius: 9px; font: inherit; font-size: 12px; font-weight: 700; display: inline-flex; align-items: center; gap: 6px; cursor: pointer; background: #ffffff; }
.rvDec svg { width: 13px; height: 13px; }
.rvKeep { border: 1px solid #b7e3c8; color: #0e6b39; }
.rvKeep.on { background: #138a4a; border-color: #138a4a; color: #ffffff; }
.rvDrop { border: 1px solid #f3c2c2; color: #b42318; }
.rvDrop.on { background: #b42318; border-color: #b42318; color: #ffffff; }
.rvNada { padding: 36px 16px; text-align: center; color: var(--muted); }
.rvMaisBox { display: flex; justify-content: center; padding: 12px; }
.rvMaisBox [hidden] { display: none; }

.rvFooter {
  position: sticky;
  bottom: 14px;
  z-index: 5;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  background: #172033;
  color: #ffffff;
  border-radius: 14px;
  padding: 12px 12px 12px 20px;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.25);
}
.rvFooterInfo { display: flex; flex-direction: column; gap: 4px; }
.rvTotais { display: flex; flex-wrap: wrap; gap: 18px; font-size: 13px; }
.rvTotais strong { font-size: 16px; }
.rvFooterInfo small { color: #cfd6e4; font-size: 12px; }
.rvFooterActions { display: flex; flex-wrap: wrap; gap: 8px; }
.rvGhost { font-size: 14px !important; min-height: 44px; padding: 0 16px; border-radius: 10px; border: 1px solid #475467; background: transparent; color: #ffffff; font: inherit; font-weight: 600; cursor: pointer; }
.rvPrimary { font-size: 14px !important; min-height: 44px; padding: 0 18px; border-radius: 10px; border: 0; background: #3b6ff0; color: #ffffff; font: inherit; font-weight: 700; cursor: pointer; }
.rvPrimary:hover { background: #2f62e0; }
.rvPrimary:disabled { opacity: 0.7; cursor: wait; }

@media (max-width: 760px) {
  .rvHead h1 { font-size: 20px; }
  .rvFooter { position: static; }
}

/* v3.13 — ajustar NCM/enquadramento e apagar */
.rvRow { grid-template-columns: minmax(0, 1fr) 120px 200px 70px 300px; }
.rvGrid { min-width: 980px; }
.rvNcm s { display: block; color: var(--muted); font-size: 11px; }
.rvAjuste { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; color: #1f4fc8; }
.rvAjuste svg { width: 13px; height: 13px; flex: 0 0 auto; }
.rvIcon { width: 38px; min-height: 38px; padding: 0 !important; justify-content: center; }
.rvIcon svg { width: 16px !important; height: 16px !important; }
.rvEdit { border: 1px solid #c9d6f2; color: #1f4fc8; }
.rvEdit:hover { background: #eef4ff; }
.rvTrash { border: 1px solid #f3c2c2; color: #b42318; }
.rvTrash:hover { background: #fff1f1; }
.rvRestore { border: 1px solid #c9d6f2; color: #1f4fc8; }

.rvModal { position: fixed; inset: 0; z-index: 60; background: rgba(15, 23, 42, 0.45); display: grid; place-items: center; padding: 16px; }
.rvModal[hidden] { display: none; }
.rvModalBox { width: min(520px, 100%); background: #ffffff; border-radius: 16px; box-shadow: var(--shadow-lg); padding: 22px; display: flex; flex-direction: column; gap: 12px; }
.rvModalBox h2 { margin: 0; font-size: 18px; }
.rvEdProduto { font-size: 15px; }
.rvEdInfo { font-size: 12px; color: var(--muted); margin-top: -6px; }
.rvCampo { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 600; }
.rvCampo input, .rvCampo select { min-height: 44px; padding: 0 12px; border: 1px solid #d0d5dd; border-radius: 10px; font: inherit; font-weight: 500; background: #ffffff; color: var(--text); }
.rvCampo input { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; }
.rvCampo small { font-weight: 400; color: var(--muted); font-size: 12px; }
.rvEdMsg { font-size: 12px; color: #8a4f00; min-height: 16px; }
.rvModalAcoes { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.rvModalAcoes [hidden] { display: none; }
.rvEspaco { flex: 1; }

/* v3.14 — aba "Revisar produtos ST" */
.stGrid { min-width: 1080px; }
.rvRow.stRow { grid-template-columns: minmax(0, 1fr) 110px 120px 140px 60px 300px; }
.stRow .rvProd .rvLista { white-space: nowrap; }
.stEsperado { display: block; color: var(--muted); font-size: 11px; text-decoration: none; }
.rvChip.axs { --tile: #b42318; }

/* v3.16 — botões ST (substituição) e AT (antecipação) */
.stBtnST, .stBtnAT { min-width: 56px; justify-content: center; font-size: 13px !important; letter-spacing: 0.04em; }
.stBtnST { border: 1px solid #c9d6f2; color: #1f4fc8; }
.stBtnST.on { background: #1f4fc8; border-color: #1f4fc8; color: #ffffff; }
.stBtnAT { border: 1px solid #d9cdf7; color: #5b34b8; }
.stBtnAT.on { background: #5b34b8; border-color: #5b34b8; color: #ffffff; }
