/* ============================================================
   HR & Onboarding — the new look (#/hr and #/hr-employee/<id>)
   Loads after huddle-next.css and uses the ivy-refresh.css tokens
   (--bg, --card, --line, --teal, --danger, --warn, --ok, --fg, --muted).
   hr.js keeps its markup, ids and data-* hooks; most rows still carry
   inline styles, so the rules that restyle them use !important on
   purpose. Everything is scoped under .hrx (the HR shell and the
   employee file) or a .page-shell that contains one.
   Pieces: page header + tabs, New Hires list, the pre-start gate
   (ring + open items by who owes them), the profile cards, the
   onboarding checklist, Documents slots, and the system IDs card.
   ============================================================ */

/* ---------- page header (both screens) ---------- */
.page-shell:has(.hrx) .page-header { align-items: flex-end; gap: 12px 20px; margin-bottom: 18px; }
.page-shell:has(.hrx) .page-header .eyebrow { display: none; }
.page-shell:has(.hrx) .page-header .page-title { margin: 0 0 4px; }
.page-shell:has(.hrx) .page-header select#hr-facility-filter {
  height: var(--ctl-h); padding: 0 30px 0 12px !important; border: 1px solid var(--line) !important; border-radius: 10px !important;
  background-color: var(--card) !important; color: var(--fg); font: inherit; font-size: var(--fs-base) !important; font-weight: 600 !important;
}

/* Employee file header: one row of quiet buttons (the shared button size),
   the rest under More; the one primary is the hire's next step (#emp-next-btn,
   in the gate). hr.js renders these without inline styles. */
.page-shell:has(.hrx-file) .page-header { align-items: flex-start; }
.hrx-file-acts { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.page-shell:has(.hrx-file) .page-actions > div > button,
.page-shell:has(.hrx-file) .page-actions > div > a,
.page-shell:has(.hrx-file) .page-actions > div > details > summary {
  display: inline-flex; align-items: center; gap: 6px; height: var(--ctl-h); padding: 0 var(--ctl-px);
  border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--card); color: var(--fg); box-shadow: none;
  font: inherit; font-size: var(--fs-base); font-weight: 600; line-height: 1; white-space: nowrap; text-decoration: none; cursor: pointer; list-style: none; box-sizing: border-box;
}
.page-shell:has(.hrx-file) .page-actions #btn-back { padding: 0 8px; border-color: transparent; background: transparent; color: var(--teal); }
.page-shell:has(.hrx-file) .page-actions #btn-back:hover { background: var(--surface-hover); }
.page-shell:has(.hrx-file) .page-actions > div > button:not(#btn-back):hover,
.page-shell:has(.hrx-file) .page-actions > div > a:hover,
.page-shell:has(.hrx-file) .page-actions .emp-more > summary:hover { background: var(--surface-hover); }
.page-shell:has(.hrx-file) .page-actions .emp-danger > summary { border-color: var(--danger-line); color: var(--danger); }
.page-shell:has(.hrx-file) .emp-more-menu { border: 1px solid var(--line); border-radius: var(--r-field); box-shadow: var(--shadow-pop); background: var(--card); padding: 6px; gap: 2px; }
.page-shell:has(.hrx-file) .emp-more .emp-more-menu > button,
.page-shell:has(.hrx-file) .emp-more .emp-more-menu > a,
.page-shell:has(.hrx-file) .emp-danger .emp-more-menu > button {
  display: flex; align-items: center; justify-content: flex-start; width: 100%; min-height: var(--ctl-h); padding: 0 10px;
  border: 0; border-radius: 7px; background: transparent; color: var(--fg); text-align: left; text-decoration: none; cursor: pointer;
  font: inherit; font-size: var(--fs-base); font-weight: 600; white-space: nowrap;
}
.page-shell:has(.hrx-file) .emp-danger .emp-more-menu > button { color: var(--danger-ink); }
.page-shell:has(.hrx-file) .emp-more .emp-more-menu > button:hover,
.page-shell:has(.hrx-file) .emp-more .emp-more-menu > a:hover,
.page-shell:has(.hrx-file) .emp-danger .emp-more-menu > button:hover { background: var(--surface-hover); }

/* ---------- tabs ---------- */
.hrx .hr-tabs { margin-bottom: 22px; background: var(--bg); }
.hrx .hr-tab {
  position: relative;
}

/* ---------- shared pieces inside HR ---------- */
.hrx h3 { font-family: var(--font-display); letter-spacing: -0.01em; }
.hrx .btn-primary, .hrx button.btn.btn-primary { background: var(--teal); border-color: var(--teal); color: var(--on-solid); }
.hrx details.hr-more-tools > summary::-webkit-details-marker { display: none; }

/* ---------- New Hires list (tab=readiness) ---------- */
.hrx #btn-invite-new { height: var(--ctl-h); padding: 0 var(--ctl-px) !important; border-radius: var(--r-sm); font-size: var(--fs-base) !important; box-shadow: var(--shadow-sm); box-sizing: border-box; }
.hrx #btn-invite-new:hover { background: var(--teal-deep) !important; }
/* KPIs are the shared .ivy-kpis strip; the list is an .ivy-card with a table. */
/* Not overflow: hidden: that cut off the ⋯ menu on the last rows. The
   header keeps the card's rounded corners on its own. */
.hrx-rl { overflow: visible; }
.hrx-rl-table thead th:first-child { border-top-left-radius: var(--r-card); }
.hrx-rl-table thead th:last-child { border-top-right-radius: var(--r-card); }
.hrx-rl .emp-more-menu { z-index: 60; }
.hrx-rl-table { width: 100%; border-collapse: collapse; }
.hrx-rl-table thead { background: var(--surface-2); }
.hrx-rl-table th {
  padding: 11px 14px; border-bottom: 1px solid var(--line); text-align: left;
  font-size: var(--fs-xs); font-weight: 650; letter-spacing: .05em; text-transform: uppercase; color: var(--muted);
}
.hrx-rl-table th:last-child { text-align: right; }
.hrx-rl-table td { padding: 13px 14px; }
.hrx #readiness-list tr[data-row-emp] { border-top: 1px solid var(--line); cursor: pointer; transition: background 120ms; }
.hrx #readiness-list tr[data-row-emp]:hover { background: var(--surface-hover); }
.hrx-rl-name { font-size: var(--fs-md); font-weight: 650; color: var(--fg); }
.hrx-rl-role { font-size: var(--fs-sm); color: var(--muted); }
.hrx-rl-table td[data-label="What's next"] { max-width: 320px; font-size: var(--fs-base); color: var(--fg-soft); }
.hrx-rl-table td[data-label="Progress"] { min-width: 120px; }
.hrx-rl-table td[data-label="Actions"] { text-align: right; white-space: nowrap; }
.hrx #readiness-list [data-testid="hire-status-word"] {
  display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: var(--r-pill);
  font-size: var(--fs-sm); font-weight: 700; color: var(--warn-ink); background: var(--warn-soft); border: 1px solid var(--warn-line);
}
.hrx #readiness-list [data-testid="hire-status-word"][data-tone="bad"] { color: var(--danger-ink); background: var(--danger-soft); border-color: var(--danger-line); }
.hrx #readiness-list [data-testid="hire-status-word"][data-tone="ok"] { color: var(--ok-ink); background: var(--ok-soft); border-color: var(--ok-line); }
.hrx #readiness-list summary[title="More"] { border-radius: 8px; color: var(--muted) !important; }
.hrx #readiness-list summary[title="More"]:hover { background: var(--surface-sunk); }

