.cadastro-lotes-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);
}

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

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

.lotes-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;
}

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

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

.lotes-header-actions .secondary-action {
  min-height: 42px;
  white-space: nowrap;
}

.lotes-header-actions [aria-disabled="true"] {
  pointer-events: none;
  opacity: 0.66;
}

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

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

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

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

.lotes-table {
  min-width: 1180px;
  border-collapse: separate;
  border-spacing: 0;
}

.lotes-table th,
.lotes-table td {
  border-right: 1px solid rgba(62, 45, 31, 0.12);
  border-bottom: 1px solid rgba(62, 45, 31, 0.10);
}

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

.lotes-table th:first-child,
.lotes-table td:first-child {
  min-width: 150px;
  white-space: nowrap;
}

.lote-form-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.input-wrap {
  display: flex;
  align-items: center;
  min-height: 42px;
  border: 1px solid rgba(61, 46, 31, 0.2);
  border-radius: var(--radius-sm);
  background: white;
  overflow: hidden;
}

.input-wrap input {
  min-width: 0;
  border: 0;
  border-radius: 0;
}

.input-wrap small {
  flex: 0 0 auto;
  padding: 0 11px;
  color: var(--color-text-muted);
  font-weight: 900;
}

.calculated-field output {
  display: flex;
  align-items: center;
  min-height: 42px;
  padding: 9px 11px;
  border: 1px solid rgba(107, 122, 90, 0.26);
  border-radius: var(--radius-sm);
  color: #304226;
  background: rgba(107, 122, 90, 0.12);
  font-weight: 900;
}

.lote-switch {
  align-self: end;
  min-height: 42px;
}

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

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

  .lote-form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .cadastro-lotes-page {
    padding: 84px 16px 30px;
  }

  .lotes-header-actions {
    width: 100%;
  }

  .lotes-header-actions .primary-action,
  .lotes-header-actions .secondary-action {
    flex: 1 1 100%;
    justify-content: center;
    text-align: center;
  }

  .lote-form-grid {
    grid-template-columns: 1fr;
  }

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

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