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

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

.ficha-trato-header {
  margin-bottom: 24px;
}

.ficha-trato-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;
}

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

.ficha-trato-records-header {
  gap: 16px;
}

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

.ficha-trato-table-wrap {
  overflow-x: auto;
  padding-bottom: 10px;
}

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

.ficha-trato-table th,
.ficha-trato-table td {
  max-width: 200px;
  white-space: nowrap;
  padding: 8px 6px;
  font-size: 12px;
  border-right: 1px solid rgba(62, 45, 31, 0.12);
  border-bottom: 1px solid rgba(62, 45, 31, 0.10);
  vertical-align: middle;
}

.ficha-trato-table thead th {
  white-space: normal;
  line-height: 1.25;
}

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

.ficha-trato-table thead tr:first-child th {
  background: rgba(107, 123, 75, 0.12);
}

.ficha-trato-table thead tr:first-child th:nth-child(1),
.ficha-trato-table tbody td:nth-child(1) {
  min-width: 60px;
}

.ficha-trato-table thead tr:first-child th:nth-child(2),
.ficha-trato-table tbody td:nth-child(2) {
  min-width: 80px;
}

.ficha-trato-table thead tr:first-child th:nth-child(3),
.ficha-trato-table tbody td:nth-child(3) {
  min-width: 110px;
}

.ficha-trato-table thead tr:first-child th:nth-child(4),
.ficha-trato-table tbody td:nth-child(4) {
  min-width: 100px;
}

.ficha-trato-table .trato-group,
.ficha-trato-table .trato-col {
  background: rgba(74, 100, 117, 0.08);
}

.ficha-trato-table .trato-col {
  min-width: 64px;
}
.ficha-trato-table .trato-group {
  text-align: center;
}

.ficha-trato-table .numeric-cell {
  text-align: right;
  font-weight: 800;
}

.ficha-trato-table td {
  overflow: hidden;
  text-overflow: ellipsis;
}

.inline-note {
  border-top: 1px solid rgba(62, 45, 31, 0.08);
}

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

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

.ficha-trato-table td:nth-child(-n+4) { white-space: normal; overflow-wrap: anywhere; min-width: 100px; }
.ficha-trato-table td:nth-child(5) { min-width: 100px; }