/* the shared progress bar markup (progressBar) */
.hrx [data-testid="things-left"] { color: var(--fg-soft); font-weight: 650 !important; }

/* ---------- employee file: pre-start gate ---------- */
.hrx-file { display: block; min-width: 0; color: var(--fg); }
.hrx-gate {
  display: grid; grid-template-columns: 300px minmax(0, 1fr); margin: 0 0 22px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r-card); box-shadow: var(--shadow-sm); overflow: hidden;
}
.hrx-gate-sum { display: flex; flex-direction: column; gap: 14px; padding: 20px; background: var(--surface-2); border-right: 1px solid var(--line); min-width: 0; }
.hrx-gate-ring { display: flex; align-items: center; gap: 14px; }
.hrx-ring {
  --p: 0; flex: none; width: 78px; height: 78px; border-radius: 50%; display: grid; place-items: center;
  background: conic-gradient(var(--teal) calc(var(--p) * 1%), var(--surface-sunk) 0);
}
.hrx-ring.is-done { background: conic-gradient(var(--ok) calc(var(--p) * 1%), var(--surface-sunk) 0); }
.hrx-ring span {
  width: 64px; height: 64px; border-radius: 50%; background: var(--surface-2); display: grid; place-items: center;
  font-family: var(--font-display); font-size: var(--fs-xl); font-weight: 750; color: var(--fg); font-variant-numeric: tabular-nums;
}
.hrx-gate-k { font-family: var(--font-display); font-size: var(--fs-2xl); font-weight: 750; line-height: 1.15; color: var(--fg); }
.hrx-gate-k.is-bad { color: var(--danger-ink); }
.hrx-gate-k.is-good { color: var(--ok-ink); }
.hrx-gate-ks { font-size: var(--fs-base); color: var(--fg-soft); }
.hrx-gate-foot { font-size: var(--fs-sm); color: var(--muted); display: flex; align-items: center; gap: 6px; }
.hrx-gate-foot::before { content: ""; width: 12px; height: 12px; border-radius: 50%; border: 1.5px solid var(--muted); flex: none; }

/* "What's next": a teal band on its own (a current or closed file), or the
   lower half of the gate summary for a new hire. hr.js renders it with classes. */
.hrx-next {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin: 0 0 16px; padding: 14px 16px;
  background: var(--teal-soft); border: 1px solid var(--teal-line); border-radius: var(--r-card);
}
.hrx-next-text { flex: 1 1 260px; min-width: 0; }
.hrx-next-k { font-size: var(--fs-xs); font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--teal-deep); }
.hrx-next-line { margin-top: 4px; font-size: var(--fs-md); font-weight: 600; line-height: 1.45; color: var(--fg); }
.hrx-next-note { margin-top: 4px; font-size: var(--fs-sm); color: var(--fg-soft); }
.hrx-gate .hrx-next { flex-direction: column; align-items: stretch; margin: 0; padding: 0; background: transparent; border: 0; border-radius: 0; }
.hrx-gate .hrx-next-text { flex: none; }
.hrx-gate #emp-next-btn { width: 100%; font-size: var(--fs-md); box-sizing: border-box; }

