/* Tabelas em grade: a largura de cada coluna acompanha o conteúdo e o texto quebra a linha quando precisa */
.rolar {
  overflow: auto;
  background: var(--papel);
  border: 1px solid var(--linha);
  border-radius: 12px;
  box-shadow: var(--sombra);
}
table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 13.5px;
  line-height: 1.4;
}
th,
td {
  padding: 8px 10px;
  border-right: 1px solid var(--linha);
  border-bottom: 1px solid var(--linha);
  text-align: left;
  vertical-align: middle;
  overflow-wrap: break-word;
}
th {
  background: var(--campo);
  color: var(--suave);
  font-size: 12px;
  line-height: 1.3;
}
tr > :last-child {
  border-right: 0;
}
tbody > tr:last-child > td {
  border-bottom: 0;
}
tbody > tr:hover > td {
  background: var(--campo);
}
th small,
td small {
  display: block;
}
td.vazia {
  padding: 56px 16px;
  text-align: center;
}
.junta {
  white-space: nowrap;
}

/* Pessoas e candidatos */
#v-lista {
  container-type: inline-size;
  max-height: calc(100vh - 250px - var(--topo-alt));
}
.detalhada {
  --c1: 42px;
}
.detalhada th,
.detalhada td {
  background: var(--papel);
  background-clip: padding-box;
}
.detalhada th {
  position: sticky;
  top: 0;
  z-index: 3;
  background: var(--campo);
}
.detalhada .grupos th {
  height: 32px;
  padding-block: 6px;
  color: var(--tinta);
}
.detalhada thead tr:nth-child(2) th {
  top: 32px;
}
/* cargo e empresa: palavra emendada muito comprida também quebra, sem alargar a coluna */
.detalhada > tbody > tr:not(.linha-hist) > td:is(:nth-child(3), :nth-child(4), :nth-child(6), :nth-child(7)):not(.pedir) {
  min-width: 104px;
  overflow-wrap: anywhere;
}
/* ficam à vista ao rolar para o lado: marcar, nome e ações */
.detalhada .fixa,
.detalhada .fixa2,
.detalhada .fixa-fim {
  position: sticky;
  z-index: 2;
}
.detalhada .fixa {
  left: 0;
  width: var(--c1);
  min-width: var(--c1);
  padding-inline: 9px;
}
.detalhada .fixa2 {
  left: var(--c1);
  min-width: 110px;
}
.detalhada .fixa-fim {
  right: 0;
  border-left: 1px solid var(--linha);
}
.detalhada :nth-last-child(2):has(+ .fixa-fim) {
  border-right: 0;
}
.detalhada th.fixa,
.detalhada th.fixa2,
.detalhada th.fixa-fim {
  z-index: 4;
}
.detalhada th.g-exp {
  background: var(--verde-claro);
}
.detalhada .grupos .g-exp {
  color: var(--verde);
}
.detalhada td.g-exp {
  background: color-mix(in srgb, var(--verde-claro) 38%, var(--papel));
}
.detalhada .pedir .junto {
  flex-wrap: wrap;
  gap: 6px 14px;
}
.detalhada .principal,
.detalhada .secundario {
  padding: 6px 11px;
  font-size: 13px;
  border-radius: 7px;
}
.detalhada td :is(.principal, .secundario) {
  white-space: nowrap;
}
.detalhada .botoes {
  display: flex;
  gap: 6px;
}
.detalhada .botoes > * {
  flex: 1 1 auto;
  text-align: center;
}
/* lista estreita: grade mais compacta; com os filtros abertos, botões um sobre o outro */
@container (max-width: 1400px) {
  .detalhada {
    font-size: 13px;
  }
  .detalhada th,
  .detalhada td {
    padding: 6px 7px;
  }
  .detalhada td.junta {
    white-space: normal;
  }
  .detalhada .fixa2 {
    min-width: 84px;
  }
  .detalhada .principal,
  .detalhada .secundario {
    padding: 5px 8px;
    font-size: 12.5px;
  }
}
@container (max-width: 1180px) {
  .detalhada > tbody > tr:not(.linha-hist) > td:is(:nth-child(3), :nth-child(4), :nth-child(6), :nth-child(7)):not(.pedir) {
    min-width: 78px;
  }
  .detalhada > tbody > tr:not(.linha-hist) > td:is(:nth-child(3), :nth-child(6)):not(.pedir) {
    min-width: 100px;
  }
  .detalhada > tbody > tr:not(.linha-hist) > td:nth-child(6):not(.pedir) {
    min-width: 112px;
  }
  .detalhada {
    font-size: 12.5px;
  }
  .detalhada th,
  .detalhada td {
    padding: 5px;
  }
  .detalhada .botoes {
    flex-direction: column;
  }
}

/* Histórico de experiência aberto embaixo da pessoa */
.detalhada .linha-hist > td {
  padding: 0;
  background: var(--campo);
}
.hist-rola {
  contain: inline-size; /* não alarga a tabela de fora */
  padding: 10px 12px 14px;
  overflow-x: auto;
}
.sub {
  border: 1px solid var(--linha);
  border-radius: 10px;
  overflow: hidden;
  font-size: 13px;
}
.detalhada .sub th {
  position: static;
  background: var(--verde-claro);
  color: var(--verde);
}
.detalhada .sub td {
  background: var(--papel);
}
.detalhada .sub .desc {
  min-width: 220px;
  white-space: pre-wrap;
}

@media (max-width: 980px) {
  .detalhada .fixa2,
  .detalhada .fixa-fim {
    position: static;
  }
  .detalhada th.fixa2,
  .detalhada th.fixa-fim {
    position: sticky;
  }
}
