/* =========================================================
   REGION: TABELA DE PRECOS / REPOSICAO SNAPSHOT
   ========================================================= */
.tabela-view-header {
  display: grid;
  gap: .25rem;
  margin-bottom: 1.35rem;
}

.tabela-view-header h1 {
  margin: 0;
}

.tabela-view-header p {
  margin: 0;
  color: #64748b;
  font-size: 1rem;
  font-weight: 600;
}

.tbl-indicators {
  display: flex;
  align-items: center;
  justify-content: center;
  justify-items: center;
  gap: 10px;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  min-height: 30px;
  padding: 8px 10px;
  margin: 0 auto 16px;
  text-align: center;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
}

.tbl-indicators::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}

.tbl-indicators .dot {
  flex: 0 0 auto;
  width: 10px;
  height: 10px;
  aspect-ratio: 1 / 1;
  padding: 0;
  border: 1px solid #aebccb;
  border-radius: 50%;
  background: #c8d2dc;
  box-shadow: none;
  cursor: pointer;
  font-size: 0;
  line-height: 0;
  transition:
    background-color .15s ease,
    border-color .15s ease,
    box-shadow .15s ease,
    transform .15s ease;
}

.tbl-indicators .dot.active {
  border-color: #315a7a;
  background: #5680a7;
  box-shadow: 0 0 0 4px rgba(86, 128, 167, .18);
  transform: scale(1.25);
}

.tbl-indicators .dot:hover,
.tbl-indicators .dot:focus {
  border-color: #5680a7;
  background: #8aaac6;
  outline: 0;
}

.tbl-indicators .dot.active:hover,
.tbl-indicators .dot.active:focus {
  background: #426b91;
}

.tbl-indicators .dot.is-draggable {
  cursor: pointer;
}

.tbl-indicators .dot.is-dragging {
  cursor: grabbing;
  opacity: .45;
}

.tbl-indicators .dot.is-drag-over {
  border-color: #315a7a;
  box-shadow: 0 0 0 5px rgba(49, 90, 122, .16);
  transform: scale(1.35);
}

.tbl-indicators .dot:focus-visible {
  outline: 0;
}

.tbl-indicators .dot.is-add-table {
  width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-color: #8bb69f;
  background: #fff;
  color: #198754;
  font-size: 16px;
  font-weight: 700;
  line-height: 1;
  text-align: center;
}

.tbl-indicators .dot.is-add-table::before {
  content: "+";
  display: block;
  width: 100%;
  line-height: 16px;
  transform: translateY(-1.87px);
}

.tbl-indicators .dot.is-add-table:hover,
.tbl-indicators .dot.is-add-table:focus {
  border-color: #198754;
  background: #e9f7ef;
  color: #146c43;
}

.tabela-name-row {
  width: 100%;
  margin: 0 0 16px;
  border: 1px solid #dee2e6;
  border-bottom: 0;
  background: #fff;
}

.tabela-name-cell {
  display: block;
  width: 100%;
  min-width: 0;
  min-height: 48px;
  padding: 10px;
  border: 0;
  border-bottom: 1px solid #dee2e6;
  border-radius: 0;
  background: transparent;
  color: #111;
  font: inherit;
  font-weight: 700;
  line-height: 1.5;
  text-align: center;
  outline: 0;
  box-shadow: none;
}

.tabela-name-cell::placeholder {
  color: #555;
  opacity: 1;
}

.tabela-name-cell:focus {
  background: #f8fbff;
  box-shadow: inset 0 -2px 0 rgba(86, 128, 167, .32);
}

.table--tabela thead th {
  text-align: center;
}

.table--tabela td {
  line-height: 1.5;
}

.table--tabela td.col-desc {
  position: relative;
  max-width: 500px;
  padding-right: 28px;
}

.table--tabela .produto-fabricante {
  margin-top: 2px;
  font-size: calc(1em - 4px);
  line-height: 1.15;
  font-weight: 400;
}

.table--tabela td.col-preco input,
.table--tabela td.col-obs input,
.table--tabela td.col-min input,
.table--tabela td.col-lt input,
.table--tabela td.col-mp input {
  display: block;
  width: 100%;
  min-width: 0;
  padding: 0;
  margin: 0;
  border: 0 !important;
  border-radius: 0;
  color: inherit;
  background: transparent !important;
  font: inherit;
  font-size: inherit;
  line-height: inherit;
  text-align: center;
  outline: none !important;
  box-shadow: none !important;
  appearance: none;
  -webkit-appearance: none;
}

.table--tabela td.col-preco input:focus,
.table--tabela td.col-obs input:focus,
.table--tabela td.col-min input:focus,
.table--tabela td.col-lt input:focus,
.table--tabela td.col-mp input:focus {
  outline: none;
  box-shadow: inset 0 -2px 0 rgba(13, 110, 253, .25);
}

.table--tabela td.col-preco input[readonly] {
  cursor: default;
}