.hrx-gate-main { display: flex; flex-direction: column; min-width: 0; }
.hrx-gate-h { display: flex; align-items: center; gap: 12px; padding: 14px 18px 12px; border-bottom: 1px solid var(--line); }
.hrx-gate-h > div { flex: 1 1 auto; }
.hrx-gate-title { font-family: var(--font-display); font-size: var(--fs-lg); font-weight: 750; letter-spacing: -0.01em; }
.hrx-gate-sub { font-size: var(--fs-sm); color: var(--muted); margin-top: 1px; }
.hrx-gate-link { flex: none; font-size: var(--fs-base); font-weight: 650; color: var(--teal); padding: 6px 10px; border-radius: 8px; text-decoration: none; }
.hrx-gate-link:hover { background: var(--surface-hover); }
.hrx-gate-groups { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; background: var(--line); flex: 1; }
.hrx-gate-empty { grid-column: 1 / -1; background: var(--card); padding: 18px; font-size: var(--fs-base); color: var(--fg-soft); }
.hrx-gate-empty.is-ok { color: var(--ok-ink); font-weight: 600; }
.hrx-gg { background: var(--card); padding: 14px 18px 10px; min-width: 0; }
.hrx-gg:last-child:nth-child(odd) { grid-column: 1 / -1; }
.hrx-gg-h { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; min-height: 30px; }
.hrx-gg-name { font-size: var(--fs-xs); font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.hrx-gg-n {
  min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; display: inline-grid; place-items: center;
  background: var(--danger); color: var(--on-solid); font-size: var(--fs-xs); font-weight: 700; font-variant-numeric: tabular-nums;
}
.hrx-gg-h .hrx-gbtn { margin-left: auto; }
.hrx-gr { display: grid; grid-template-columns: 18px minmax(0, 1fr) auto; gap: 4px 10px; align-items: start; padding: 10px 0; border-top: 1px solid var(--line-soft); }
.hrx-gg-h + .hrx-gr { border-top: 0; }
.hrx-gr-ico { width: 16px; height: 16px; margin-top: 2px; border-radius: 50%; border: 1.5px dashed var(--line-strong); }
.hrx-gr[data-tone="bad"] .hrx-gr-ico {
  border: 0; border-radius: 0; background: var(--danger);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='4' y='11' width='16' height='10' rx='2'/%3E%3Cpath d='M8 11V7a4 4 0 0 1 8 0v4'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='4' y='11' width='16' height='10' rx='2'/%3E%3Cpath d='M8 11V7a4 4 0 0 1 8 0v4'/%3E%3C/svg%3E") center / contain no-repeat;
}
.hrx-gr[data-tone="warn"] .hrx-gr-ico { border-style: solid; border-color: var(--warn); background: var(--warn-soft); }
.hrx-gr-t { font-size: var(--fs-base); font-weight: 600; color: var(--fg); line-height: 1.35; overflow-wrap: anywhere; }
.hrx-gr-s { font-size: var(--fs-sm); color: var(--muted); margin-top: 2px; }
.hrx-gr-more { font-size: var(--fs-sm); color: var(--muted); padding: 6px 0 4px 28px; }
.hrx-chip { margin-top: 4px; border: 1px solid transparent; }
.hrx-chip[data-tone="bad"] { background: var(--danger-soft); color: var(--danger-ink); border-color: var(--danger-line); }
.hrx-chip[data-tone="warn"] { background: var(--warn-soft); color: var(--warn-ink); border-color: var(--warn-line); }
.hrx-gbtn:hover { background: var(--surface-hover); }
.hrx-gbtn.is-primary { background: var(--teal); border-color: var(--teal); color: var(--on-solid); }
.hrx-gbtn.is-primary:hover { background: var(--teal-deep); }

/* ---------- employee file: profile column ---------- */
.hrx-file .hr-prof-wrap { gap: 20px; margin-bottom: 22px !important; }
.hrx-file .hr-prof-card { border: 1px solid var(--line); border-radius: var(--r-card); padding: 18px 20px; box-shadow: var(--shadow-sm); background: var(--card); }
.hrx-file .hr-avatar { width: 52px; height: 52px; background: var(--teal); font-size: var(--fs-xl); font-weight: 700; letter-spacing: .02em; }
.hrx-file .hr-prof-hero .nm { font-family: var(--font-display); font-size: var(--fs-2xl); font-weight: 750; letter-spacing: -0.01em; color: var(--fg); }
.hrx-file .hr-prof-hero .sub { color: var(--muted); }
.hrx-file .hr-prof-card > span, .hrx-file .hr-prof-card > div > span[style*="text-transform:uppercase"] { letter-spacing: .04em; }
.hrx-file .hr-miss-chip { background: var(--danger-soft); color: var(--danger-ink); border: 1px solid var(--danger-line); }
.hrx-file .hr-prof-card [style*="text-transform:uppercase"][style*="font-weight:800"] { color: var(--muted) !important; font-weight: 700 !important; letter-spacing: .06em !important; }
.hrx-file .hr-prof-card a[data-jump] { color: var(--teal); font-weight: 650 !important; }
.hrx-file #everify-case { height: var(--ctl-h); border-color: var(--input-line) !important; border-radius: var(--r-sm) !important; font-size: var(--fs-base) !important; }
.hrx-file #mark-everify { height: var(--ctl-h); border-radius: var(--r-sm) !important; font-weight: 650 !important; }

.hrx-file .hr-section { border: 1px solid var(--line); border-radius: var(--r-card); box-shadow: var(--shadow-sm); }
.hrx-file .hr-section > .hr-section-head { background: var(--card); border-bottom: 1px solid var(--line); padding: 14px 18px; }
.hrx-file .hr-section-head h4 { font-family: var(--font-display); font-size: var(--fs-lead); font-weight: 750; text-transform: none; letter-spacing: -0.005em; color: var(--fg); }
.hrx-file .hr-field-grid { padding: 6px 18px 12px; gap: 0 28px; }
.hrx-file .hr-field { border-bottom-color: var(--line-soft); padding: 9px 0; }
.hrx-file .hr-field .lbl { font-size: var(--fs-sm); font-weight: 600; text-transform: none; letter-spacing: 0; color: var(--muted); }
.hrx-file .hr-field .val { font-size: var(--fs-md); color: var(--fg); }
.hrx-file .hr-field .val.editable:hover { background: var(--teal-soft); box-shadow: inset 0 0 0 1px var(--teal-line); }

/* ---------- employee file: section heads (checklist, documents) ---------- */
.hrx-file #emp-checklist-top h4, .hrx-file #emp-documents h4, .hrx-file #emp-offboarding h4 {
  font-family: var(--font-display); font-size: var(--fs-xl) !important; font-weight: 750; letter-spacing: -0.01em; color: var(--fg);
}
.hrx-file #emp-checklist-top h4 + p, .hrx-file #emp-documents h4 + p { font-size: var(--fs-base) !important; color: var(--muted) !important; }
.hrx-file #emp-checklist-top > div:first-child button,
.hrx-file #emp-checklist-top .btn,
.hrx-file #emp-documents > div:first-child .btn,
.hrx-file #drawer-add-file {
  height: var(--ctl-h); padding: 0 var(--ctl-px) !important; border-radius: var(--r-sm); font-size: var(--fs-base) !important; font-weight: 600 !important; box-sizing: border-box;
}
.hrx-file .btn.btn-secondary { background: var(--card); border: 1px solid var(--line); color: var(--fg); }
.hrx-file .btn.btn-secondary:hover { background: var(--surface-hover); }
.hrx-file .btn.btn-primary { background: var(--teal); border: 1px solid var(--teal) !important; color: var(--on-solid); }
.hrx-file .btn.btn-primary:hover { background: var(--teal-deep) !important; }

