.jetbov-page {
  min-height: 100vh;
  padding: 34px clamp(22px, 3vw, 54px) 42px;
  background:
    linear-gradient(180deg, rgba(255, 253, 248, 0.64), rgba(232, 223, 209, 0.84)),
    var(--color-bg);
}

.jetbov-header,
.jetbov-workspace {
  max-width: var(--content-max);
  margin: 0 auto;
}

.jetbov-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 24px;
}

.jetbov-header h1 {
  margin: 0;
  color: var(--sa-marrom-escuro);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2rem, 3vw, 3.2rem);
  line-height: 1;
}

.jetbov-header p {
  max-width: 760px;
  margin: 10px 0 0;
  color: var(--color-text-muted);
  font-size: 1rem;
}

.jetbov-header-actions {
  display: flex;
  align-items: end;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 10px;
}

.jetbov-lote-field {
  min-width: min(340px, 100%);
}

.jetbov-header-actions [aria-disabled="true"] {
  opacity: 0.66;
}

.jetbov-workspace {
  display: grid;
  gap: 18px;
}

.jetbov-panel {
  min-width: 0;
}

.jetbov-panel .records-header {
  align-items: center;
}

.jetbov-export-button {
  flex: 0 0 auto;
}

.jetbov-filters {
  display: grid;
  grid-template-columns: minmax(220px, 420px) auto auto 1fr;
  gap: 10px;
  align-items: end;
  padding: 16px;
  border-top: 1px solid rgba(62, 45, 31, 0.12);
}

.jetbov-table-wrap {
  overflow-x: auto;
}

.jetbov-table {
    width: max-content;
    min-width: 100%;
    table-layout: auto;
    border-collapse: separate;
    border-spacing: 0;
}

.jetbov-table th,
.jetbov-table td {
    width: auto;
    min-width: max-content;
    max-width: none;
    white-space: nowrap;
    overflow: hidden;
    padding: 12px 14px;

    border-right: 1px solid rgba(62, 45, 31, 0.12);
    border-bottom: 1px solid rgba(62, 45, 31, 0.10);
}

.jetbov-table th:last-child,
.jetbov-table td:last-child {
    border-right: 0;
}

.jetbov-table th:first-child,
.jetbov-table td:first-child {
  position: sticky;
  left: 0;
  z-index: 2;
  min-width: 180px;
  background: rgba(255, 253, 248, 0.98);
  box-shadow: 1px 0 0 rgba(62, 45, 31, 0.12);
}

.jetbov-table th:first-child {
  z-index: 3;
}

.jetbov-table .calculated-col {
  border-left: 1px solid rgba(107, 123, 75, 0.24);
  background: rgba(107, 123, 75, 0.07);
}

@media (max-width: 1180px) {
  .jetbov-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .jetbov-header-actions {
    justify-content: flex-start;
  }

  .jetbov-filters {
    grid-template-columns: minmax(0, 1fr) auto auto;
  }
}

@media (max-width: 760px) {
  .jetbov-page {
    padding: 84px 16px 30px;
  }

  .jetbov-header-actions,
  .jetbov-header-actions .secondary-action,
  .jetbov-lote-field {
    width: 100%;
  }

  .jetbov-header-actions .secondary-action {
    justify-content: center;
    text-align: center;
  }

  .jetbov-filters {
    grid-template-columns: 1fr;
  }

  .jetbov-panel .records-header {
    align-items: stretch;
    flex-direction: column;
  }

  .jetbov-export-button {
    width: 100%;
  }
}

.jetbov-import-help { flex-basis: 100%; font-size: .85rem !important; }
.jetbov-option { display: flex; gap: 6px; align-items: center; color: var(--color-text-muted); }
.jetbov-lote-field { min-width: min(260px, 100%); }

/* Import controls wrap within the viewport, including free termination labels. */
.jetbov-header > div, .jetbov-header-actions { min-width: 0; }
.jetbov-header-actions { flex: 1 1 680px; }
.jetbov-lote-field { min-width: 0; flex: 1 1 210px; max-width: 100%; }
.jetbov-lote-field input, .jetbov-lote-field select { width: 100%; min-width: 0; box-sizing: border-box; }
@media (max-width: 800px) {
  .jetbov-header { flex-direction: column; align-items: stretch; }
  .jetbov-header-actions { flex: 0 1 auto; justify-content: flex-start; }
}