.table--tabela td.col-preco input.is-a7-price-divergent {
  color: color-mix(in srgb, var(--tabela-price-color, #111) 30%, transparent) !important;
}

.table--tabela td.col-obs input {
  color: #f00 !important;
}

.table--tabela .btn-del,
.table--tabela .btn-add {
  position: absolute;
  top: 50%;
  right: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  min-height: 24px;
  padding: 0;
  margin: 0;
  border: 0;
  background: transparent;
  font-size: 18px;
  font-weight: 700;
  line-height: 1;
  text-decoration: none !important;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-50%);
  transition: opacity .15s ease, transform .12s ease, color .12s ease;
}

.table--tabela .btn-del {
  color: #d01919;
}

.table--tabela .btn-add {
  min-width: var(--icon-btn-size);
  min-height: var(--icon-btn-size);
  border-radius: var(--icon-btn-radius);
  color: #198754;
}

.table--tabela tr:hover .btn-del,
.table--tabela .btn-del:focus,
.table--tabela tr:hover .btn-add,
.table--tabela .btn-add:focus {
  opacity: 1;
  pointer-events: auto;
}

.table--tabela .btn-del,
.table--tabela .btn-del:hover,
.table--tabela .btn-del:focus,
.table--tabela .btn-del:active {
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  text-decoration: none !important;
}

.table--tabela .btn-del:hover {
  color: #d01919;
  transform: translateY(-50%) scale(1.12);
}

.table--tabela .btn-add:hover {
  transform: translateY(-50%) scale(1.12);
}

.table--tabela .btn-del:focus {
  outline: none;
}

.table--tabela .btn-del:focus-visible {
  outline: 2px solid rgba(208, 25, 25, .35) !important;
  border-radius: 4px;
}

.table--tabela .btn-add:focus-visible {
  outline: 2px solid rgba(25, 135, 84, .35);
  border-radius: 4px;
}

.table--tabela td.cell-save-ok {
  background-color: rgb(243, 255, 241) !important;
  transition: background-color .25s ease;
}

.table--tabela td.cell-save-err {
  background-color: rgba(220, 53, 69, .2) !important;
  transition: background-color .25s ease;
}

.tabela-confirm-modal {
  position: fixed;
  inset: 0;
  z-index: 1095;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  overflow: hidden;
  overscroll-behavior: contain;
}

.tabela-confirm-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, .45);
  touch-action: none;
}

.tabela-confirm-dialog {
  position: relative;
  width: min(380px, 100%);
  padding: 18px;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 18px 44px rgba(15, 23, 42, .24);
}

.tabela-confirm-dialog h2 {
  margin: 0 0 8px;
  color: #172033;
  font-size: 1.05rem;
  line-height: 1.2;
}

.tabela-confirm-dialog p {
  margin: 0;
  color: #495057;
}

.orc-import-dialog {
  width: min(920px, calc(100vw - 28px));
  max-height: calc(100vh - 28px);
  overflow: auto;
  overscroll-behavior: contain;
  touch-action: pan-y;
}

body.orc-import-modal-open {
  overflow: hidden;
  overscroll-behavior: none;
}

body.orc-import-modal-open #orcamentoModal .orcamento-scroll {
  overflow: hidden;
  overscroll-behavior: none;
}

body.orc-history-modal-open {
  overflow: hidden;
  overscroll-behavior: none;
}

body.orc-history-modal-open #orcamentoModal .orcamento-scroll {
  overflow: hidden;
  overscroll-behavior: none;
}

.orc-history-dialog {
  width: min(720px, calc(100vw - 28px));
  max-height: calc(100vh - 28px);
  overflow: auto;
  overscroll-behavior: contain;
}