/* Not a new hire (current / closed): the What's next band on its own */

/* ---------- employee file: onboarding checklist ---------- */
.hrx-file .hr-checklist-table { font-size: var(--fs-base); }
.hrx-file .hr-checklist-table { background: var(--card); }
.hrx-file div:has(> .hr-checklist-table) { border: 1px solid var(--line) !important; border-radius: var(--r-card) !important; box-shadow: var(--shadow-sm); overflow: visible !important; }
.hrx-file .hr-checklist-table thead { background: var(--surface-2) !important; }
.hrx-file .hr-checklist-table thead th { font-size: var(--fs-xs) !important; font-weight: 650; letter-spacing: .05em; color: var(--muted) !important; border-bottom: 1px solid var(--line); }
.hrx-file .hr-checklist-table thead th:first-child { border-top-left-radius: var(--r-card); }
.hrx-file .hr-checklist-table thead th:last-child { border-top-right-radius: var(--r-card); }

/* section header row: title, done count, a small bar, caret */
.hrx-file .checklist-group-header { background: var(--card) !important; border-top: 1px solid var(--line) !important; }
.hrx-file .checklist-group-header:hover { background: var(--surface-hover) !important; }
.hrx-file .checklist-group-header > td { padding: 14px 18px !important; }
.hrx-file .ck-gh-caret { width: 16px !important; color: var(--muted) !important; font-size: var(--fs-3xs) !important; vertical-align: 2px; }
.hrx-file .ck-gh-label { font-family: var(--font-display); font-size: var(--fs-lead) !important; font-weight: 750 !important; color: var(--fg); }
.hrx-file .ck-gh-count { margin-left: 8px !important; background: var(--surface-sunk); color: var(--fg-soft) !important; font-size: var(--fs-xs) !important; font-weight: 650 !important; font-variant-numeric: tabular-nums; }
.hrx-file [data-group-complete] .ck-gh-count { background: var(--ok-soft); color: var(--ok-ink) !important; }
.hrx-file .ck-gh-hint { display: none; }
.hrx-file .ck-gh-bar { float: right; width: 120px; height: 6px; margin-top: 8px; border-radius: 999px; background: var(--surface-sunk); overflow: hidden; }
.hrx-file .ck-gh-bar > i { display: block; height: 100%; border-radius: inherit; background: var(--teal); }
.hrx-file [data-group-complete] .ck-gh-bar > i { background: var(--ok); }
.hrx-file .ck-gh-desc { color: var(--muted) !important; margin-left: 24px !important; }
.hrx-file .checklist-group-header:not([data-group-complete]) .ck-gh-desc { color: var(--muted) !important; }

