/* ====================================================================
   RH v2 — design system escopado em .rh-v2 (mock Portal X)
   Coexiste com app.css. Aplicar wrapper .rh-v2 na .page para ativar.
==================================================================== */
.rh-v2 {
  --ink: #0e1f4d;
  --ink-2: #2a3e6e;
  --ink-3: #5d6e92;
  --ink-4: #98a4bf;
  --navy: #0e1f4d;
  --navy-tint: #eef2fb;
  --navy-tint-3: #c7d3ee;
  --line: #e6e9f2;
  --line-2: #d7dce8;
  --bg: #f5f7fb;
  --surface: #ffffff;
  --ok: #16a36a;
  --ok-bg: rgba(22, 163, 106, 0.10);
  --warn: #b46b00;
  --warn-bg: rgba(180, 107, 0, 0.10);
  --crit: #c8392f;
  --crit-bg: rgba(200, 57, 47, 0.10);
  --info: #2c62cf;
  --info-bg: rgba(44, 98, 207, 0.10);
  color: var(--ink);
}

/* Page head */
.rh-v2 .rh-pagehead { display: flex; flex-direction: column; gap: 6px; margin-bottom: 22px; }
.rh-v2 .rh-pagehead__crumb { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; font-weight: 600; color: var(--ink-4); }
.rh-v2 .rh-pagehead__crumb a { color: var(--ink-3); text-decoration: none; transition: color 140ms; }
.rh-v2 .rh-pagehead__crumb a:hover { color: var(--navy); }
.rh-v2 .rh-pagehead__crumb span[aria-hidden] { opacity: 0.45; }
.rh-v2 .rh-pagehead__row { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; flex-wrap: wrap; margin-top: 6px; }
.rh-v2 .rh-pagehead__row h1 { margin: 0 0 4px; font-size: 26px; font-weight: 600; letter-spacing: -0.024em; color: var(--ink); }
.rh-v2 .rh-pagehead__row p { margin: 0; font-size: 13.5px; color: var(--ink-3); max-width: 56ch; }
.rh-v2 .rh-pagehead__actions { display: inline-flex; gap: 6px; flex-wrap: wrap; margin-left: auto; }

/* dx buttons */
.rh-v2 .dx-btn { display: inline-flex; align-items: center; gap: 8px; padding: 9px 16px; border-radius: 10px; font: inherit; font-size: 13.5px; font-weight: 600; border: 1px solid var(--line-2); background: var(--surface); color: var(--ink); cursor: pointer; transition: background 140ms, border-color 140ms, color 140ms, transform 80ms; text-decoration: none; }
.rh-v2 .dx-btn:hover { border-color: var(--navy-tint-3); background: var(--navy-tint); color: var(--navy); }
.rh-v2 .dx-btn:active { transform: translateY(1px); }
.rh-v2 .dx-btn .material-symbols-outlined { font-size: 18px; }
.rh-v2 .dx-btn--primary { background: var(--navy); border-color: var(--navy); color: #fff; }
.rh-v2 .dx-btn--primary:hover { background: #1b2f63; border-color: #1b2f63; color: #fff; }
.rh-v2 .dx-btn--ghost { background: transparent; border-color: var(--line); }
.rh-v2 .dx-iconbtn { width: 32px; height: 32px; display: inline-grid; place-items: center; border: 1px solid transparent; background: transparent; border-radius: 8px; color: var(--ink-3); cursor: pointer; transition: background 140ms, color 140ms, border-color 140ms; }
.rh-v2 .dx-iconbtn:hover { background: var(--navy-tint); color: var(--navy); border-color: var(--navy-tint-3); }
.rh-v2 .dx-iconbtn.is-danger { color: var(--crit); }
.rh-v2 .dx-iconbtn.is-danger:hover { background: var(--crit-bg); border-color: rgba(200, 57, 47, 0.25); color: var(--crit); }
.rh-v2 .dx-iconbtn .material-symbols-outlined { font-size: 18px; }

/* KPI rail */
.rh-v2 .rh-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; margin-bottom: 18px; }
.rh-v2 .rh-kpi { background: var(--surface); padding: 14px 18px 16px; text-align: left; font: inherit; border: 0; cursor: default; position: relative; transition: background 160ms; display: flex; flex-direction: column; gap: 4px; color: inherit; text-decoration: none; }
.rh-v2 .rh-kpi.is-clickable { cursor: pointer; }
.rh-v2 .rh-kpi.is-clickable:hover { background: var(--navy-tint); }
.rh-v2 .rh-kpi.is-active { background: var(--navy-tint); }
.rh-v2 .rh-kpi.is-active::after { content: ''; position: absolute; inset: auto 0 0 0; height: 2px; background: var(--navy); }
.rh-v2 .rh-kpi__top { display: inline-flex; align-items: center; gap: 8px; }
.rh-v2 .rh-kpi__dot { width: 6px; height: 6px; border-radius: 50%; background: var(--ink-4); }
.rh-v2 .rh-kpi--ok .rh-kpi__dot { background: var(--ok); }
.rh-v2 .rh-kpi--warn .rh-kpi__dot { background: var(--warn); }
.rh-v2 .rh-kpi--crit .rh-kpi__dot { background: var(--crit); }
.rh-v2 .rh-kpi--info .rh-kpi__dot { background: var(--info); }
.rh-v2 .rh-kpi--navy .rh-kpi__dot { background: var(--navy); }
.rh-v2 .rh-kpi__label { font-size: 10.5px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-3); }
.rh-v2 .rh-kpi__value { font-size: 26px; font-weight: 700; letter-spacing: -0.025em; color: var(--ink); font-variant-numeric: tabular-nums; line-height: 1.05; margin-top: 2px; }
.rh-v2 .rh-kpi__sub { font-size: 11.5px; color: var(--ink-3); line-height: 1.35; margin-top: 2px; }