.orc-history-dialog .search-wrap { width: 100%; }
.orc-history-list { display: grid; gap: 8px; max-height: min(480px, 52vh); overflow-y: auto; }
.orc-history-item { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 12px; border: 1px solid #dee2e6; border-radius: 8px; background: #fff; color: inherit; text-decoration: none; cursor: pointer; transition: background-color .15s ease, border-color .15s ease; }
.orc-history-item:hover { border-color: #c8ced4; background: #f5f6f7; color: inherit; text-decoration: none; }
.orc-history-item:focus-visible { outline: 2px solid #86b7fe; outline-offset: 2px; }
.orc-history-item[aria-disabled="true"] { cursor: wait; opacity: .7; }
.orc-history-info { display: flex; min-width: 0; flex: 1 1 auto; flex-direction: column; }
.orc-history-info strong { overflow-wrap: anywhere; }
.orc-history-info small { color: #6c757d; }
.orc-history-delete { width: var(--icon-btn-size); height: var(--icon-btn-size); min-width: var(--icon-btn-size); flex: 0 0 var(--icon-btn-size); padding: 0; }

.orc-import-dialog #orc-import-title {
  margin-bottom: 12px;
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1.25;
}

.orc-import-requirement-title {
  font-weight: 600;
}

.orc-import-file-control {
  display: grid;
  position: relative;
  height: 42px;
  grid-template-columns: auto minmax(0, 1fr);
  overflow: hidden;
  border: 1px solid #dfe5ea;
  border-radius: 8px;
  background: #fff;
}

.orc-import-file-input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

.orc-import-file-button,
.orc-import-file-name {
  display: flex;
  min-width: 0;
  align-items: center;
  padding: 0 12px;
}

.orc-import-file-button {
  height: 42px;
  border-right: 1px solid #dfe5ea;
  background: #eef0f2;
  color: #172033;
  font-weight: 600;
  cursor: pointer;
  transition: background-color .15s ease-in-out;
}

.orc-import-file-button:hover {
  background: #dfe3e7;
}

.orc-import-file-input:focus-visible + .orc-import-file-button {
  outline: 2px solid #9bbbd3;
  outline-offset: -2px;
}

.orc-import-file-name {
  overflow: hidden;
  color: #172033;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.orc-import-image-control {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.orc-import-image-control .orc-import-paste-button {
  white-space: nowrap;
}

.orc-import-separator {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 12px 0;
  color: #6c757d;
  font-size: .8rem;
  text-transform: uppercase;
}

.orc-import-separator::before,
.orc-import-separator::after {
  height: 1px;
  flex: 1;
  background: #e3e7eb;
  content: "";
}

.orc-import-text-control {
  width: 100%;
}

.orc-import-text-control textarea.form-control {
  min-height: 92px;
  resize: vertical;
}

.orc-import-preview {
  margin-top: 14px;
}

.orc-import-review-header,
.orc-import-review-row {
  display: grid;
  grid-template-columns: 90px minmax(0, 1fr) 120px;
}

.orc-import-review-header {
  border-top: 1px solid #dfe5ea;
  border-left: 1px solid #dfe5ea;
  color: #212529;
  font-size: .82rem;
  font-weight: 700;
}

.orc-import-review-header > span {
  padding: 8px;
  border-right: 1px solid #dfe5ea;
  border-bottom: 1px solid #dfe5ea;
}

.orc-import-review-row {
  align-items: stretch;
  border-left: 1px solid #dfe5ea;
}

.orc-import-review-total {
  display: grid;
  grid-template-columns: 90px minmax(0, 1fr) 120px;
  border-left: 1px solid #dfe5ea;
  font-size: .9rem;
  font-weight: 700;
}

.orc-import-review-total > span {
  grid-column: 1 / 3;
  padding: 10px 8px;
  border-right: 1px solid #dfe5ea;
  border-bottom: 1px solid #dfe5ea;
  text-align: right;
}

.orc-import-review-total > strong {
  padding: 10px 8px;
  border-right: 1px solid #dfe5ea;
  border-bottom: 1px solid #dfe5ea;
  text-align: center;
}

.orc-import-review-field {
  min-width: 0;
  min-height: 42px;
  padding: 0 8px;
  border-right: 1px solid #dfe5ea;
  border-bottom: 1px solid #dfe5ea;
}

.orc-import-review-field::before {
  display: none;
  content: attr(data-label);
}

.orc-import-review .form-control,
.orc-import-review .form-select {
  width: 100%;
  min-width: 0;
  height: 41px;
  min-height: 41px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background-color: transparent;
  color: #212529;
  font-size: .9rem;
  font-weight: 500;
  box-shadow: none;
}

.orc-import-review .form-control {
  text-align: center;
}

.orc-import-review .form-select {
  padding-right: 2.25rem;
}

#orc-import-ocr-text {
  max-height: 160px;
  margin-top: 8px;
  padding: 8px;
  overflow: auto;
  white-space: pre-wrap;
  background: #f6f7f8;
}

.tabela-confirm-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 18px;
}

.tabela-fatores-dialog {
  display: flex;
  flex-direction: column;
  width: min(560px, 100%);
  max-width: 100%;
  max-height: calc(100vh - 32px);
  padding: 0;
  overflow: hidden;
}

.tabela-fatores-header,
.tabela-fatores-footer {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  width: 100%;
  padding: 14px 18px;
  background: #fff;
}

.tabela-fatores-header {
  justify-content: space-between;
  gap: 12px;
}

.tabela-fatores-header h2 {
  margin: 0;
}

.tabela-fatores-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 0;
  border-radius: 6px;
  color: #6c757d;
  background: transparent;
  font-size: 1.4rem;
  line-height: 1;
}

.tabela-fatores-close:hover {
  color: #212529;
  background: #f1f3f5;
}

.tabela-fatores-form {
  display: flex;
  flex: 1 1 auto;
  min-height: 0;
  flex-direction: column;
  flex-wrap: nowrap;
  width: 100%;
  margin: 0;
  overflow: hidden;
}

.tabela-fatores-body {
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
  padding: 14px 18px;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.tabela-especiais-actions {
  display: contents;
}

.tabela-config-section {
  display: grid;
  gap: 12px;
  width: min(400px, 100%);
  margin-inline: auto;
  padding: 14px;
  border-radius: 10px;
  background: #f8f9fa;
}

.tabela-config-section + .tabela-config-section {
  margin-top: 14px;
}

.tabela-config-section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.tabela-config-section-heading h3 {
  margin: 0;
  color: #334155;
  font-size: .95rem;
  font-weight: 500;
}

.tabela-especiais-config-list,
.tabela-fatores-config-list {
  display: grid;
  gap: 8px;
}

.tabela-especial-config-row {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) 30px;
  gap: 12px;
  align-items: center;
  width: 100%;
  margin-inline: auto;
  padding: 8px;
  border-radius: 8px;
  background: #fff;
}

.tabela-especial-config-row .form-control {
  width: 100%;
  min-width: 0;
}

.tabela-config-drag-handle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  color: #495057;
  cursor: grab;
  user-select: none;
}

.tabela-config-drag-handle:active {
  cursor: grabbing;
}

.tabela-especial-config-row.is-dragging {
  opacity: .45;
}

.tabela-config-icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 1px solid #ffc9c9;
  border-radius: var(--icon-btn-radius);
  color: #a61e2c;
  background: #fff5f5;
}

.tabela-config-icon-button:hover {
  color: #861421;
  background: #ffe3e3;
}