/* item rows: a done / open marker in front of the name */
.hrx-file tr[data-group-row] { border-top: 1px solid var(--line-soft) !important; }
.hrx-file tr[data-group-row]:hover { background: var(--surface-2) !important; }
.hrx-file tr[data-group-row] > td { padding-top: 12px !important; padding-bottom: 12px !important; vertical-align: middle; }
.hrx-file tr[data-group-row] > td:first-child { position: relative; padding-left: 44px !important; }
.hrx-file tr[data-group-row] > td:first-child::before {
  content: ""; position: absolute; left: 18px; top: 50%; width: 16px; height: 16px; margin-top: -8px; box-sizing: border-box;
  border-radius: 50%; border: 1.5px dashed var(--line-strong);
}
.hrx-file tr[data-group-row][data-done] > td:first-child::before {
  border: 0; background: var(--ok);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9.5'/%3E%3Cpath d='M8 12.5l2.7 2.7L16 9.8'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9.5'/%3E%3Cpath d='M8 12.5l2.7 2.7L16 9.8'/%3E%3C/svg%3E") center / contain no-repeat;
}
.hrx-file tr[data-group-row] > td:first-child > div:first-child { font-size: var(--fs-base) !important; font-weight: 600 !important; color: var(--fg); }
.hrx-file tr[data-group-row] > td:first-child > div:last-child:not(:first-child) { color: var(--muted) !important; }

/* status: one word with a tone; done states keep their date beside them */
.hrx-file [data-testid="ck-status"] {
  display: inline-flex; align-items: center; gap: 6px; font-size: var(--fs-sm); font-weight: 600 !important; color: var(--fg-soft) !important;
}
.hrx-file [data-testid="ck-status"]::before { content: ""; width: 7px; height: 7px; border-radius: 50%; flex: none; background: var(--line-strong); }
.hrx-file [data-testid="ck-status"][data-tone="warn"] { color: var(--warn-ink) !important; }
.hrx-file [data-testid="ck-status"][data-tone="warn"]::before { background: var(--warn); }
.hrx-file [data-testid="ck-status"][data-tone="bad"] { color: var(--danger-ink) !important; }
.hrx-file [data-testid="ck-status"][data-tone="bad"]::before { background: var(--danger); }
.hrx-file .hr-checklist-table td span[style*="color:#1f7a3a"] { color: var(--ok-ink) !important; font-weight: 650 !important; }
.hrx-file .hr-checklist-table td span[style*="color:#a01010"] { color: var(--danger-ink) !important; }
.hrx-file .hr-checklist-table td span[style*="color:#888"] { color: var(--muted) !important; }

/* row buttons: one primary, the rest under More */
.hrx-file .hr-checklist-table td:last-child .btn { height: var(--ctl-h-sm); padding: 0 var(--ctl-px-sm) !important; border-radius: var(--r-sm) !important; font-size: var(--fs-sm) !important; font-weight: 650 !important; box-sizing: border-box; }
.hrx-file .hr-checklist-table .ck-more > summary { display: inline-flex; align-items: center; height: var(--ctl-h-sm); padding: 0 var(--ctl-px-sm) !important; border-radius: var(--r-sm); background: var(--card); border: 1px solid var(--line); color: var(--fg-soft); font-weight: 600; box-sizing: border-box; }
.hrx-file .hr-checklist-table .ck-more > summary:hover { background: var(--surface-hover); }
.hrx-file .hr-checklist-table .ck-more-menu { border: 1px solid var(--line) !important; box-shadow: 0 2px 6px rgba(16,32,36,.06), 0 24px 48px -12px rgba(16,32,36,.24) !important; }
.hrx-file .hr-checklist-table .ck-more-menu .btn { height: auto !important; min-height: 34px; border: 0 !important; background: transparent !important; color: var(--fg) !important; text-align: left; border-radius: 7px !important; padding: 8px 10px !important; }
.hrx-file .hr-checklist-table .ck-more-menu .btn:hover { background: var(--surface-hover) !important; }
.hrx-file .hr-checklist-table .ck-more-menu a { display: block; padding: 8px 10px; border-radius: 7px; color: var(--teal); font-weight: 600; }