/* Toolbar */
.rh-v2 .rh-toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.rh-v2 .rh-toolbar__search { flex: 1; min-width: 280px; display: flex; align-items: center; gap: 10px; padding: 0 12px 0 14px; background: var(--surface); border: 1px solid var(--line-2); border-radius: 10px; height: 40px; color: var(--ink-3); transition: border-color 160ms, box-shadow 160ms; }
.rh-v2 .rh-toolbar__search:focus-within { border-color: var(--navy); box-shadow: 0 0 0 3px var(--navy-tint); }
.rh-v2 .rh-toolbar__search .material-symbols-outlined { font-size: 18px; color: var(--ink-3); }
.rh-v2 .rh-toolbar__search input { flex: 1; border: 0; outline: none; background: transparent; font: inherit; font-size: 13.5px; color: var(--ink); min-width: 0; }
.rh-v2 .rh-toolbar__search input::placeholder { color: var(--ink-4); }
.rh-v2 .rh-toolbar__search kbd { font-family: 'SFMono-Regular', ui-monospace, monospace; font-size: 10.5px; padding: 2px 6px; border-radius: 4px; background: var(--bg); color: var(--ink-3); border: 1px solid var(--line); }
.rh-v2 .rh-select { position: relative; display: inline-flex; align-items: center; }
.rh-v2 .rh-select select { appearance: none; font: inherit; font-size: 12.5px; font-weight: 500; padding: 0 28px 0 12px; height: 40px; border: 1px solid var(--line-2); border-radius: 10px; background: var(--surface); color: var(--ink-2); cursor: pointer; min-width: 140px; transition: border-color 140ms, color 140ms; }
.rh-v2 .rh-select select:hover { border-color: var(--navy-tint-3); color: var(--ink); }
.rh-v2 .rh-select select:focus { outline: none; border-color: var(--navy); box-shadow: 0 0 0 3px var(--navy-tint); }
.rh-v2 .rh-select::after { content: ''; position: absolute; right: 12px; top: 50%; width: 8px; height: 8px; border-right: 1.5px solid var(--ink-3); border-bottom: 1.5px solid var(--ink-3); transform: translateY(-70%) rotate(45deg); pointer-events: none; }
.rh-v2 .rh-select.is-active select { border-color: var(--navy); background: var(--navy-tint); color: var(--navy); font-weight: 600; }
.rh-v2 .rh-toolbar__clear { display: inline-flex; align-items: center; gap: 6px; height: 40px; padding: 0 12px; border: 1px solid transparent; border-radius: 10px; background: transparent; color: var(--ink-3); font: inherit; font-size: 12.5px; font-weight: 500; cursor: pointer; transition: color 140ms, background 140ms; text-decoration: none; }
.rh-v2 .rh-toolbar__clear:hover { color: var(--crit); background: var(--crit-bg); }
.rh-v2 .rh-toolbar__clear .material-symbols-outlined { font-size: 16px; }
.rh-v2 .rh-toolbar__submit { display: inline-flex; align-items: center; justify-content: center; height: 40px; width: 40px; border: 1px solid var(--line-2); border-radius: 10px; background: var(--surface); color: var(--ink-3); cursor: pointer; transition: background 140ms, color 140ms, border-color 140ms; }
.rh-v2 .rh-toolbar__submit:hover { background: var(--navy); border-color: var(--navy); color: #fff; }

/* Panel */
.rh-v2 .rh-panel { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; overflow: visible; }
.rh-v2 .rh-panel__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.rh-v2 .rh-panel__head h2 { margin: 0; font-size: 14.5px; font-weight: 600; letter-spacing: -0.005em; color: var(--ink); }
.rh-v2 .rh-panel__head h2 + p { margin: 2px 0 0; font-size: 12px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.rh-v2 .rh-panel__body { padding: 0; }
.rh-v2 .rh-panel__body--p { padding: 18px 20px; }

/* Table v2 — high specificity to override app.css .rh-table */
.rh-v2 .rh-table-wrap { overflow-x: auto; }
.rh-v2 table.rh-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13px; background: var(--surface); margin: 0; }
.rh-v2 table.rh-table thead th { background: var(--bg); text-align: left; padding: 10px 16px; font-size: 10.5px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-3); border-bottom: 1px solid var(--line); white-space: nowrap; border-top: 0; }
.rh-v2 table.rh-table thead th.is-num { text-align: right; }
.rh-v2 table.rh-table tbody td { padding: 12px 16px; border-bottom: 1px solid var(--line); color: var(--ink-2); vertical-align: middle; background: var(--surface); border-top: 0; }
.rh-v2 table.rh-table tbody tr:last-child td { border-bottom: 0; }
.rh-v2 table.rh-table tbody tr { transition: background 120ms; }
.rh-v2 table.rh-table tbody tr:hover td { background: var(--navy-tint); }
.rh-v2 table.rh-table .is-num { text-align: right; font-variant-numeric: tabular-nums; }
.rh-v2 table.rh-table .is-right { text-align: right; }
.rh-v2 table.rh-table .is-strong { color: var(--ink); font-weight: 600; }
.rh-v2 table.rh-table tbody tr.rh-row--alert td { background: linear-gradient(90deg, rgba(200, 57, 47, 0.05), transparent 60%); }
.rh-v2 table.rh-table tbody tr.rh-row--alert:hover td { background: linear-gradient(90deg, rgba(200, 57, 47, 0.08), var(--navy-tint)); }

