/* ============================================================
   Recursos Humanos — out/2026. Prefixo rh-*.
   Complementa o mc-modulo.css (mm-*) com as peças só deste módulo:
   abas de área (links no mm-seg), cabeçalho da ficha do funcionário,
   checklists (admissão/desligamento), mapa de calor do calendário de
   férias, quadro do mês, frações de férias e etapas da admissão.
   Só tokens --p-* (o tema escuro vem junto). Nada do YNEX.
   ============================================================ */

/* ---------- Ajustes de base ---------- */
:is(.mm, .mm-layer) a.mm-btn:not(.pri):not(.ok):not(.warn):not(.danger) { color: var(--p-text); }
:is(.mm, .mm-layer) a.mm-btn:not(.pri):not(.ok):not(.warn):not(.danger):hover { color: var(--p-blue); }
:is(.mm, .mm-layer) a.mm-btn.ghost { color: var(--p-blue); }
.rh .rh-voltar { margin-bottom: 6px; }
.rh a.mm-item, .rh a.mm-item:hover { color: inherit; text-decoration: none; }
.rh a.mm-item:hover { border-color: var(--p-blue-line); }
.rh-venc .mm-dd-val { color: var(--p-red); }
.rh-cb { width: 16px; height: 16px; accent-color: var(--p-blue-light); cursor: pointer; }
.rh .mm-tbl td a { color: inherit; text-decoration: none; }
.rh .mm-tbl td a:hover .mm-pessoa-nome { color: var(--p-blue); }

/* Abas de área: links com o desenho dos botões do mm-seg */
.mm-seg a.rh-seg-a {
    height: 30px; padding: 0 12px; border-radius: 8px;
    background: transparent; color: var(--p-muted); text-decoration: none;
    font-size: .74rem; font-weight: 700; display: inline-flex; align-items: center; gap: 6px; transition: all .18s;
}
.mm-seg a.rh-seg-a i { font-size: 15px; }
.mm-seg a.rh-seg-a:hover { color: var(--p-blue); }
.mm-seg a.rh-seg-a.on { background: var(--p-surface); color: var(--p-blue); box-shadow: var(--p-shadow-sm); }
.rh-area { margin-top: -4px; }

/* KPIs em grade fixa (painel de vencimentos) */
.rh-kpis-8 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.rh-kpis-6 { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; }
.rh-kpis-5 { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; }
.rh-kpis-4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.rh-kpis-8 .mm-kpi, .rh-kpis-6 .mm-kpi, .rh-kpis-5 .mm-kpi, .rh-kpis-4 .mm-kpi { min-width: 0; }

/* ---------- Cabeçalho da ficha do funcionário ---------- */
.rh-hero { display: flex; gap: 16px; align-items: center; padding: 16px 18px; }
.rh-hero-main { flex: 1; min-width: 0; }
.rh-hero-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.rh-hero-nome { font-size: 1.14rem; font-weight: 800; color: var(--p-ink); letter-spacing: -.3px; line-height: 1.25; }
.rh-hero-sub { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 4px; font-size: .74rem; font-weight: 600; color: var(--p-muted); }
.rh-hero-sub span { display: inline-flex; align-items: center; gap: 5px; }
.rh-hero-sub i { font-size: 14px; color: var(--p-faint); }
.rh-hero-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 9px; }
.rh-hero-side { display: grid; grid-template-columns: repeat(4, minmax(108px, 1fr)); gap: 8px; flex: none; }
.rh-hero-side .mm-dd { background: var(--p-soft); border: 1px solid var(--p-border-soft); border-radius: 12px; padding: 8px 10px; }
.rh-hero-side .mm-dd-val.red { color: var(--p-red); }
.rh-hero-side .mm-dd-val.orange { color: var(--p-orange); }
.rh-hero-side .mm-dd-val.green { color: var(--p-green); }
.rh-num { font-family: var(--p-mono); font-size: .74rem; font-weight: 800; color: var(--p-blue); background: var(--p-blue-soft); border: 1px solid var(--p-blue-line-soft); padding: .12rem .5rem; border-radius: 7px; white-space: nowrap; }
.rh-hero-acoes { display: flex; gap: 8px; flex-wrap: wrap; padding: 10px 18px; border-top: 1px solid var(--p-border); background: var(--p-soft); border-radius: 0 0 14px 14px; }