/* ---------- employee file: Documents ---------- */
.hrx-file #hr-file-drawer { border: 1px solid var(--line) !important; border-radius: var(--r-card) !important; padding: 16px 18px !important; box-shadow: var(--shadow-sm); }
.hrx-file .hr-slots { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 420px), 1fr)); gap: 12px; }
.hrx-file .hr-slot { border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px 8px; background: var(--card); }
.hrx-file .hr-slot.is-over { border-color: var(--teal); background: var(--teal-soft); }
.hrx-file .hr-slot-title { font-family: var(--font-display); font-size: var(--fs-md); font-weight: 750; color: var(--fg); }
.hrx-file .hr-slot-count {
  background: var(--ok-soft); color: var(--ok-ink); border: 1px solid var(--ok-line);
}
.hrx-file .hr-slot-file { border-top-color: var(--line-soft); }
.hrx-file .hr-slot-file-main > div:first-child { font-size: var(--fs-base) !important; color: var(--fg); }
.hrx-file .hr-slot-open { display: inline-flex; align-items: center; height: var(--ctl-h-sm); padding: 0 var(--ctl-px-sm); border-radius: var(--r-sm); border: 1px solid var(--line); color: var(--teal) !important; text-decoration: none !important; box-sizing: border-box; }
.hrx-file .hr-slot-open:hover { background: var(--surface-hover); }
.hrx-file .hr-slot-file-actions select { height: var(--ctl-h-sm); border-color: var(--line) !important; border-radius: var(--r-sm) !important; color: var(--fg); }
.hrx-file .hr-slot-file-actions label {
  height: 28px; padding: 0 10px 0 8px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface-2);
}
.hrx-file .hr-slot-file-actions label:has(input:checked) { background: var(--ok-soft); border-color: var(--ok-line); color: var(--ok-ink) !important; }
.hrx-file .hr-slot-file-actions label input { width: 14px !important; height: 14px !important; accent-color: var(--ok); }
.hrx-file [data-drawer-delete] { height: var(--ctl-h-sm); border: 1px solid transparent !important; background: transparent !important; color: var(--danger) !important; border-radius: var(--r-sm) !important; box-sizing: border-box; }
.hrx-file [data-drawer-delete]:hover { background: var(--danger-soft) !important; }
.hrx-file .hr-slot-drop { color: var(--teal); font-weight: 600; }
.hrx-file .hr-slot-drop:hover { color: var(--teal-deep); }
.hrx-file .hr-slot-empties { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line-soft); }
.hrx-file .hr-slot-empties-label { font-size: var(--fs-sm); font-weight: 650; color: var(--muted); margin-right: 4px; }
.hrx-file .hr-slot-empty {
  display: inline-flex; align-items: center; height: 30px; padding: 0 12px; border-radius: 999px; border: 1px dashed var(--line-strong);
  background: var(--card); color: var(--fg-soft); font-size: var(--fs-sm); font-weight: 600; cursor: pointer;
}
.hrx-file .hr-slot-empty:hover { border-color: var(--teal); color: var(--teal); background: var(--teal-soft); }

/* ---------- employee file: system IDs + feedback ---------- */
.hrx-file details.hr-prof-card { padding: 14px 18px; }
.hrx-file details.hr-prof-card > summary { font-size: var(--fs-md) !important; font-weight: 700; text-transform: none !important; letter-spacing: 0; color: var(--fg); font-family: var(--font-display); }
.hrx-file details.hr-prof-card[open] > summary { margin-bottom: 4px; }
.hrx-file [data-ext-system] { height: var(--ctl-h); border-color: var(--input-line) !important; border-radius: var(--r-sm) !important; font-size: var(--fs-base) !important; }
.hrx-file #save-ext-links { height: var(--ctl-h); border-radius: var(--r-sm); }
.hrx-file #feedback-trends { border-color: var(--line) !important; border-radius: var(--r-card) !important; }

/* ---------- narrower screens ---------- */
@media (max-width: 1100px) {
  .hrx-gate { grid-template-columns: minmax(0, 1fr); }
  .hrx-gate-sum { border-right: 0; border-bottom: 1px solid var(--line); }
  .hrx-gate #emp-next-btn { width: auto; align-self: flex-start; }
}
@media (max-width: 720px) {
  .hrx .hr-tabs { margin-bottom: 18px; }
  .hrx .hr-tabs::-webkit-scrollbar { display: none; }
  .hrx-gate-groups { grid-template-columns: minmax(0, 1fr); }
  .hrx-gg:last-child:nth-child(odd) { grid-column: auto; }
  .hrx-gate-sum { padding: 16px; }
  .hrx-gate #emp-next-btn { width: 100%; }
  .hrx-gate-h { padding: 12px 16px; }
  .hrx-gg { padding: 12px 16px 8px; }
  .hrx-file .hr-field-grid { padding: 4px 16px 10px; }
  .hrx-file .ck-gh-bar { display: none; }
  .hrx-file tr[data-group-row] { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; column-gap: 8px; padding: 10px 0; }
  .hrx-file tr[data-group-row] > td { padding: 2px 14px !important; }
  .hrx-file tr[data-group-row] > td:first-child { grid-column: 1 / -1; padding-left: 42px !important; }
  .hrx-file tr[data-group-row] > td:first-child::before { left: 16px; }
  .hrx-file tr[data-group-row] > td:nth-child(2) { padding-left: 42px !important; min-width: 0; }
  .hrx-file tr[data-group-row] > td:last-child { padding-left: 0 !important; text-align: right !important; }
  .hrx-file tr[data-group-row] > td:last-child .btn, .hrx-file tr[data-group-row] > td:last-child summary { margin: 0 !important; }
  .hrx-file .checklist-group-header > td { padding: 12px 14px !important; }
  .hrx-file #hr-file-drawer { padding: 14px !important; }
}