/* employee cell */
.rh-v2 .rh-emp { display: inline-flex; align-items: center; gap: 11px; min-width: 0; }
.rh-v2 .rh-emp__text { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
.rh-v2 .rh-emp__text strong { color: var(--ink); font-weight: 600; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 240px; }
.rh-v2 .rh-emp__text span { color: var(--ink-3); font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 240px; }
.rh-v2 .rh-emp__text span b { color: var(--ink-2); font-weight: 600; }

/* twoline */
.rh-v2 .rh-twoline { display: flex; flex-direction: column; gap: 1px; line-height: 1.3; }
.rh-v2 .rh-twoline strong { color: var(--ink); font-weight: 600; font-size: 12.5px; }
.rh-v2 .rh-twoline span { color: var(--ink-3); font-size: 11.5px; }

/* code text */
.rh-v2 .rh-code-text { font-family: 'SFMono-Regular', ui-monospace, monospace; font-size: 12px; color: var(--ink-3); font-weight: 600; letter-spacing: 0.02em; font-variant-numeric: tabular-nums; }
.rh-v2 .rh-mono { font-variant-numeric: tabular-nums; color: var(--ink-2); }
.rh-v2 .rh-dim { color: var(--ink-4); }

/* status badge */
.rh-v2 .rh-status { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; font-weight: 600; color: var(--ink-2); }
.rh-v2 .rh-status::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--ink-4); flex: none; }
.rh-v2 .rh-status--ok::before   { background: var(--ok);   box-shadow: 0 0 0 3px var(--ok-bg); }
.rh-v2 .rh-status--warn::before { background: var(--warn); box-shadow: 0 0 0 3px var(--warn-bg); }
.rh-v2 .rh-status--crit::before { background: var(--crit); box-shadow: 0 0 0 3px var(--crit-bg); }
.rh-v2 .rh-status--info::before { background: var(--info); box-shadow: 0 0 0 3px var(--info-bg); }
.rh-v2 .rh-status--mute::before { background: var(--ink-4); }

/* pill */
.rh-v2 .rh-pill { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 6px; font-size: 11px; font-weight: 600; white-space: nowrap; letter-spacing: 0.01em; }
.rh-v2 .rh-pill--ok   { background: var(--ok-bg);   color: var(--ok); }
.rh-v2 .rh-pill--warn { background: var(--warn-bg); color: var(--warn); }
.rh-v2 .rh-pill--crit { background: var(--crit-bg); color: var(--crit); }
.rh-v2 .rh-pill--info { background: var(--info-bg); color: var(--info); }
.rh-v2 .rh-pill--mute { background: var(--bg);      color: var(--ink-3); border: 1px solid var(--line); }
.rh-v2 .rh-pill--navy { background: var(--navy-tint); color: var(--navy); }

/* experience cell */
.rh-v2 .rh-exp { display: inline-flex; flex-direction: column; gap: 3px; min-width: 0; }
.rh-v2 .rh-exp__main { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; color: var(--ink-2); }
.rh-v2 .rh-exp__main b { font-weight: 700; }
.rh-v2 .rh-exp__main.is-crit b { color: var(--crit); }
.rh-v2 .rh-exp__main.is-warn b { color: var(--warn); }
.rh-v2 .rh-exp__main.is-ok   b { color: var(--ok); }
.rh-v2 .rh-exp__bar { width: 110px; height: 4px; background: var(--line); border-radius: 2px; overflow: hidden; }
.rh-v2 .rh-exp__bar span { display: block; height: 100%; background: var(--ink-3); transition: width 320ms; }
.rh-v2 .rh-exp__bar.is-crit span { background: var(--crit); }
.rh-v2 .rh-exp__bar.is-warn span { background: var(--warn); }
.rh-v2 .rh-exp__bar.is-ok   span { background: var(--ok); }
.rh-v2 .rh-exp__date { font-size: 11px; color: var(--ink-3); font-variant-numeric: tabular-nums; }

/* row actions */
.rh-v2 .rh-actions { display: inline-flex; gap: 2px; align-items: center; justify-content: flex-end; }

