/* Estilos do módulo Gestão de Pessoas (pasta/key: recursos_humanos).
   Só tokens do design system — nada de px/hex hardcoded (GUIA_ESTILOS.md).
   Regra de ouro mobile: tabela rola de lado, não vira card
   (RESPONSIVIDADE_MOBILE_DESKTOP.md §2). */

/* Avatar de iniciais */
.rh-avatar {
  width: 34px;
  height: 34px;
  flex-shrink: 0;
  border-radius: 999px;
  background: var(--surface-alt);
  border: 1px solid var(--line);
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-xs);
  font-weight: var(--font-semibold);
}
.rh-avatar-grande {
  width: 56px;
  height: 56px;
  font-size: var(--text-lg);
}

/* Chips de competência (matriz) */
.rh-chip {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: 3px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface-alt);
  color: var(--text);
  font-size: var(--text-xs);
}
.rh-chip-clicavel {
  cursor: pointer;
  transition: border-color .15s, background .15s;
}
.rh-chip-clicavel:hover {
  border-color: var(--blue);
  background: var(--panel);
}

/* Barra de filtros dos colaboradores */
.rh-filtros {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: var(--space-2-5);
  margin-bottom: var(--space-3-5);
}

/* Matriz: dois cards lado a lado no desktop */
.rh-matriz-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-4);
  align-items: start;
}

/* Consolidação de ciclo: radar + médias lado a lado */
.rh-consolid-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: var(--space-3-5);
  align-items: start;
}

/* Grid do formulário de colaborador */
.rh-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 var(--space-3);
}

/* Grid de dados da ficha */
.rh-grid-dados {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: var(--space-3);
}

/* ===== Mobile ===== */
@media (max-width: 768px) {
  .rh-filtros { grid-template-columns: 1fr; }
  .rh-matriz-grid { grid-template-columns: 1fr; }
  .rh-consolid-grid { grid-template-columns: 1fr; }
  .rh-form-grid { grid-template-columns: 1fr; }

  /* Tabela: piso de largura + nowrap, para de esmagar as colunas */
  .rh-tabela { min-width: 720px; }
  .rh-tabela th,
  .rh-tabela td { white-space: nowrap; }
  .rh-tabela td:first-child { max-width: 240px; overflow: hidden; text-overflow: ellipsis; }
}

/* Kanban de triagem: board com scroll horizontal; colunas não encolhem demais */
.rh-kb-board { scroll-snap-type: x proximity; }
.rh-kb-coluna { scroll-snap-align: start; }
@media (max-width: 768px) {
  .rh-kb-coluna { min-width: 80vw; }
}

/* Barra de abas do RH: rola horizontal sem estourar a tela */
.rh-tabs-scroll {
  overflow-x: auto;
  flex-wrap: nowrap !important;
  white-space: nowrap;
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
}
.rh-tabs-scroll .tab-item { flex-shrink: 0; }

/* Dashboard de Colaboradores — responsivo (18/07/2026) */
@media (max-width: 768px) {
  .rh-dash-kpis { grid-template-columns: 1fr 1fr !important; }
  .rh-dash-grid { grid-template-columns: 1fr !important; }
  /* KPI: número não pode estourar o card em 2 colunas (ex.: "13.8%"). */
  .rh-dash-kpis .card { padding: var(--space-3) var(--space-3-5) !important; }
  .rh-dash-kpi-num { font-size: var(--text-3xl) !important; line-height: 1.1; }
  /* Gráficos: altura menor e proporcional no celular. */
  .rh-dash-canvas { height: 200px !important; }
}

/* Navegação lateral desktop — Gestão de Pessoas (19/07/2026) */
.rh-shell { display: flex; min-height: calc(100vh - 120px); }
.rh-side {
  width: 232px; flex-shrink: 0; background: var(--bg);
  border-right: 1px solid var(--line); padding: 14px 0;
  overflow-y: auto; height: calc(100vh - 120px);
}
.rh-side-glabel {
  font-size: 10px; font-weight: 800; letter-spacing: .8px;
  color: var(--muted); padding: 14px 20px 6px;
}
.rh-side-item {
  display: block; padding: 11px 20px; color: var(--muted);
  font-size: 14px; cursor: pointer; border-left: 3px solid transparent;
  text-decoration: none;
}
.rh-side-item:hover { color: var(--text); }
.rh-side-item.active {
  color: var(--text); background: var(--panel);
  border-left-color: var(--green); font-weight: 600;
}
.rh-main {
  flex: 1; min-width: 0; padding: 1.25rem;
  overflow-y: auto; height: calc(100vh - 120px); min-height: 440px;
}

/* Tabela de Ocorrências — evitar sobreposição de colunas (19/07/2026)
   Colunas curtas nunca quebram/vazam; a descrição trunca em 1 linha.
   Com min-width na tabela, o wrapper rola de lado (desktop e mobile). */
.rh-ocor-tabela th,
.rh-ocor-tabela td { white-space: nowrap; }
/* Colaborador (1ª coluna): trunca em vez de vazar sobre a coluna Tipo — vale
   em desktop e mobile (antes só truncava no mobile e o nome longo sobrepunha). */
.rh-ocor-tabela td:first-child {
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.rh-ocor-tabela td:first-child strong {
  display: inline-block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: bottom;
}
.rh-ocor-tabela .rh-ocor-desc {
  max-width: 340px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