/* status badges on the profile card (statusBadge): sentence case chips */
.hrx-file .hr-prof-card span[style*="border-radius:12px"][style*="text-transform:uppercase"] {
  display: inline-flex; align-items: center; height: 22px; padding: 0 9px !important; border-radius: 999px !important;
  text-transform: none !important; letter-spacing: 0 !important; font-size: var(--fs-sm) !important; font-weight: 650 !important;
}
@media (max-width: 720px) {
  /* two short fields per row on a phone; long values wrap */
  .hrx-file .hr-field-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; }
  .hrx-file .hr-field .val { overflow-wrap: anywhere; }
}

/* tab-level "More" menus and section titles inside the HR shell */
.hrx details.hr-more-tools > summary.btn {
  display: inline-flex; align-items: center; height: var(--ctl-h); padding: 0 12px !important; border-radius: var(--r-sm);
  background: var(--card); border: 1px solid var(--line); color: var(--fg); font-weight: 600; box-sizing: border-box;
}
.hrx details.hr-more-tools > summary.btn:hover { background: var(--surface-hover); }
.hrx #hr-tab-body > div:first-child h3 { font-size: var(--fs-xl) !important; font-weight: 750; }

/* New Hires on a phone: one compact card per hire — name and status on
   top, the next step, the bar, then the button. */
@media (max-width: 720px) {
  .hrx-rl { border: 0; background: transparent; box-shadow: none; overflow: visible; }
  .hrx-rl-table thead { display: none; }
  .hrx #readiness-list tr[data-row-emp] {
    display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 10px; align-items: center;
    padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--r-card); box-shadow: var(--shadow-sm); background: var(--card);
  }
  .hrx #readiness-list tr[data-row-emp] > td { padding: 0 !important; width: auto; min-width: 0; max-width: none; }
  .hrx #readiness-list tr[data-row-emp] > td::before { display: none; }
  .hrx #readiness-list td[data-label="Status"] { justify-self: end; }
  .hrx #readiness-list td[data-label="What's next"],
  .hrx #readiness-list td[data-label="Progress"],
  .hrx #readiness-list td[data-label="Actions"] { grid-column: 1 / -1; }
  .hrx #readiness-list td[data-label="Actions"] { display: flex; align-items: center; gap: 6px; }
  .hrx #readiness-list td[data-label="Actions"] [data-next-emp] { flex: 1 1 auto; }
}

/* New Hires: the status pill carries an icon with its word */
.hrx #readiness-list [data-testid="hire-status-word"] .hxo-i { width: 13px; height: 13px; flex: none; }

/* ---------- HR Overview (tab=overview), prefix hxo- ---------- */
.hxo { color: var(--fg); }
.hxo-i { width: 16px; height: 16px; flex: none; display: inline-block; vertical-align: middle; }
.hxo .hxo-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px 20px; flex-wrap: wrap; margin-bottom: 18px; }
.hxo-head-t { min-width: 0; }
.hxo .hxo-head h3 { margin: 0 0 4px; font-family: var(--font-display); font-size: var(--fs-xl); font-weight: 750; letter-spacing: -0.01em; color: var(--fg); }
.hxo-lede { margin: 0; font-size: var(--fs-base); color: var(--fg-soft); }
.hxo-meta { display: flex; flex-wrap: wrap; gap: 4px 16px; margin-top: 8px; font-size: var(--fs-sm); color: var(--muted); }
.hxo-meta-i { display: inline-flex; align-items: center; gap: 6px; }
.hxo-meta-i .hxo-i { width: 14px; height: 14px; }
.hxo-head-a { display: flex; gap: 8px; align-items: center; }
.hxo-btn { gap: 8px; }
.hxo-btn.is-primary { background: var(--teal); border-color: var(--teal); color: var(--on-solid); box-shadow: var(--shadow-sm); }
.hxo-btn.is-primary:hover { background: var(--teal-deep); }

/* KPI strip: one joined band, like New Hires */
.hxo-kpis {
  display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 1px; background: var(--line);
  border: 1px solid var(--line); border-radius: var(--r-card); overflow: hidden; box-shadow: var(--shadow-sm); margin-bottom: 20px;
}
.hxo-kpi {
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px; min-width: 0; border: 0; border-radius: 0;
  background: var(--card); color: var(--fg); font: inherit; text-align: left; cursor: pointer; transition: background 120ms;
}
.hxo-kpi:hover { background: var(--surface-hover); }
.hxo-kpi:focus-visible { outline: 2px solid var(--teal); outline-offset: -2px; }
.hxo-kpi.is-loading { cursor: default; }
.hxo-kpi-l { display: inline-flex; align-items: center; gap: 7px; }
.hxo-kpi-l .hxo-i { width: 15px; height: 15px; color: var(--teal); }
.hxo-kpi-v { margin-top: 2px; color: var(--fg); }
.hxo-kpi[data-tone="bad"] .hxo-kpi-v { color: var(--danger-ink); }
.hxo-kpi-h { font-size: var(--fs-sm); color: var(--muted); min-width: 0; }