/* avatar in rh-v2 (overrides ONLY inside .rh-v2) */
.rh-v2 .rh-avatar { display: inline-grid; place-items: center; border-radius: 50%; background: var(--navy); color: #fff; font-weight: 700; letter-spacing: 0.02em; flex: none; font-feature-settings: 'tnum' 1; width: 34px; height: 34px; font-size: 12px; line-height: 1; padding: 0; }
.rh-v2 .rh-avatar--sm { width: 28px; height: 28px; font-size: 11px; }
.rh-v2 .rh-avatar--lg { width: 44px; height: 44px; font-size: 14px; }
.rh-v2 img.rh-avatar { object-fit: cover; }

/* empty */
.rh-v2 .rh-empty { padding: 48px 24px; text-align: center; color: var(--ink-3); background: var(--surface); font-size: 13.5px; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.rh-v2 .rh-empty__icon { width: 44px; height: 44px; border-radius: 12px; background: var(--bg); display: grid; place-items: center; color: var(--ink-4); }
.rh-v2 .rh-empty strong { color: var(--ink-2); font-weight: 600; font-size: 14px; }
.rh-v2 .rh-empty .material-symbols-outlined { font-size: 22px; }

/* Pagination */
.rh-v2 .rh-pagination { display: flex; align-items: center; justify-content: flex-end; gap: 6px; padding: 12px 20px; border-top: 1px solid var(--line); background: var(--surface); border-radius: 0 0 12px 12px; }
.rh-v2 .rh-pagination-pages { display: inline-flex; gap: 2px; }
.rh-v2 .rh-pagination-page { display: inline-grid; place-items: center; min-width: 30px; height: 30px; padding: 0 8px; border-radius: 7px; font-size: 12px; color: var(--ink-2); text-decoration: none; font-weight: 600; font-variant-numeric: tabular-nums; }
.rh-v2 .rh-pagination-page:hover { background: var(--navy-tint); color: var(--navy); }
.rh-v2 .rh-pagination-page.is-active { background: var(--navy); color: #fff; }
.rh-v2 .rh-pagination-control { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 7px; color: var(--ink-3); text-decoration: none; border: 1px solid var(--line); background: var(--surface); }
.rh-v2 .rh-pagination-control:hover { color: var(--navy); border-color: var(--navy-tint-3); }
.rh-v2 .rh-pagination-control.is-disabled { opacity: 0.4; pointer-events: none; }

/* Tabs (rh-v2) */
.rh-v2 .rh-tabs { display: inline-flex; background: var(--surface); border: 1px solid var(--line-2); border-radius: 10px; padding: 3px; margin-bottom: 14px; gap: 2px; }
.rh-v2 .rh-tabs__btn { display: inline-flex; align-items: center; gap: 7px; padding: 7px 14px; border: 0; border-radius: 7px; background: transparent; color: var(--ink-2); font: inherit; font-size: 12.5px; font-weight: 600; cursor: pointer; transition: background 140ms, color 140ms; text-decoration: none; }
.rh-v2 .rh-tabs__btn:hover { color: var(--navy); }
.rh-v2 .rh-tabs__btn.is-active { background: var(--navy); color: #fff; }
.rh-v2 .rh-tabs__btn .material-symbols-outlined { font-size: 16px; }
.rh-v2 .rh-tabs__count { font-size: 10.5px; font-weight: 700; padding: 1px 6px; border-radius: 999px; background: var(--navy-tint); color: var(--ink-3); font-variant-numeric: tabular-nums; }
.rh-v2 .rh-tabs__btn.is-active .rh-tabs__count { background: rgba(255,255,255,0.18); color: #fff; }

/* ====================================================================
   Modais — overrides escopados dos .rh-modal* existentes
==================================================================== */
body.rh-v2 .rh-modal { position: fixed; inset: 0; z-index: 50; background: rgba(14, 31, 77, 0.45); display: grid; place-items: center; padding: 24px; animation: rhV2Fade 180ms ease; }
body.rh-v2 .rh-modal[hidden] { display: none; }
body.rh-v2 .rh-modal-backdrop { position: absolute; inset: 0; cursor: pointer; }
@keyframes rhV2Fade { from { opacity: 0 } to { opacity: 1 } }
@keyframes rhV2Pop { from { transform: translateY(8px); opacity: 0 } to { transform: translateY(0); opacity: 1 } }
body.rh-v2 .rh-modal-dialog {
  position: relative;
  background: var(--surface);
  border-radius: 14px;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 30px 80px -20px rgba(14, 31, 77, 0.45);
  overflow: hidden;
  animation: rhV2Pop 220ms cubic-bezier(.2,.7,.2,1);
  width: min(720px, 100%);
  border: 1px solid var(--line);
  padding: 0;
  min-height: 0;
}
body.rh-v2 .rh-modal-dialog > form { display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0; overflow: hidden; margin: 0; }
body.rh-v2 .rh-modal-dialog .rh-modal-head { flex: none; }
body.rh-v2 .rh-modal-dialog .rh-modal-actions { flex: none; }
body.rh-v2 .rh-modal-dialog .rh-modal-error { flex: none; }

/* scrollable middle areas */
body.rh-v2 .rh-modal-dialog .rh-form-sections,
body.rh-v2 .rh-modal-dialog .rh-detail-sections,
body.rh-v2 .rh-modal-dialog .rh-modal-scroll-area,
body.rh-v2 .rh-modal-dialog .rh-modal-body {
  flex: 1 1 auto;
  overflow-y: auto;
  min-height: 0;
  -webkit-overflow-scrolling: touch;
  background: var(--surface);
}

/* When the middle is a single .rh-form-section as direct child of form, make form scroll */
body.rh-v2 .rh-modal-dialog > form > .rh-form-section { flex: 1 1 auto; overflow-y: auto; min-height: 0; }
body.rh-v2 .rh-modal-dialog > form > .rh-form-section ~ .rh-form-section { flex: 0 0 auto; overflow: visible; }
body.rh-v2 .rh-modal-dialog.rh-small-dialog { width: min(440px, 100%); }
body.rh-v2 .rh-modal-dialog.rh-form-dialog { width: min(820px, 100%); }
body.rh-v2 .rh-modal-dialog.rh-central-document-dialog,
body.rh-v2 .rh-modal-dialog.rh-large-dialog { width: min(1080px, 100%); }

body.rh-v2 .rh-modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--line);
  gap: 16px;
  background: var(--surface);
  margin: 0;
}
body.rh-v2 .rh-modal-head h2 { margin: 0 0 4px; font-size: 17px; font-weight: 600; letter-spacing: -0.018em; color: var(--ink); }
body.rh-v2 .rh-modal-head p, body.rh-v2 .rh-modal-subtitle { margin: 0; font-size: 12.5px; color: var(--ink-3); }
body.rh-v2 .rh-modal-head .btn-ghost.btn-icon-only {
  width: 32px; height: 32px; display: inline-grid; place-items: center;
  border: 1px solid transparent; background: transparent; border-radius: 8px;
  color: var(--ink-3); cursor: pointer; padding: 0;
}
body.rh-v2 .rh-modal-head .btn-ghost.btn-icon-only:hover { background: var(--navy-tint); color: var(--navy); border-color: var(--navy-tint-3); }

/* form section / grid / field inside modal */
body.rh-v2 .rh-modal-dialog .rh-form-section,
body.rh-v2 .rh-modal-dialog form > .rh-form-section,
body.rh-v2 .rh-modal-dialog > form > .rh-form-section {
  padding: 18px 24px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
  margin: 0;
}
body.rh-v2 .rh-modal-dialog .rh-form-section:last-of-type { border-bottom: 0; }
body.rh-v2 .rh-modal-dialog .rh-form-section h3 {
  margin: 0 0 12px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-3);
  display: flex;
  align-items: center;
  gap: 8px;
}
body.rh-v2 .rh-modal-dialog .rh-form-section h3::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--line);
}