.tabela-fator-config-row {
  display: grid;
  grid-template-columns: minmax(0, 220px) 80px;
  gap: 12px;
  align-items: center;
  justify-content: center;
  width: min(330px, 100%);
  margin: 0 auto;
  padding: 8px;
  border-radius: 8px;
  background: #fff;
}

.tabela-fator-config-row > span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.tabela-config-empty {
  padding: 12px;
  color: #6c757d;
  text-align: center;
}

[data-tabela-fatores-status] {
  min-height: 20px;
  margin-top: 8px;
}

.tabela-fatores-footer {
  justify-content: center;
  gap: 8px;
}

@media (max-width: 576px) {
  .tabela-fator-config-row {
    grid-template-columns: 1fr;
    gap: 5px;
  }
}

@media (max-width: 576px) {
  .tabela-confirm-modal {
    padding: 8px;
  }

  .orc-import-dialog {
    width: 100%;
    max-height: calc(100vh - 16px);
    padding: 14px;
  }

  .orc-import-image-control {
    grid-template-columns: 1fr;
  }

  .orc-import-image-control .orc-import-paste-button {
    width: auto;
    justify-self: center;
  }

  .orc-import-review-header {
    display: none;
  }

  .orc-import-review-row {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 10px;
    padding: 12px 0;
    border-left: 0;
  }

  .orc-import-review-product {
    grid-column: 1 / -1;
    order: 1;
  }

  .orc-import-review-quantity { order: 2; }
  .orc-import-review-price { order: 3; }

  .orc-import-review-field {
    padding: 0;
    border: 0;
  }

  .orc-import-review .form-control,
  .orc-import-review .form-select {
    padding: 0 10px;
    border: 1px solid #dfe5ea;
    border-radius: 6px;
    background-color: #fff;
  }

  .orc-import-review-field::before {
    display: block;
    margin-bottom: 4px;
    color: #6c757d;
    font-size: .72rem;
    font-weight: 700;
  }

  .orc-import-review-total {
    grid-template-columns: 1fr 1fr;
    border-top: 1px solid #dfe5ea;
    border-left: 0;
  }

  .orc-import-review-total > span,
  .orc-import-review-total > strong {
    grid-column: auto;
    border-right: 0;
  }

  .orc-import-review-total > span {
    text-align: left;
  }

}

@media (max-width: 768px) {
  .table--tabela .btn-del,
  .table--tabela .btn-add {
    opacity: 1;
    pointer-events: auto;
  }
}

/* Orcamento modal */
.modal-dialog.budget-modal {
  --bs-modal-width: min(1400px, 95vw);
  margin: 1.25rem auto;
}

.modal-dialog.budget-modal .modal-content {
  border-radius: 12px;
}

.modal-dialog.budget-modal .orcamento-scroll {
  max-height: 78vh;
  overflow: auto;
  scrollbar-gutter: stable both-edges;
}

.modal-dialog.budget-modal .orcamento-table-scroll {
  max-height: 55vh;
  overflow: auto;
}

.arquivos-modal-dialog {
  width: min(860px, calc(100vw - 28px));
}

.arquivos-modal .list-group {
  margin-bottom: 0;
}

.logistica-modal-dialog.budget-modal {
  width: min(1400px, calc(100vw - 28px));
  max-height: min(860px, calc(100vh - 28px));
  top: 50%;
  margin-top: 0;
  margin-bottom: 0;
  transform: translateY(-50%);
}

.logistica-modal-dialog.budget-modal .orcamento-scroll {
  max-height: 78vh;
  overflow: auto;
  scrollbar-gutter: stable both-edges;
}

.logistica-modal-dialog.budget-modal .orcamento-table-scroll {
  max-height: 55vh;
  overflow: auto;
}

@media (max-width: 992px) {
  #orcamentoModal.logistica-modal {
    padding: 10px;
  }

  .logistica-modal-dialog.budget-modal {
    top: auto;
    width: 100%;
    max-width: 100%;
    max-height: 100%;
    margin: 0;
    transform: none;
  }

  .logistica-modal-dialog.budget-modal .logistica-modal-body {
    flex: 1 1 auto;
    min-height: 0;
  }

  .logistica-modal-dialog.budget-modal .orcamento-scroll {
    max-height: none;
  }
}

.orc-add,
.orc-rem {
  display: inline-flex;
  position: static;
  align-items: center;
  justify-content: center;
  width: var(--icon-btn-size);
  height: var(--icon-btn-size);
  min-width: var(--icon-btn-size);
  max-width: var(--icon-btn-size);
  min-height: var(--icon-btn-size);
  max-height: var(--icon-btn-size);
  box-sizing: border-box;
  flex: 0 0 var(--icon-btn-size);
  margin: 0;
  padding: 0;
  border-radius: var(--icon-btn-radius);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 0;
  font-weight: 400;
  line-height: 1;
  text-decoration: none !important;
  transform: none !important;
  vertical-align: middle;
  transition: none !important;
}

.orc-add::before,
.orc-rem::before {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  font-size: 18px;
  font-weight: 400;
  line-height: 1;
}

.orc-add::before {
  content: "+";
}

.orc-rem::before {
  content: "\00d7";
}

.orc-add {
  border: 1px solid #198754 !important;
  color: #198754;
  background: transparent;
}

.orc-add:hover,
.orc-add:focus {
  color: #fff;
  background: #198754;
  transform: scale(1.04);
}