/* status: icon + word */
.hxo-st { align-items: center; }
.hxo-st .hxo-i { width: 13px; height: 13px; }
.hxo-st[data-tone="ok"] { color: var(--ok-ink); }
.hxo-st[data-tone="warn"] { color: var(--warn-ink); }
.hxo-st[data-tone="bad"] { color: var(--danger-ink); }

/* cards */
.hxo .hxo-grid { gap: 16px; }
.hxo .hxo-card { min-width: 0; }
.hxo .hxo-card-h { padding: 14px 18px; border-bottom: 1px solid var(--line); align-items: flex-start; }
.hxo .hxo-card-h h4 { display: flex; align-items: center; gap: 8px; margin: 0; font-family: var(--font-display); font-size: var(--fs-lead); font-weight: 750; letter-spacing: -0.005em; color: var(--fg); }
.hxo .hxo-card-h h4 .hxo-i { color: var(--teal); }
.hxo .hxo-card-h .k-sub { display: block; margin: 2px 0 0 24px; font-size: var(--fs-sm); color: var(--muted); }
.hxo .hxo-link, .hxo .hr-ov-foot a {
  display: inline-flex; align-items: center; gap: 4px; font-size: var(--fs-base); font-weight: 650; color: var(--teal); padding: 4px 8px; margin: -4px -8px 0 0;
  border-radius: 8px; text-decoration: none; cursor: pointer; white-space: nowrap;
}
.hxo .hxo-link:hover, .hxo .hr-ov-foot a:hover { background: var(--surface-hover); text-decoration: none; }
.hxo .hxo-link .hxo-i, .hxo .hr-ov-foot a .hxo-i { width: 14px; height: 14px; }
.hxo .hr-ov-body { padding: 14px 18px 16px; }
.hxo .hxo-stats .big { font-family: var(--font-display); font-size: var(--fs-kpi); font-weight: 750; color: var(--fg); }
.hxo .hxo-stats .cap { font-size: var(--fs-sm); color: var(--muted); }
.hxo .hxo-legend { font-size: var(--fs-sm); color: var(--muted); }
.hxo .hxo-legend .sw { background: var(--teal); }
.hxo-spark { display: block; }
.hxo-sp-grid { stroke: var(--line-soft); }
.hxo-sp-stop { stop-color: var(--teal); }
.hxo-sp-line { stroke: var(--teal); }
.hxo-sp-dot { fill: var(--card); stroke: var(--teal); }
.hxo-sp-dot.is-last { fill: var(--teal); }
.hxo-sp-lbl { fill: var(--muted); }
.hxo-sp-last { fill: var(--fg); }

/* people rows */
.hxo .hr-ov-prow { border-top: 1px solid var(--line-soft); padding: 10px 0; }
.hxo .hr-ov-prow:first-child { border-top: 0; }
.hxo .hr-ov-prow:hover { background: var(--surface-hover); }
.hxo .hr-ov-avatar { width: 34px; height: 34px; background: var(--teal-soft); color: var(--teal-deep); font-size: var(--fs-sm); font-weight: 700; }
.hxo .hr-ov-avatar.g2, .hxo .hr-ov-avatar.g3, .hxo .hr-ov-avatar.g4 { background: var(--teal-soft); color: var(--teal-deep); }
.hxo .hr-ov-meta .nm { font-size: var(--fs-md); font-weight: 650; color: var(--fg); }
.hxo .hr-ov-meta .rl { font-size: var(--fs-sm); color: var(--muted); }
.hxo .hr-ov-miss .miss {
  background: var(--warn-soft); color: var(--warn-ink); border: 1px solid var(--warn-line);
}
.hxo .hr-ov-miss .miss.more { background: var(--surface-sunk); color: var(--fg-soft); border-color: var(--line); }
.hxo .hr-ov-date { font-size: var(--fs-base); font-weight: 650; color: var(--fg-soft); }
.hxo .hr-ov-yrs { background: var(--teal-soft); color: var(--teal-deep); border: 1px solid var(--teal-line); }
.hxo .hr-ov-foot { border-top: 1px solid var(--line-soft); font-size: var(--fs-sm); color: var(--muted); }
.hxo-empty {
  display: flex; align-items: center; justify-content: center; gap: 8px; padding: 22px 16px; border-radius: 10px;
  background: var(--surface-2); color: var(--fg-soft); font-size: var(--fs-base); text-align: center;
}
.hxo-empty[data-tone="ok"] { color: var(--ok-ink); font-weight: 600; }
.hxo-empty[data-tone="warn"] { color: var(--warn-ink); }

@media (max-width: 1100px) {
  .hxo-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
  .hxo .hxo-head { align-items: stretch; flex-direction: column; }
  .hxo-head-a .hxo-btn { width: 100%; justify-content: center; }
  .hxo-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hxo .hxo-card-h { padding: 12px 14px; }
  .hxo .hr-ov-body { padding: 12px 14px 14px; }
  .hxo .hxo-card-h .k-sub { margin-left: 0; }
  .hxo .hr-ov-miss { max-width: 48%; }
}