body.rh-v2 .rh-modal-dialog .rh-form-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
body.rh-v2 .rh-modal-dialog .rh-form-grid.rh-form-grid-2 { grid-template-columns: 1fr 1fr; }
@media (max-width: 720px) {
  body.rh-v2 .rh-modal-dialog .rh-form-grid { grid-template-columns: 1fr; }
}

body.rh-v2 .rh-modal-dialog .rh-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12.5px;
}
body.rh-v2 .rh-modal-dialog .rh-field > span {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: 2px;
}
body.rh-v2 .rh-modal-dialog .rh-field input[type="text"],
body.rh-v2 .rh-modal-dialog .rh-field input[type="email"],
body.rh-v2 .rh-modal-dialog .rh-field input[type="number"],
body.rh-v2 .rh-modal-dialog .rh-field input[type="search"],
body.rh-v2 .rh-modal-dialog .rh-field input[type="date"],
body.rh-v2 .rh-modal-dialog .rh-field input[type="month"],
body.rh-v2 .rh-modal-dialog .rh-field input[type="tel"],
body.rh-v2 .rh-modal-dialog .rh-field input[type="password"],
body.rh-v2 .rh-modal-dialog .rh-field input[type="file"],
body.rh-v2 .rh-modal-dialog .rh-field select,
body.rh-v2 .rh-modal-dialog .rh-field textarea {
  font: inherit;
  font-size: 13px;
  padding: 10px 12px;
  border: 1px solid var(--line-2);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  transition: border-color 140ms, box-shadow 140ms;
  width: 100%;
  box-sizing: border-box;
}
body.rh-v2 .rh-modal-dialog .rh-field input:focus,
body.rh-v2 .rh-modal-dialog .rh-field select:focus,
body.rh-v2 .rh-modal-dialog .rh-field textarea:focus {
  outline: none;
  border-color: var(--navy);
  box-shadow: 0 0 0 3px var(--navy-tint);
}
body.rh-v2 .rh-modal-dialog .rh-field-wide { grid-column: span 2; }
body.rh-v2 .rh-modal-dialog .rh-field-full { grid-column: 1 / -1; }
@media (max-width: 720px) {
  body.rh-v2 .rh-modal-dialog .rh-field-wide,
  body.rh-v2 .rh-modal-dialog .rh-field-full { grid-column: span 1; }
}

body.rh-v2 .rh-modal-dialog .rh-modal-error {
  margin: 0 24px;
  padding: 10px 14px;
  background: var(--crit-bg);
  color: var(--crit);
  border-radius: 8px;
  font-size: 12.5px;
  font-weight: 500;
}

body.rh-v2 .rh-modal-actions {
  padding: 14px 24px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  background: var(--bg);
  margin: 0;
}