.orc-rem {
  border: 1px solid #dc3545 !important;
  color: #dc3545 !important;
  background: transparent !important;
}

.orc-rem:hover,
.orc-rem:focus {
  color: #fff !important;
  background: #dc3545 !important;
  transform: none !important;
}

#orc-resultados-body tr.orc-row-addable {
  cursor: pointer;
  transition: background-color .12s ease;
}

#orc-resultados-body tr.orc-row-addable .lg-scroll-col,
#orc-resultados-body tr.orc-row-addable .lg-scroll-col * {
  cursor: pointer !important;
}

#orc-resultados-body tr.orc-row-addable .lg-scroll-col.is-dragging,
#orc-resultados-body tr.orc-row-addable .lg-scroll-col.is-dragging * {
  cursor: grabbing !important;
}

#orc-resultados-body tr.orc-row-addable:hover {
  background: rgba(108, 117, 125, .12);
}

#orc-resultados-body tr.orc-row-addable:focus-within,
#orc-resultados-body tr.orc-row-addable:focus {
  outline: 2px solid rgba(108, 117, 125, .35);
  outline-offset: -2px;
  background: rgba(108, 117, 125, .16);
}

#orc-resultados-body tr.orc-row-addable:hover .orc-add {
  color: #fff;
  border-color: #198754;
  background: #198754;
}

#search-results tbody tr.is-addable {
  cursor: pointer;
}

#search-results tbody tr.is-addable .search-result-desc,
#search-results tbody tr.is-addable .search-result-desc .lg-scroll-col {
  cursor: pointer;
}

#orc-itens td input.orc-qtd,
#orc-itens td input.orc-preco {
  width: 100%;
  min-width: 0;
  padding: 0;
  margin: 0;
  border: 0 !important;
  background: transparent !important;
  font: inherit;
  font-size: inherit;
  line-height: inherit;
  text-align: center;
  outline: none !important;
  box-shadow: none !important;
  appearance: none;
  -webkit-appearance: none;
}

#orc-itens input[type="number"] {
  -moz-appearance: textfield;
}

#orc-itens input[type="number"]::-webkit-outer-spin-button,
#orc-itens input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.orcamento-discounts {
  display: flex;
  align-items: center;
  gap: 8px 12px;
  flex-wrap: wrap;
}

.orcamento-discount-field {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.orcamento-actions {
  align-items: center;
}

.modal-footer .d-flex.orcamento-actions {
  align-items: center !important;
}

#orcamentoModal .modal-footer {
  padding: 14px 16px 16px;
  border-top: 1px solid rgba(15, 23, 42, .12);
}

#orcamentoModal .orcamento-footer-summary {
  width: 100%;
  align-items: center !important;
}

#orcamentoModal .orcamento-footer-summary > .text-end {
  padding-right: 2px;
  line-height: 1.45;
}

#orcamentoModal .orcamento-actions {
  justify-content: flex-end;
  align-items: center !important;
  width: 100%;
  margin-top: 12px !important;
}

@media (min-width: 1400px) {
  .modal-dialog.budget-modal .orcamento-scroll {
    max-height: 82vh;
  }
}