/* Grade de dados (leitura) na ficha */
.rh-dados { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px 18px; }
.rh-dados.tres { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.rh-dados .mm-dd-val { word-break: break-word; }
.rh-dados .full { grid-column: 1 / -1; }
.rh-vazio-val { color: var(--p-faint); font-weight: 600; }

/* ---------- Checklist (admissão, desligamento, documentos) ---------- */
.rh-check { display: flex; flex-direction: column; gap: 6px; }
.rh-check-it {
    display: flex; align-items: center; gap: 9px; padding: 8px 10px; border-radius: 10px;
    border: 1px solid var(--p-border); background: var(--p-surface); font-size: .76rem; font-weight: 600; color: var(--p-text);
    text-align: left; width: 100%;
}
.rh-check-it i { font-size: 17px; flex: none; color: var(--p-faint); }
.rh-check-it.ok { border-color: var(--p-green-line); background: var(--p-green-soft); color: var(--p-ink); }
.rh-check-it.ok i { color: var(--p-green); }
.rh-check-it.pend i { color: var(--p-orange); }
.rh-check-it.livre { border-style: dashed; }
.rh-check-it .mm-flex1 { min-width: 0; }
button.rh-check-it { cursor: pointer; }
button.rh-check-it:hover { border-color: var(--p-blue-line); }
.rh-progresso { display: flex; align-items: center; gap: 8px; font-size: .7rem; font-weight: 700; color: var(--p-muted); }
.rh-progresso .mm-progress { flex: 1; height: 7px; }

/* ---------- Frações de férias ---------- */
.rh-fracoes { display: flex; gap: 4px; align-items: center; }
.rh-fracao { height: 8px; border-radius: 4px; background: var(--p-soft2); position: relative; }
.rh-fracao.gozada { background: var(--p-teal); }
.rh-fracao.prog { background: var(--p-blue-light); }
.rh-fracao.abono { background: var(--p-yellow); }
.rh-fracao.saldo { background: var(--p-soft2); border: 1px dashed var(--p-border-strong); }
.rh-barra-periodo { display: flex; gap: 2px; width: 100%; min-width: 120px; height: 9px; border-radius: 5px; overflow: hidden; background: var(--p-soft2); }
.rh-barra-periodo > span { display: block; height: 100%; }
.rh-barra-periodo .g { background: var(--p-teal); }
.rh-barra-periodo .p { background: var(--p-blue-light); }
.rh-barra-periodo .a { background: var(--p-yellow); }

/* ---------- Calendário de férias ---------- */
.rh-heat { width: 100%; border-collapse: separate; border-spacing: 3px; }
.rh-heat th { font-size: .62rem; font-weight: 800; letter-spacing: .6px; text-transform: uppercase; color: var(--p-faint); padding: 4px 6px; text-align: center; white-space: nowrap; }
.rh-heat th.setor { text-align: left; min-width: 170px; }
.rh-heat td.setor { font-size: .76rem; font-weight: 700; color: var(--p-ink); padding: 4px 8px; white-space: nowrap; }
.rh-heat td.setor small { font-weight: 600; color: var(--p-faint); margin-left: 4px; }
.rh-heat td.cel {
    height: 34px; border-radius: 8px; text-align: center; font-size: .74rem; font-weight: 800;
    color: var(--p-ink); background: var(--p-soft); border: 1px solid var(--p-border-soft); cursor: pointer; transition: transform .12s;
}
.rh-heat td.cel:hover { transform: scale(1.06); border-color: var(--p-blue-line); }
.rh-heat td.cel.n0 { color: var(--p-faint); font-weight: 600; cursor: default; }
.rh-heat td.cel.n0:hover { transform: none; border-color: var(--p-border-soft); }
.rh-heat td.cel.n1 { background: var(--p-teal-soft); border-color: var(--p-teal-line); color: var(--p-teal); }
.rh-heat td.cel.n2 { background: var(--p-yellow-soft); border-color: var(--p-yellow-line); color: var(--p-yellow); }
.rh-heat td.cel.n3 { background: var(--p-orange-soft); border-color: var(--p-orange-line); color: var(--p-orange); }
.rh-heat td.cel.n4 { background: var(--p-red-soft); border-color: var(--p-red-line); color: var(--p-red); }
.rh-heat td.cel.sel { outline: 2px solid var(--p-blue-light); outline-offset: 1px; }
.rh-heat td.cel small { display: block; font-size: .56rem; font-weight: 700; opacity: .8; margin-top: -2px; }
.rh-heat tr.total td { border-top: 1px solid var(--p-border); }

.rh-mes { overflow: auto; max-height: calc(100vh - 380px); }
.rh-mes table { border-collapse: separate; border-spacing: 0; width: 100%; }
.rh-mes th, .rh-mes td { border-bottom: 1px solid var(--p-border-soft); }
.rh-mes thead th { position: sticky; top: 0; z-index: 2; background: var(--p-surface); font-size: .6rem; font-weight: 800; color: var(--p-faint); padding: 6px 0; text-align: center; min-width: 26px; }
.rh-mes thead th .d { display: block; font-size: .78rem; color: var(--p-ink); }
.rh-mes thead th.fds { background: var(--p-soft); }
.rh-mes thead th.hoje .d { color: var(--p-blue-light); }
.rh-mes th.pess { position: sticky; left: 0; z-index: 3; background: var(--p-surface); text-align: left; min-width: 220px; padding: 6px 10px; }
.rh-mes tbody th.pess { z-index: 1; font-weight: 600; }
.rh-mes td { height: 30px; padding: 0; position: relative; }
.rh-mes td.fds { background: var(--p-soft); }
.rh-mes td .on { position: absolute; inset: 6px 0; background: var(--ev, var(--p-teal)); opacity: .85; }
.rh-mes td .on.ini { left: 3px; border-radius: 6px 0 0 6px; }
.rh-mes td .on.fim { right: 3px; border-radius: 0 6px 6px 0; }
.rh-mes td .on.ini.fim { border-radius: 6px; }
.rh-mes tfoot td, .rh-mes tfoot th { position: sticky; bottom: 0; background: var(--p-soft); font-size: .7rem; font-weight: 800; text-align: center; color: var(--p-muted); border-top: 1px solid var(--p-border); }
.rh-mes tfoot td.alto { color: var(--p-red); background: var(--p-red-soft); }

/* ---------- Conferência (coluna direita dos modais) ---------- */
.rh-conf { display: flex; flex-direction: column; gap: 10px; }
.rh-conf-it { display: flex; gap: 9px; align-items: flex-start; font-size: .74rem; font-weight: 600; color: var(--p-text); line-height: 1.45; }
.rh-conf-it > i { font-size: 16px; flex: none; margin-top: 1px; }
.rh-conf-it.ok > i { color: var(--p-green); }
.rh-conf-it.aviso > i { color: var(--p-orange); }
.rh-conf-it.erro > i { color: var(--p-red); }
.rh-conf-it.info > i { color: var(--p-blue-light); }
.rh-conf-it b { color: var(--p-ink); }
.rh-mini-lista { display: flex; flex-direction: column; gap: 4px; margin-top: 4px; }
.rh-mini-lista > div { display: flex; justify-content: space-between; gap: 8px; font-size: .7rem; font-weight: 600; color: var(--p-text); padding: 5px 8px; border-radius: 8px; background: var(--p-soft); }
.rh-mini-lista > div span:last-child { color: var(--p-muted); white-space: nowrap; }

/* Medidor dos 15 dias (INSS) */
.rh-inss { margin-top: 6px; }
.rh-inss-barra { display: flex; height: 10px; border-radius: 6px; overflow: hidden; background: var(--p-soft2); }
.rh-inss-barra .emp { background: var(--p-blue-light); }
.rh-inss-barra .inss { background: var(--p-purple); }
.rh-inss-leg { display: flex; justify-content: space-between; font-size: .62rem; font-weight: 700; color: var(--p-faint); margin-top: 4px; }

/* CID mascarado (LGPD) */
.rh-cid { display: inline-flex; align-items: center; gap: 4px; font-family: var(--p-mono); font-size: .72rem; font-weight: 800; color: var(--p-ink); }
.rh-cid button { border: none; background: transparent; color: var(--p-faint); padding: 0; cursor: pointer; font-size: 14px; line-height: 1; }
.rh-cid button:hover { color: var(--p-blue); }
.rh-cid.masc { color: var(--p-faint); letter-spacing: 1px; }

/* Etapas da admissão (dentro do modal) */
.rh-etapas { display: flex; gap: 6px; }
.rh-etapa {
    flex: 1; display: flex; align-items: center; gap: 8px; padding: 9px 11px; border-radius: 11px;
    border: 1px solid var(--p-border); background: var(--p-surface); font-size: .74rem; font-weight: 700; color: var(--p-muted);
    cursor: pointer; text-align: left;
}
.rh-etapa .n { width: 22px; height: 22px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: var(--p-soft2); color: var(--p-muted); font-size: .7rem; font-weight: 800; flex: none; }
.rh-etapa.on { border-color: var(--p-blue-line); background: var(--p-blue-soft); color: var(--p-blue); }
.rh-etapa.on .n { background: var(--p-blue-light); color: #fff; }
.rh-etapa.ok .n { background: var(--p-green); color: #fff; }
.rh-etapa small { display: block; font-size: .62rem; font-weight: 600; color: var(--p-faint); }

/* Seleção múltipla (turma de treinamento, vínculos) */
.rh-sel-lista { display: flex; flex-direction: column; gap: 4px; max-height: 360px; overflow-y: auto; }
.rh-sel-it { display: flex; align-items: center; gap: 9px; padding: 6px 8px; border-radius: 9px; border: 1px solid var(--p-border-soft); background: var(--p-surface); cursor: pointer; text-align: left; width: 100%; }
.rh-sel-it:hover { border-color: var(--p-blue-line); }
.rh-sel-it.on { border-color: var(--p-blue-line); background: var(--p-blue-soft); }
.rh-sel-it > i { font-size: 18px; color: var(--p-faint); flex: none; }
.rh-sel-it.on > i { color: var(--p-blue-light); }

/* Matriz cargo × setor */
.rh-matriz th, .rh-matriz td { text-align: center; }
.rh-matriz th:first-child, .rh-matriz td:first-child { text-align: left; }
.rh-matriz td.z { color: var(--p-faint); font-weight: 500; }

/* ---------- Impressão ---------- */
@media print {
    .rh .mm-subnav, .rh .mm-actions, .rh .rh-area, .rh .mm-toolbar, .rh .rh-no-print { display: none !important; }
}