/* Buttons inside modais (and any .rh-v2 area) */
body.rh-v2 .rh-modal-dialog .btn,
body.rh-v2 .rh-modal-actions .btn,
body.rh-v2 .rh-modal-head .btn {
  display: inline-flex; align-items: center; gap: 8px; padding: 9px 16px; border-radius: 10px; font: inherit; font-size: 13.5px; font-weight: 600; border: 1px solid var(--navy); background: var(--navy); color: #fff; cursor: pointer; transition: background 140ms, border-color 140ms; text-decoration: none;
}
body.rh-v2 .rh-modal-dialog .btn:hover,
body.rh-v2 .rh-modal-actions .btn:hover { background: #1b2f63; border-color: #1b2f63; }
body.rh-v2 .rh-modal-dialog .btn-ghost,
body.rh-v2 .rh-modal-actions .btn-ghost,
body.rh-v2 .rh-modal-head .btn-ghost {
  display: inline-flex; align-items: center; gap: 8px; padding: 9px 16px; border-radius: 10px; font: inherit; font-size: 13.5px; font-weight: 600; border: 1px solid var(--line-2); background: var(--surface); color: var(--ink); cursor: pointer; transition: background 140ms, border-color 140ms, color 140ms; text-decoration: none;
}
body.rh-v2 .rh-modal-dialog .btn-ghost:hover,
body.rh-v2 .rh-modal-actions .btn-ghost:hover { background: var(--navy-tint); border-color: var(--navy-tint-3); color: var(--navy); }
body.rh-v2 .rh-modal-dialog .btn-danger,
body.rh-v2 .rh-modal-actions .btn-danger {
  display: inline-flex; align-items: center; gap: 8px; padding: 9px 16px; border-radius: 10px; font: inherit; font-size: 13.5px; font-weight: 600; border: 1px solid var(--crit); background: var(--crit); color: #fff; cursor: pointer; transition: background 140ms, border-color 140ms;
}
body.rh-v2 .rh-modal-dialog .btn-danger:hover,
body.rh-v2 .rh-modal-actions .btn-danger:hover { background: #a52d24; border-color: #a52d24; }
body.rh-v2 .rh-modal-dialog .btn-secondary,
body.rh-v2 .rh-modal-actions .btn-secondary {
  display: inline-flex; align-items: center; gap: 8px; padding: 9px 16px; border-radius: 10px; font: inherit; font-size: 13.5px; font-weight: 600; border: 1px solid var(--line-2); background: var(--surface); color: var(--ink); cursor: pointer;
}

/* Confirm body */
body.rh-v2 .rh-confirm-body { display: grid; grid-template-columns: auto 1fr; gap: 14px; align-items: center; padding: 18px 24px; }
body.rh-v2 .rh-confirm-body .material-symbols-outlined { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; background: var(--navy-tint); color: var(--navy); font-size: 22px; }
body.rh-v2 .rh-confirm-body p { margin: 0; color: var(--ink); font-size: 13.5px; line-height: 1.5; }

/* Send doc link modal */
body.rh-v2 .rh-modal-dialog.rh-senddoc-dialog { width: min(520px, 100%); }
body.rh-v2 .rh-senddoc-body { padding: 18px 24px; display: flex; flex-direction: column; gap: 14px; flex: 1 1 auto; overflow-y: auto; min-height: 0; }
body.rh-v2 .rh-senddoc-card { display: flex; gap: 12px; padding: 14px; background: var(--ok-bg); border: 1px solid rgba(22, 163, 106, 0.2); border-radius: 12px; }
body.rh-v2 .rh-senddoc-card__icon { width: 40px; height: 40px; border-radius: 10px; background: var(--ok); color: #fff; display: grid; place-items: center; flex: none; }
body.rh-v2 .rh-senddoc-card__icon .material-symbols-outlined { font-size: 22px; }
body.rh-v2 .rh-senddoc-card__text strong { display: block; font-size: 14px; color: var(--ink); margin-bottom: 4px; }
body.rh-v2 .rh-senddoc-card__text span { font-size: 12.5px; color: var(--ink-2); line-height: 1.5; }
body.rh-v2 .rh-senddoc-steps { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
body.rh-v2 .rh-senddoc-steps li { display: flex; align-items: flex-start; gap: 10px; font-size: 12.5px; color: var(--ink-2); line-height: 1.5; }
body.rh-v2 .rh-senddoc-steps .material-symbols-outlined { color: var(--ok); font-size: 18px; flex: none; }

/* Process modal (3 colunas) */
body.rh-v2 .rh-modal-dialog.rh-process-dialog { width: min(1100px, 100%); }
body.rh-v2 .rh-proc-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  padding: 20px 24px;
  flex: 1 1 auto;
  overflow-y: auto;
  min-height: 0;
  background: var(--bg);
}
@media (max-width: 900px) {
  body.rh-v2 .rh-proc-grid { grid-template-columns: 1fr; }
}
body.rh-v2 .rh-proc-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin: 0;
}
body.rh-v2 .rh-proc-card__head { display: flex; align-items: center; gap: 10px; padding: 0; border: 0; margin: 0; }
body.rh-v2 .rh-proc-card__icon { width: 36px; height: 36px; border-radius: 9px; background: var(--navy-tint); color: var(--navy); display: grid; place-items: center; flex: none; }
body.rh-v2 .rh-proc-card__icon .material-symbols-outlined { font-size: 20px; }
body.rh-v2 .rh-proc-card__head h3 { margin: 0; font-size: 13.5px; font-weight: 600; color: var(--ink); text-transform: none; letter-spacing: -0.005em; }
body.rh-v2 .rh-proc-card__head h3::after { display: none; }
body.rh-v2 .rh-proc-card__head p { margin: 2px 0 0; font-size: 11px; color: var(--ink-3); }
body.rh-v2 .rh-proc-card .rh-form-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
body.rh-v2 .rh-proc-card .rh-field-full { grid-column: 1 / -1; }

/* Process modal footer with action spacing */
body.rh-v2 .rh-process-actions { flex-wrap: wrap; }
body.rh-v2 .rh-process-actions__spacer { flex: 1; min-width: 4px; }

/* Modal tabs (Novo/Editar funcionário, Novo candidato, etc.) */
body.rh-v2 .rh-modal-tabs {
  flex: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  padding: 4px 12px 0;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
  overflow: hidden;
  scrollbar-width: none;
}
body.rh-v2 .rh-modal-tabs::-webkit-scrollbar { display: none; }
body.rh-v2 .rh-modal-tab {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 8px 10px;
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: var(--ink-3);
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: color 140ms, border-color 140ms, background 140ms;
  margin-bottom: -1px;
  flex: 0 1 auto;
}
body.rh-v2 .rh-modal-tab:hover { color: var(--navy); background: var(--surface); }
body.rh-v2 .rh-modal-tab.is-active { color: var(--navy); border-bottom-color: var(--navy); background: var(--surface); }
body.rh-v2 .rh-modal-tab .material-symbols-outlined { font-size: 16px; }
body.rh-v2 .rh-modal-tab[hidden] { display: none; }

/* hide non-active panels when inside a tabbed dialog */
body.rh-v2 .rh-modal-dialog .rh-form-sections > .rh-form-section[data-modal-panel][hidden] { display: none; }
body.rh-v2 .rh-modal-dialog .rh-form-sections > .rh-form-section[data-modal-panel]:not([hidden]) { display: block; }

/* Renew experience modal */
body.rh-v2 .rh-modal-dialog.rh-renew-dialog { width: min(540px, 100%); }
body.rh-v2 .rh-renew-body { padding: 20px 24px; display: flex; flex-direction: column; gap: 16px; flex: 1 1 auto; overflow-y: auto; min-height: 0; }
body.rh-v2 .rh-renew-card { display: flex; gap: 14px; align-items: flex-start; padding: 16px; background: var(--navy-tint); border: 1px solid var(--navy-tint-3); border-radius: 12px; }
body.rh-v2 .rh-renew-card__icon { width: 40px; height: 40px; border-radius: 10px; background: var(--surface); color: var(--navy); display: grid; place-items: center; flex: none; }
body.rh-v2 .rh-renew-card__icon .material-symbols-outlined { font-size: 22px; }
body.rh-v2 .rh-renew-card__text { margin: 0; font-size: 13.5px; line-height: 1.5; color: var(--ink); }
body.rh-v2 .rh-renew-section { display: flex; flex-direction: column; gap: 10px; }
body.rh-v2 .rh-renew-section__title { margin: 0; font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3); display: inline-flex; align-items: center; gap: 8px; }
body.rh-v2 .rh-renew-note { margin: 0; display: flex; gap: 8px; align-items: flex-start; padding: 10px 12px; background: var(--warn-bg); border-radius: 8px; font-size: 12px; line-height: 1.45; color: var(--ink-2); }
body.rh-v2 .rh-renew-note .material-symbols-outlined { color: var(--warn); font-size: 16px; flex: none; margin-top: 1px; }

/* Upload drop inside modal */
body.rh-v2 .rh-upload-drop {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 28px 24px;
  border: 1.5px dashed var(--line-2);
  border-radius: 12px;
  background: var(--bg);
  transition: border-color 160ms, background 160ms;
  cursor: pointer;
}
body.rh-v2 .rh-upload-drop:hover { border-color: var(--navy-tint-3); background: var(--navy-tint); }
body.rh-v2 .rh-upload-drop .material-symbols-outlined { font-size: 32px; color: var(--ink-3); }
body.rh-v2 .rh-upload-drop strong { color: var(--ink); font-size: 14px; font-weight: 600; }
body.rh-v2 .rh-upload-drop small { color: var(--ink-3); font-size: 12px; text-align: center; }

/* ====================================================================
   Dossiê do funcionário — categorias + doc list (escopado em .rh-v2)
==================================================================== */
.rh-v2 .rh-dossie-category-tabs {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  margin-bottom: 14px;
  align-items: stretch;
}
.rh-v2 .rh-dossie-category-tab {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1 1 0;
  padding: 12px 32px 12px 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  text-align: left;
  font: inherit;
  cursor: pointer;
  position: relative;
  transition: border-color 160ms, transform 160ms, background 160ms;
  min-width: 0;
  min-height: 78px;
  overflow: hidden;
}
.rh-v2 .rh-dossie-category-name {
  white-space: normal;
  word-break: break-word;
  overflow-wrap: anywhere;
  line-height: 1.25;
}
.rh-v2 .rh-dossie-category-tab:hover { border-color: var(--navy-tint-3); transform: translateY(-1px); }
.rh-v2 .rh-dossie-category-tab[aria-selected="true"],
.rh-v2 .rh-dossie-category-tab.is-active {
  background: var(--navy);
  border-color: var(--navy);
}
.rh-v2 .rh-dossie-category-tab[aria-selected="true"] .rh-dossie-category-name,
.rh-v2 .rh-dossie-category-tab[aria-selected="true"] .rh-dossie-category-count { color: #fff; }
.rh-v2 .rh-dossie-category-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -0.005em;
}
.rh-v2 .rh-dossie-category-count {
  font-size: 17px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
  color: var(--ink);
  line-height: 1;
}
.rh-v2 .rh-dossie-category-tab.is-empty .rh-dossie-category-count { color: var(--ink-4); }
.rh-v2 .rh-dossie-category-state {
  position: absolute;
  top: 10px;
  right: 10px;
  font-size: 16px;
  color: var(--ok);
}
.rh-v2 .rh-dossie-category-tab.is-empty .rh-dossie-category-state { color: var(--ink-4); }
.rh-v2 .rh-dossie-category-tab[aria-selected="true"] .rh-dossie-category-state { color: rgba(255,255,255,0.85); }

/* Active panel inherits rh-panel look */
.rh-v2 .rh-dossie-active-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: visible;
  margin-bottom: 18px;
}
.rh-v2 .rh-dossie-active-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
}
.rh-v2 .rh-dossie-active-head h2 { margin: 0; font-size: 14.5px; font-weight: 600; color: var(--ink); letter-spacing: -0.005em; }
.rh-v2 .rh-dossie-active-head > div:first-child > span,
.rh-v2 #activeCategoryCount { font-size: 12px; color: var(--ink-3); font-variant-numeric: tabular-nums; }