@media (max-width: 768px) {
  .modal-dialog.budget-modal .orcamento-scroll,
  .modal-dialog.budget-modal .orcamento-table-scroll {
    max-height: none;
  }

  .popover {
    max-width: calc(100vw - 24px);
    border-color: #dfe4ea;
    background: #f8f9fa;
    box-shadow: 0 10px 24px rgba(15, 23, 42, .16);
  }

  .popover-body {
    max-width: calc(100vw - 48px);
    color: #212529;
    background: #f8f9fa;
    overflow-wrap: anywhere;
    word-break: normal;
  }

  .popover-header {
    border-bottom-color: #e1e5ea;
    background: #f1f3f5;
  }

  .popover .pedido-dados {
    flex-wrap: wrap;
    justify-content: flex-start;
    gap: 4px 12px;
  }

  #orc-resultados-wrap table {
    min-width: 0 !important;
    margin-bottom: 0;
  }

  #orc-resultados-wrap table thead {
    display: none;
  }

  #orc-resultados-wrap table,
  #orc-resultados-body,
  #orc-resultados-body tr,
  #orc-resultados-body td {
    display: block;
    width: 100% !important;
  }

  #orc-resultados-body {
    border-top: 1px solid #eef1f3;
  }

  #orc-resultados-body tr.orc-row-addable {
    position: relative;
    isolation: isolate;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
    padding: 10px 42px 10px 0;
    border-bottom: 1px solid #eef1f3;
  }

  #orc-resultados-body td {
    padding: 0;
    border: 0;
  }

  #orc-resultados-body .orc-result-desc {
    grid-column: 1 / -1;
    color: #212529;
    line-height: 1.25;
    overflow-wrap: anywhere;
    word-break: break-word;
  }

  #orc-resultados-body .orc-result-desc .lg-scroll-col {
    overflow: visible;
    text-overflow: clip;
    white-space: normal;
  }

  #orc-resultados-body .orc-result-preco,
  #orc-resultados-body .orc-result-estoque,
  #orc-resultados-body .orc-result-disponivel,
  #orc-resultados-body .orc-result-custo {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 2px;
    color: #212529;
    font-size: .84rem;
    font-weight: 700;
    line-height: 1.2;
    text-align: left !important;
  }

  #orc-resultados-body td[data-label]::before {
    content: attr(data-label);
    display: block;
    color: #6c757d;
    font-size: .72rem;
    font-weight: 700;
    line-height: 1.2;
  }

  #orc-resultados-body .orc-result-action-cell {
    position: absolute;
    top: 8px;
    right: 0;
    left: auto;
    display: flex;
    justify-content: flex-end;
    width: auto !important;
    min-width: 28px;
    padding: 0 !important;
    margin: 0 !important;
    text-align: right !important;
  }

  #orc-resultados-body .orc-add {
    width: 28px;
    height: 28px;
  }

  #search-results,
  #snapshot-table {
    min-width: 0 !important;
    margin-bottom: 0;
  }

  #search-results thead,
  #snapshot-table thead {
    display: none;
  }

  #search-results,
  #search-results tbody,
  #search-results tr,
  #search-results td,
  #snapshot-table,
  #snapshot-table tbody,
  #snapshot-table tr,
  #snapshot-table td {
    display: block;
    width: 100% !important;
  }

  #search-results tbody,
  #snapshot-table tbody {
    border-top: 1px solid #aeb6c2;
  }

  .tabela-view-products tbody {
    display: grid !important;
    gap: 12px;
    padding: 0;
    border-top: 0 !important;
  }

  #search-results tbody tr,
  #snapshot-table tbody tr {
    position: relative;
    isolation: isolate;
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 8px;
    padding: 10px 36px 10px 0;
    border-bottom: 1px solid #aeb6c2 !important;
  }

  .tabela-view-products tbody tr {
    gap: 12px;
    padding: 14px 42px 14px 14px !important;
    border: 1px solid #dee2e6 !important;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 2px 8px rgba(15, 23, 42, .06);
    overflow: hidden;
  }

  #search-results tbody tr::before,
  #snapshot-table tbody tr::before,
  #orc-resultados-body tr.orc-row-addable::before,
  .table--compras[data-view="digitacao"] tbody tr::before,
  .table--compras[data-view="finalizados"] tbody tr::before,
  #orc-itens tr::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background: transparent;
    transition: background-color .15s ease;
  }

  #search-results tbody tr:hover::before,
  #snapshot-table tbody tr:hover::before,
  #orc-resultados-body tr.orc-row-addable:hover::before,
  #orc-resultados-body tr.orc-row-addable:focus::before,
  #orc-resultados-body tr.orc-row-addable:focus-within::before,
  .table--compras[data-view="digitacao"] tbody tr:hover::before,
  .table--compras[data-view="finalizados"] tbody tr:hover::before,
  #orc-itens tr:hover::before {
    background: #f8fafc;
  }

  .tabela-view-products tbody tr:hover::before {
    background: rgba(248, 250, 252, .55);
  }

  #search-results.table-hover > tbody > tr:hover > *,
  #snapshot-table.table-hover > tbody > tr:hover > *,
  .table--compras[data-view="digitacao"].table-hover > tbody > tr:hover > *,
  .table--compras[data-view="finalizados"].table-hover > tbody > tr:hover > *,
  #orc-itens.table-hover > tbody > tr:hover > * {
    --bs-table-bg-state: transparent;
    background-color: transparent !important;
  }

  #search-results tbody td,
  #snapshot-table tbody td {
    padding: 0;
    border: 0;
  }

  #search-results td.search-result-desc,
  #snapshot-table td.col-desc {
    position: static;
    grid-column: span 4;
    order: 1;
    max-width: none;
    padding-right: 4px;
    color: #212529;
    font-weight: 500;
    line-height: 1.25;
    overflow-wrap: anywhere;
    word-break: break-word;
  }

  #search-results td.search-result-desc .lg-scroll-col,
  #snapshot-table td.col-desc .lg-scroll-col {
    max-height: none;
    overflow: visible;
    white-space: normal;
  }

  #search-results td.search-result-desc {
    grid-column: 1 / -1;
  }

  #snapshot-table td.col-preco {
    grid-column: span 2;
    order: 2;
    align-self: start;
    text-align: right !important;
  }

  #snapshot-table td.col-preco input {
    font-size: .92rem;
    line-height: 1.25;
    text-align: right !important;
  }

  #snapshot-table td.col-obs {
    grid-column: 1 / -1;
    order: 3;
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 2px;
    text-align: left !important;
  }

  #snapshot-table td.col-obs input {
    text-align: left !important;
  }

  #search-results td.search-result-preco,
  #search-results td.search-result-estoque,
  #search-results td.search-result-reservado,
  #search-results td.search-result-disponivel,
  #search-results td.search-result-custo,
  #search-results td.search-result-status,
  #snapshot-table td.col-estoque,
  #snapshot-table td.col-reservado,
  #snapshot-table td.col-disponivel,
  #snapshot-table td.col-custo,
  #snapshot-table td.col-margem {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 2px;
    color: #212529;
    font-size: .84rem;
    font-weight: 700;
    line-height: 1.2;
    text-align: left !important;
  }

  #search-results td.search-result-preco { grid-column: span 2; order: 2; }
  #search-results td.search-result-estoque { grid-column: span 2; order: 3; }
  #search-results td.search-result-reservado { grid-column: span 2; order: 4; }
  #search-results td.search-result-disponivel { grid-column: span 2; order: 5; }
  #search-results td.search-result-custo { grid-column: span 2; order: 6; }
  #search-results td.search-result-status { grid-column: span 4; order: 7; }

  #snapshot-table td.col-estoque { grid-column: span 2; order: 4; }
  #snapshot-table td.col-reservado { grid-column: span 2; order: 5; }
  #snapshot-table td.col-disponivel { grid-column: span 2; order: 6; }
  #snapshot-table td.col-custo { grid-column: span 3; order: 7; }
  #snapshot-table td.col-margem { grid-column: span 3; order: 8; }

  #search-results td[data-label]::before,
  #snapshot-table td[data-label]::before {
    content: attr(data-label);
    display: block;
    color: #6c757d;
    font-size: .72rem;
    font-weight: 700;
    line-height: 1.2;
  }

  .tabela-view-products td[data-label]::before {
    color: #64748b;
    font-size: .78rem;
  }

  .tabela-view-products td.col-obs input,
  .tabela-view-products td.col-preco input {
    min-height: 31px;
    border-color: #dee2e6;
    border-radius: 6px;
    background: #fff;
  }

  #search-results .badge,
  #search-results .search-result-status .text-success {
    display: inline-flex;
    width: fit-content;
    max-width: 100%;
    white-space: normal;
  }

  #search-results .btn-add {
    top: 8px;
    right: 0;
    opacity: 1;
    pointer-events: auto;
    transform: none;
  }

  #search-results .btn-add:hover {
    transform: scale(1.12);
  }

  #snapshot-table .btn-del {
    top: 8px;
    right: 0;
    transform: none;
  }

  #snapshot-table .btn-del:hover {
    transform: scale(1.12);
  }

  .tabela-view-products .btn-add,
  .tabela-view-products .btn-del {
    top: 12px !important;
    right: 12px !important;
  }

  #snapshot-table.table--reposicao tbody tr {
    grid-template-columns: repeat(20, minmax(0, 1fr));
    gap: 12px;
    padding: 14px 42px 14px 14px;
    border: 1px solid #dee2e6 !important;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 2px 8px rgba(15, 23, 42, .06);
    overflow: hidden;
  }

  #snapshot-table.table--reposicao tbody {
    display: grid;
    gap: 12px;
    padding: 0;
    border-top: 0;
  }

  #snapshot-table.table--reposicao tbody tr:hover::before {
    background: rgba(248, 250, 252, .55);
  }

  #snapshot-table.table--reposicao td[data-label]::before {
    margin-bottom: 3px;
    color: #64748b;
    font-size: .78rem;
  }

  #snapshot-table.table--reposicao td.has-reposicao-filter::before {
    content: none;
  }

  #snapshot-table.table--reposicao .reposicao-cell-filter-trigger {
    display: flex;
    width: max-content;
    max-width: 100%;
    align-items: center;
    gap: .25rem;
    margin: 0 0 3px;
    padding: 0;
    border: 0;
    background: transparent;
    color: #64748b;
    font-size: .78rem;
    font-weight: 800;
    line-height: 1.2;
    text-align: left;
  }

  #snapshot-table.table--reposicao .reposicao-cell-filter-trigger:hover,
  #snapshot-table.table--reposicao .reposicao-cell-filter-trigger:focus-visible,
  #snapshot-table.table--reposicao .reposicao-cell-filter-trigger.is-filtered,
  #snapshot-table.table--reposicao .reposicao-cell-filter-trigger.is-sorted {
    color: #0d6efd;
    outline: none;
  }

  #snapshot-table.table--reposicao .reposicao-cell-filter-caret {
    flex: 0 0 auto;
    font-size: .78rem;
    line-height: 1;
  }

  #snapshot-table.table--reposicao tbody td {
    width: auto !important;
    max-width: none !important;
    min-width: 0;
    padding: 0 !important;
    overflow: visible !important;
  }

  #snapshot-table.table--reposicao td.repo-produto {
    grid-column: 1 / -1;
    order: 1;
    padding-right: 4px;
  }

  #snapshot-table.table--reposicao td.repo-produto::before {
    display: none;
  }

  #snapshot-table.table--reposicao td.repo-produto .scroll-col,
  #snapshot-table.table--reposicao td.repo-produto .lg-scroll-col {
    max-height: none;
    overflow: visible;
    white-space: normal;
  }

  #snapshot-table.table--reposicao td.repo-reposicao,
  #snapshot-table.table--reposicao td.repo-estoque,
  #snapshot-table.table--reposicao td.repo-consumo,
  #snapshot-table.table--reposicao td.repo-cobertura,
  #snapshot-table.table--reposicao td.repo-share,
  #snapshot-table.table--reposicao td.repo-minimo,
  #snapshot-table.table--reposicao td.repo-lt,
  #snapshot-table.table--reposicao td.repo-mp,
  #snapshot-table.table--reposicao td.repo-pedido {
    display: flex;
    flex-direction: column;
    gap: 2px;
    color: #212529;
    font-size: .82rem;
    font-weight: 700;
    line-height: 1.2;
    text-align: left !important;
  }

  #snapshot-table.table--reposicao td.repo-minimo,
  #snapshot-table.table--reposicao td.repo-lt,
  #snapshot-table.table--reposicao td.repo-mp {
    justify-content: flex-start;
  }

  #snapshot-table.table--reposicao td.repo-reposicao { grid-column: span 5; order: 2; }
  #snapshot-table.table--reposicao td.repo-estoque { grid-column: span 5; order: 3; }
  #snapshot-table.table--reposicao td.repo-consumo { grid-column: span 5; order: 4; }
  #snapshot-table.table--reposicao td.repo-cobertura { grid-column: span 5; order: 5; }
  #snapshot-table.table--reposicao td.repo-share { grid-column: span 4; order: 6; }
  #snapshot-table.table--reposicao td.repo-minimo { grid-column: span 4; order: 7; }
  #snapshot-table.table--reposicao td.repo-lt { grid-column: span 4; order: 8; }
  #snapshot-table.table--reposicao td.repo-mp { grid-column: span 4; order: 9; }
  #snapshot-table.table--reposicao td.repo-pedido { grid-column: span 4; order: 10; }

  #snapshot-table.table--reposicao td.repo-minimo input,
  #snapshot-table.table--reposicao td.repo-lt input,
  #snapshot-table.table--reposicao td.repo-mp input {
    width: 100%;
    height: 16px;
    min-height: 0;
    min-width: 0;
    margin: 0;
    padding: 0 !important;
    font-family: inherit;
    font-size: inherit;
    font-weight: inherit;
    line-height: 16px;
    text-align: left;
  }

  #snapshot-table.table--reposicao td.reposicao-cell .reposicao-flex {
    justify-content: flex-start;
    gap: 6px;
  }

  #orc-itens {
    margin-bottom: 0;
  }

  #orc-itens thead {
    display: none;
  }

  #orc-itens,
  #orc-itens tbody,
  #orc-itens tr,
  #orc-itens td {
    display: block;
    width: 100% !important;
  }

  #orc-itens tbody {
    border-top: 1px solid #eef1f3;
  }

  #orc-itens tr {
    position: relative;
    isolation: isolate;
    padding: 10px 44px 10px 0;
    border-bottom: 1px solid #eef1f3;
  }

  #orc-itens td {
    padding: 0;
    border: 0;
  }

  #orc-itens .orc-desc {
    margin-bottom: 8px;
    padding-right: 4px;
    color: #212529;
    font-weight: 500;
    line-height: 1.25;
    overflow-wrap: anywhere;
    word-break: break-word;
  }

  #orc-itens .orc-qtd-cell,
  #orc-itens .orc-preco-cell,
  #orc-itens .orc-custo,
  #orc-itens .orc-subtotal,
  #orc-itens .orc-margem {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 2px;
  }

  #orc-itens tr {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 8px;
  }

  #orc-itens .orc-desc {
    grid-column: 1 / -1;
  }

  #orc-itens .orc-desc { order: 1; }
  #orc-itens .orc-qtd-cell { grid-column: span 2; order: 2; }
  #orc-itens .orc-preco-cell { grid-column: span 2; order: 3; }
  #orc-itens .orc-custo { grid-column: span 2; order: 4; }
  #orc-itens .orc-subtotal {
    grid-column: span 3;
    order: 5;
  }
  #orc-itens .orc-margem { grid-column: span 3; order: 6; }

  #orc-itens td[data-label]::before {
    content: attr(data-label);
    display: block;
    color: #6c757d;
    font-size: .72rem;
    font-weight: 700;
    line-height: 1.2;
  }

  #orc-itens td input.orc-qtd,
  #orc-itens td input.orc-preco,
  #orc-itens .orc-subtotal,
  #orc-itens .orc-custo,
  #orc-itens .orc-margem {
    color: #212529;
    font-size: .84rem;
    font-weight: 700;
    line-height: 1.2;
    text-align: left;
  }

  #orc-itens tr > td.orc-action-cell {
    position: absolute;
    top: 8px;
    right: 0;
    left: auto;
    display: flex;
    justify-content: flex-end;
    grid-column: auto !important;
    order: initial;
    width: auto !important;
    min-width: 28px;
    padding: 0 !important;
    margin: 0 !important;
    text-align: right !important;
  }

  #orc-itens .orc-rem {
    width: 28px;
    height: 28px;
  }

  .orcamento-footer-summary {
    align-items: stretch !important;
  }

  .orcamento-discounts {
    display: grid;
    width: 100%;
    gap: 8px;
  }

  .orcamento-discount-field {
    display: flex;
    align-items: center;
    gap: 8px;
  }

  .orcamento-discount-field .form-control {
    width: 92px !important;
    flex: 0 0 92px;
  }

  .modal-footer .d-flex {
    align-items: stretch !important;
  }

  .modal-footer .d-flex,
  .modal-header {
    flex-wrap: wrap;
  }

  #orcamentoModal .modal-footer .d-flex {
    align-items: center !important;
  }

  #orcamentoModal .orcamento-footer-summary {
    gap: 12px !important;
  }

  #orcamentoModal .orcamento-footer-summary > .text-end {
    width: 100%;
    margin-left: 0 !important;
    text-align: left !important;
    padding-top: 2px;
  }

  #orcamentoModal .orcamento-actions {
    flex-wrap: nowrap;
    justify-content: flex-start;
    padding-bottom: 2px;
  }

  .w-90px,
  .w-100px,
  .w-120px,
  .w-140px,
  .w-160px,
  .w-200px {
    width: auto !important;
  }
}

.tabela-list-vigente-tag {
  transform: translateY(-2px);
}

/* =========================================================
   REGION: COMPRAS / REPOSICAO