.rh-v2 .rh-dossie-inner-filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: flex-end;
}
.rh-v2 .rh-dossie-inner-filters .rh-field {
  display: flex; flex-direction: column; gap: 4px; min-width: 140px;
}
.rh-v2 .rh-dossie-inner-filters .rh-field > span {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.rh-v2 .rh-dossie-inner-filters .rh-field input,
.rh-v2 .rh-dossie-inner-filters .rh-field select {
  font: inherit;
  font-size: 12.5px;
  padding: 8px 10px;
  border: 1px solid var(--line-2);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  outline: none;
  transition: border-color 140ms;
}
.rh-v2 .rh-dossie-inner-filters .rh-field input:focus,
.rh-v2 .rh-dossie-inner-filters .rh-field select:focus { border-color: var(--navy); box-shadow: 0 0 0 3px var(--navy-tint); }

/* Doc list */
.rh-v2 .rh-dossie-doc-list { padding: 0; }
.rh-v2 .rh-dossie-doc-group { border-bottom: 1px solid var(--line); }
.rh-v2 .rh-dossie-doc-group:last-child { border-bottom: 0; }

.rh-v2 .rh-dossie-doc-item {
  display: grid;
  grid-template-columns: 44px minmax(220px, 1.5fr) minmax(220px, 2fr) auto;
  align-items: center;
  gap: 16px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--line);
  transition: background 140ms;
  background: var(--surface);
}
.rh-v2 .rh-dossie-doc-item:hover { background: var(--navy-tint); }
.rh-v2 .rh-dossie-doc-item:last-child { border-bottom: 0; }

.rh-v2 .rh-dossie-doc-main { display: contents; }
.rh-v2 .rh-dossie-doc-icon {
  grid-column: 1;
  width: 36px; height: 36px;
  border-radius: 9px;
  background: var(--navy-tint);
  color: var(--navy);
  display: grid; place-items: center;
}
.rh-v2 .rh-dossie-doc-icon .material-symbols-outlined { font-size: 20px; }
.rh-v2 .rh-dossie-doc-text { grid-column: 2; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.rh-v2 .rh-dossie-doc-text strong,
.rh-v2 .rh-dossie-doc-text > strong {
  color: var(--ink);
  font-size: 13.5px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
}
.rh-v2 .rh-dossie-doc-text span,
.rh-v2 .rh-dossie-doc-text > span {
  color: var(--ink-3);
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rh-v2 .rh-dossie-doc-meta {
  grid-column: 3;
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  align-items: center;
}
.rh-v2 .rh-dossie-doc-meta .badge,
.rh-v2 .rh-dossie-doc-meta .rh-doc-detail {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--ink-2);
  font-size: 11px;
  font-weight: 500;
  white-space: nowrap;
}
.rh-v2 .rh-dossie-doc-meta .badge.success { background: var(--ok-bg); color: var(--ok); border-color: rgba(22, 163, 106, 0.2); }
.rh-v2 .rh-dossie-doc-meta .badge.warning { background: var(--warn-bg); color: var(--warn); border-color: rgba(180, 107, 0, 0.2); }
.rh-v2 .rh-dossie-doc-meta .badge.danger { background: var(--crit-bg); color: var(--crit); border-color: rgba(200, 57, 47, 0.2); }
.rh-v2 .rh-dossie-doc-meta .badge.info { background: var(--info-bg); color: var(--info); border-color: rgba(44, 98, 207, 0.2); }

.rh-v2 .rh-row-actions.rh-dossie-doc-actions,
.rh-v2 .rh-dossie-doc-actions {
  grid-column: 4;
  display: inline-flex;
  gap: 2px;
  justify-self: end;
}
.rh-v2 .rh-dossie-doc-actions .btn-ghost,
.rh-v2 .rh-dossie-doc-actions .btn-icon-only {
  width: 32px; height: 32px;
  display: inline-grid; place-items: center;
  border: 1px solid transparent;
  background: transparent;
  border-radius: 8px;
  color: var(--ink-3);
  cursor: pointer;
  padding: 0;
}
.rh-v2 .rh-dossie-doc-actions .btn-ghost:hover,
.rh-v2 .rh-dossie-doc-actions .btn-icon-only:hover {
  background: var(--navy-tint); color: var(--navy); border-color: var(--navy-tint-3);
}
.rh-v2 .rh-dossie-doc-actions .btn-ghost .material-symbols-outlined { font-size: 18px; }

.rh-v2 .rh-dossie-empty-state {
  padding: 32px 24px;
  text-align: center;
  color: var(--ink-3);
  font-size: 13px;
}

/* Document indicator (used in central dossie table) */
.rh-v2 .rh-doc-indicator {
  display: inline-grid;
  place-items: center;
  width: 26px; height: 26px;
  border-radius: 7px;
  font-size: 11px;
  font-weight: 700;
}
.rh-v2 .rh-doc-indicator .material-symbols-outlined { font-size: 14px; }
.rh-v2 .rh-doc-indicator.has-doc { background: var(--ok-bg); color: var(--ok); }
.rh-v2 .rh-doc-indicator.no-doc { background: var(--bg); color: var(--ink-4); border: 1px solid var(--line); }

/* responsive */
@media (max-width: 760px) {
  .rh-v2 .rh-pagehead__row h1 { font-size: 22px; }
  .rh-v2 .rh-toolbar__search { min-width: 100%; }
  .rh-v2 .rh-tabs { width: 100%; overflow-x: auto; }
  .rh-v2 .rh-dossie-doc-item { grid-template-columns: 44px 1fr; gap: 12px; }
  .rh-v2 .rh-dossie-doc-meta,
  .rh-v2 .rh-dossie-doc-actions { grid-column: 1 / -1; }
}
