/* HR pages (web/hr.js): People, Org Chart, Workforce, Time & Attendance
   (Pay & Labor Cost removed 2026-10-02 — Labor covers it). Everything is scoped under .hr (the page) or .hr-drawer /
   .hr-scrim (on <body>). Same design language as the Gantt page: gradient
   underline titles, KPI tiles with a gradient cap, 12px cards. Brand tokens
   only, so light and dark both follow theme.css. */

.hr { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.hr > * { min-width: 0; }
.hr-muted { color: var(--muted); font-size: .76rem; }
.hr-warnt { color: var(--warn); font-weight: 600; }
.hr-loading { flex-direction: row; align-items: center; justify-content: center; gap: 12px; padding: 64px 16px; color: var(--muted); }
.hr-spin { width: 18px; height: 18px; border: 2.5px solid var(--line-strong); border-top-color: var(--teal); border-radius: 50%; animation: hr-spin .8s linear infinite; }
@keyframes hr-spin { to { transform: rotate(360deg); } }

/* ---------- head ---------- */
.hr-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.hr-titles h1 { margin: 0; font-size: 1.55rem; font-weight: 700; letter-spacing: -.02em; position: relative; padding-bottom: 9px; }
.hr-titles h1::after { content: ""; position: absolute; left: 0; bottom: 0; width: 72px; height: 3px; border-radius: 3px; background: var(--gradient); }
.hr-titles p { margin: 8px 0 0; color: var(--muted); font-size: .84rem; max-width: 720px; line-height: 1.45; }
.hr-head-r { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.hr-fresh { font-size: .74rem; color: var(--muted); display: inline-flex; gap: 7px; align-items: center; }
.hr-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.hr-dot.ok { background: var(--green); box-shadow: 0 0 0 3px color-mix(in srgb, var(--green) 25%, transparent); }
.hr-dot.old { background: var(--warn); }

/* ---------- KPI tiles ---------- */
.hr-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(165px, 1fr)); gap: 12px; }
.hr-kpi {
  position: relative; overflow: hidden; text-align: left; font: inherit; color: inherit;
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow);
  padding: 15px 16px 13px; transition: box-shadow .15s, border-color .15s, transform .15s;
}
.hr-kpi::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 3px; background: var(--gradient); }
.hr-kpi.t-crit::before { background: var(--crit); }
.hr-kpi.t-warn::before { background: var(--warn); }
.hr-kpi.t-good::before { background: var(--good); }
.hr-kpi.click { cursor: pointer; }
.hr-kpi.click:hover { box-shadow: var(--shadow-hover); border-color: var(--teal); transform: translateY(-1px); }
.hr-kpi.on { border-color: var(--teal); box-shadow: 0 0 0 2px color-mix(in srgb, var(--teal) 35%, transparent); }
.hr-kpi .k { font-size: .63rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.hr-kpi .v { font-size: 1.7rem; font-weight: 700; letter-spacing: -.02em; margin: 4px 0 2px; font-variant-numeric: tabular-nums; }
.hr-kpi.t-crit .v { color: var(--crit); }
.hr-kpi.t-warn .v { color: var(--warn); }
.hr-kpi .s { font-size: .72rem; color: var(--muted); line-height: 1.35; }

/* ---------- cards ---------- */
.hr-card { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); padding: 16px 18px; min-width: 0; }
.hr-card-h { margin-bottom: 12px; }
.hr-card-h h2 { margin: 0; font-size: .98rem; font-weight: 700; }
.hr-card-h p { margin: 4px 0 0; font-size: .78rem; color: var(--muted); line-height: 1.45; max-width: 760px; }
/* card header with the All employees · NBP · XQM switch on the right (wraps under the title when narrow) */
.hr-card-h.co { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px 14px; flex-wrap: wrap; }
.hr-card-h.co > div:first-child { flex: 1 1 260px; min-width: 0; }
.hr-card-h.co .hr-seg button { padding: 5px 10px; font-size: .72rem; }
.hr-card.hr-flush { padding: 0; overflow: hidden; }
.hr-card.hr-flush > .hr-card-h { padding: 16px 18px 0; }
.hr-row2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.hr-row2.wide { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); }
.hr-row2 > * { min-width: 0; }
.hr-ec { width: 100%; }
.hr-dsub { font-size: .66rem; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: var(--muted); margin: 14px 0 7px; }
.hr-dsub:first-child { margin-top: 0; }
.hr-legend { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 8px; font-size: .74rem; color: var(--ink-2); }
.hr-legend span { display: inline-flex; align-items: center; gap: 6px; }
.hr-legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.ec-tip .t-more { margin-top: 5px; color: #9FB3C8; font-size: .7rem; }

/* ---------- toolbar / filters ---------- */
.hr-filter { padding: 12px 14px; display: flex; flex-direction: column; gap: 10px; }
.hr-toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.hr-sp { flex: 1; }
.hr-search { flex: 1 1 260px; min-width: 200px; max-width: 420px; display: flex; align-items: center; gap: 8px; border: 1px solid var(--line-strong); border-radius: 9px; padding: 0 10px; background: var(--surface); color: var(--muted); }
.hr-search:focus-within { border-color: var(--teal); box-shadow: 0 0 0 3px color-mix(in srgb, var(--teal) 18%, transparent); }
.hr-search input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font: inherit; font-size: .84rem; color: var(--ink); padding: 8px 0; }
.hr-sel { display: inline-flex; align-items: center; gap: 6px; font-size: .72rem; color: var(--muted); font-weight: 600; }
.hr-selpair { display: inline-flex; gap: 10px; flex-wrap: wrap; }
.hr-sel select { font: inherit; font-size: .8rem; color: var(--ink); background: var(--surface); border: 1px solid var(--line-strong); border-radius: 8px; padding: 7px 8px; max-width: 200px; }
.hr-seg { display: inline-flex; border: 1px solid var(--line-strong); border-radius: 9px; overflow: hidden; flex: none; }
.hr-seg button { border: 0; border-left: 1px solid var(--line); background: var(--surface); padding: 7px 12px; font: inherit; font-size: .76rem; font-weight: 600; color: var(--ink-2); cursor: pointer; white-space: nowrap; }
.hr-seg button:first-child { border-left: 0; }
.hr-seg button:hover { color: var(--ink); background: var(--surface-2); }
.hr-seg button[aria-pressed="true"] { background: var(--ink); color: var(--surface); }
.hr-flagrow { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.hr-flagrow > .hr-muted { margin-right: 4px; font-weight: 600; }
.hr-flag { display: inline-flex; gap: 6px; align-items: center; border: 1px solid var(--line); background: var(--surface-2); color: var(--ink-2); border-radius: 999px; padding: 4px 10px; font: inherit; font-size: .74rem; font-weight: 600; cursor: pointer; }
.hr-flag b { font-size: .68rem; color: var(--muted); }
.hr-flag:hover { border-color: var(--teal); }
.hr-flag[aria-pressed="true"] { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.hr-flag[aria-pressed="true"] b { color: var(--accent); }
.hr-clear { border: 0; background: none; color: var(--accent); font: inherit; font-size: .74rem; font-weight: 600; cursor: pointer; padding: 4px 6px; }
.hr-weekpick { display: inline-flex; align-items: center; gap: 6px; }
.hr-weekpick > span { display: inline-flex; flex-direction: column; align-items: center; font-weight: 700; font-size: .84rem; min-width: 128px; text-align: center; font-variant-numeric: tabular-nums; }
.hr-weekpick > span small { font-size: .62rem; font-weight: 700; color: var(--muted); letter-spacing: .08em; text-transform: uppercase; }
.hr-weekpick .ghost[disabled] { opacity: .35; cursor: default; }

/* ---------- avatars ---------- */
.hr-av {
  --sz: 44px; width: var(--sz); height: var(--sz); flex: none; border-radius: 50%; overflow: hidden;
  display: inline-grid; place-items: center; color: #fff; font-weight: 700; font-size: calc(var(--sz) * .36); letter-spacing: .02em;
  background: linear-gradient(135deg, var(--navy) 0%, #0d4a7a 55%, var(--accent-2) 100%);
  box-shadow: 0 0 0 2px var(--surface), 0 0 0 3px var(--line);
}
.hr-av.img { background: var(--surface-3); }
.hr-av img { width: 100%; height: 100%; object-fit: cover; display: block; }
.hr-av-vac { background: var(--surface-2); color: var(--muted); border: 2px dashed var(--line-strong); box-shadow: none; font-size: calc(var(--sz) * .45); font-weight: 500; }
.hr-who { display: inline-flex; align-items: center; gap: 10px; min-width: 0; text-align: left; border: 0; background: none; font: inherit; color: inherit; padding: 0; cursor: inherit; }
.hr-who > span:last-child { display: flex; flex-direction: column; min-width: 0; }
.hr-who b { font-weight: 600; font-size: .84rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hr-who small { color: var(--muted); font-size: .7rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
button.hr-who { cursor: pointer; }
button.hr-who:hover b { color: var(--accent); }

/* ---------- people: cards ---------- */
.hr-group { display: flex; flex-direction: column; gap: 10px; }
.hr-group-h { margin: 6px 0 0; font-size: .74rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-2); display: flex; align-items: center; gap: 8px; }
.hr-group-h span { background: var(--surface-3); color: var(--ink-2); border-radius: 999px; padding: 1px 8px; font-size: .68rem; letter-spacing: 0; }
.hr-group-h::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.hr-pgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.hr-pcard {
  display: flex; flex-direction: column; gap: 3px; text-align: left; font: inherit; color: inherit; cursor: pointer;
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); padding: 14px 15px 12px;
  transition: box-shadow .15s, border-color .15s, transform .15s; min-width: 0;
}
.hr-pcard:hover, .hr-pcard:focus-visible { border-color: var(--teal); box-shadow: var(--shadow-hover); transform: translateY(-1px); outline: none; }
.hr-pcard.left { background: var(--surface-2); }
.hr-pcard.left .hr-av { filter: grayscale(1); opacity: .75; }
.hr-pcard-top { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 8px; }
.hr-pcard-badges { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.hr-pcard-badges .pill { font-size: .64rem; padding: 1px 7px; }
.hr-pcard-n { font-weight: 700; font-size: .92rem; }
.hr-pcard-t { font-size: .78rem; color: var(--ink-2); min-height: 1.2em; }
.hr-pcard-m { display: flex; justify-content: space-between; gap: 8px; font-size: .72rem; color: var(--muted); margin-top: 6px; }
.hr-pcard-m > span:first-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hr-pcard-m > span:last-child { flex: none; }
.hr-pcard-f { display: flex; justify-content: space-between; gap: 8px; font-size: .7rem; color: var(--muted); border-top: 1px solid var(--line); padding-top: 7px; margin-top: 7px; }
.hr-pcard-pay { font-size: .74rem; font-weight: 700; color: var(--accent-2); }
.hr-pcard-pay.est { font-weight: 600; color: var(--muted); }

/* ---------- tables ---------- */
.hr-tbl { overflow-x: auto; }
.hr-tbl table { width: 100%; border-collapse: collapse; font-size: .82rem; }
.hr-tbl th { text-align: left; font-size: .64rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; background: var(--surface-2); position: sticky; top: 0; }
.hr-tbl th button { all: unset; cursor: pointer; display: inline-flex; gap: 4px; align-items: center; }
.hr-tbl th button:hover { color: var(--ink); }
.hr-sortcaret { font-size: .6rem; color: var(--accent); min-width: 8px; }
.hr-tbl td { padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; font-variant-numeric: tabular-nums; }
.hr-tbl th.n, .hr-tbl td.n { text-align: right; }
.hr-tbl th.n button { justify-content: flex-end; }
.hr-tbl tbody tr:last-child td { border-bottom: 0; }
.hr-tbl tr.click { cursor: pointer; }
.hr-tbl tr.click:hover td { background: color-mix(in srgb, var(--accent-soft) 55%, transparent); }
.hr-tbl tr.click:focus-visible { outline: 2px solid var(--teal); outline-offset: -2px; }
.hr-tbl .pill { font-size: .66rem; padding: 1px 6px; }

/* ---------- bars ---------- */
.hr-bars { display: grid; gap: 6px; }
.hr-bar { display: grid; grid-template-columns: minmax(90px, 34%) 1fr auto; gap: 10px; align-items: center; font: inherit; font-size: .8rem; color: inherit; text-align: left; border: 0; background: none; padding: 4px 6px; margin: 0 -6px; border-radius: 7px; }
.hr-bar.click { cursor: pointer; }
.hr-bar.click:hover { background: var(--surface-2); }
.hr-bar .l { color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hr-bar .t { height: 10px; background: var(--surface-2); border-radius: 0 5px 5px 0; overflow: hidden; }
.hr-bar .f { display: block; height: 100%; border-radius: 0 5px 5px 0; }
.hr-bar .n { font-weight: 700; font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.hr-bar .n small { font-weight: 600; color: var(--muted); font-size: .7rem; }

/* tenure columns */
.hr-cols { display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; align-items: end; height: 190px; padding-top: 6px; }
.hr-col { display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; }
.hr-col b { font-size: .9rem; font-variant-numeric: tabular-nums; }
.hr-col-t { flex: 1; width: 100%; max-width: 44px; display: flex; align-items: flex-end; }
.hr-col-t span { width: 100%; background: var(--series-1); border-radius: 4px 4px 0 0; min-height: 2px; }
.hr-col small { font-size: .68rem; color: var(--muted); white-space: nowrap; }

/* proportion split bars */
.hr-split { display: flex; flex-direction: column; gap: 7px; }
.hr-split-bar { display: flex; gap: 2px; height: 12px; border-radius: 6px; overflow: hidden; background: var(--surface-2); }
.hr-split-bar span { min-width: 3px; }
.hr-split-leg { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: .74rem; color: var(--ink-2); }
.hr-split-leg span { display: inline-flex; align-items: center; gap: 6px; }
.hr-split-leg i { width: 9px; height: 9px; border-radius: 2px; }
.hr-split-leg b { font-variant-numeric: tabular-nums; }
.hr-split-leg small { color: var(--muted); }

/* composition */
.hr-comp-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 28px; }

/* joiners / leavers timeline */
.hr-timeline { display: flex; flex-direction: column; gap: 14px; }
.hr-tl-m { display: grid; grid-template-columns: 150px 1fr; gap: 14px; align-items: start; }
.hr-tl-h { font-weight: 700; font-size: .84rem; position: sticky; top: 80px; display: flex; flex-direction: column; gap: 2px; padding-top: 6px; }
.hr-tl-h span { font-size: .7rem; color: var(--muted); font-weight: 600; font-variant-numeric: tabular-nums; }
.hr-tl-items { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 8px; }
.hr-tl-i { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; text-align: left; font: inherit; color: inherit; background: var(--surface); border: 1px solid var(--line); border-left: 3px solid var(--series-1); border-radius: 9px; padding: 8px 10px; cursor: pointer; min-width: 0; }
.hr-tl-i.out { border-left-color: var(--series-2); }
.hr-tl-i:hover { border-color: var(--teal); }
.hr-tl-i > span:nth-child(2) { display: flex; flex-direction: column; min-width: 0; }
.hr-tl-i b { font-size: .82rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hr-tl-i small { font-size: .7rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hr-tl-i .pill { font-size: .64rem; padding: 1px 6px; white-space: nowrap; }

/* ---------- org chart ---------- */
.hr-ogrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; }
.hr-onode { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); overflow: hidden; transition: border-color .15s, box-shadow .15s; min-width: 0; }
.hr-onode:hover { border-color: var(--teal); box-shadow: var(--shadow-hover); }
.hr-onode.vacant { border-style: dashed; border-color: var(--line-strong); background: var(--surface-2); box-shadow: none; }
.hr-onode.left { border-color: color-mix(in srgb, var(--crit) 50%, var(--line)); }
.hr-onode.hl { border-color: var(--teal); box-shadow: 0 0 0 3px color-mix(in srgb, var(--teal) 35%, transparent); }
.hr-onode-main { display: flex; gap: 12px; align-items: center; text-align: left; font: inherit; color: inherit; background: none; border: 0; padding: 12px 14px; cursor: pointer; min-width: 0; }
.hr-onode-t { display: flex; flex-direction: column; gap: 1px; min-width: 0; align-items: flex-start; }
.hr-onode-t b { font-weight: 700; font-size: .88rem; }
.hr-onode-t > span { font-size: .76rem; color: var(--ink-2); }
.hr-onode-t small { font-size: .7rem; color: var(--muted); }
.hr-onode-t .pill { font-size: .62rem; padding: 1px 6px; margin-top: 3px; }
.hr-onode-down { display: flex; align-items: center; gap: 2px; border: 0; border-top: 1px solid var(--line); background: var(--surface-2); font: inherit; font-size: .74rem; font-weight: 700; color: var(--accent); padding: 7px 14px; cursor: pointer; text-align: left; }
.hr-onode-down span { font-weight: 600; color: var(--muted); }
.hr-onode-down i { margin-left: auto; font-style: normal; font-size: 1rem; line-height: 1; }
.hr-onode-down:hover { background: var(--accent-soft); }
.hr-onode.focus { max-width: 440px; margin: 0 auto; border-color: color-mix(in srgb, var(--teal) 55%, var(--line)); position: relative; }
.hr-onode.focus::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 3px; background: var(--gradient); }
.hr-onode.focus .hr-onode-main { padding: 18px 20px; gap: 16px; }
.hr-onode.focus .hr-onode-t b { font-size: 1.05rem; }
.hr-onode.focus .hr-onode-t > span { font-size: .84rem; }
.hr-drill { display: flex; flex-direction: column; gap: 0; }
.hr-crumbs { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: .8rem; margin-bottom: 18px; }
.hr-crumbs > span { color: var(--muted); }
.hr-crumbs > button:not(.ghost) { border: 0; background: none; font: inherit; color: var(--accent); font-weight: 600; cursor: pointer; padding: 2px 2px; }
.hr-crumbs > button:not(.ghost):hover { text-decoration: underline; }
.hr-crumbs b { font-weight: 700; }
.hr-up { margin-left: auto; }
.hr-drill-stem { width: 2px; height: 22px; background: var(--line-strong); margin: 0 auto; }
.hr-drill-kids { border-top: 2px solid var(--line-strong); padding-top: 16px; display: flex; flex-direction: column; gap: 16px; }
.hr-drill-lbl { font-size: .66rem; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: var(--muted); margin-bottom: 8px; }
.hr-ogrid-top { margin-top: 4px; }

/* whole-chart outline */
.hr-outline { display: flex; flex-direction: column; }
.hr-ol-kids { position: relative; }
.hr-ol-row { display: flex; align-items: center; gap: 6px; padding: 3px 0 3px calc(var(--d) * 26px); position: relative; border-radius: 8px; }
.hr-ol-row:hover { background: var(--surface-2); }
.hr-ol-row::before { content: ""; position: absolute; left: calc(var(--d) * 26px - 14px); top: 0; bottom: 0; width: 1px; background: var(--line); }
.hr-ol-row[style*="--d:0"]::before { display: none; }
.hr-ol-tog { width: 22px; height: 22px; flex: none; border: 0; background: none; color: var(--muted); cursor: pointer; font-size: .8rem; display: grid; place-items: center; border-radius: 6px; }
button.hr-ol-tog:hover { background: var(--surface-3); color: var(--ink); }
.hr-ol-main { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; border: 0; background: none; font: inherit; color: inherit; text-align: left; cursor: pointer; padding: 3px 4px; }
.hr-ol-main b { font-size: .84rem; font-weight: 600; white-space: nowrap; }
.hr-ol-main > span:not(.hr-av):not(.pill) { font-size: .76rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.hr-ol-main:hover b { color: var(--accent); }
.hr-ol-row.vacant b { font-style: italic; color: var(--muted); }
.hr-ol-n { font-size: .68rem; font-weight: 700; color: var(--muted); background: var(--surface-3); border-radius: 999px; padding: 1px 8px; margin-right: 6px; }

/* ---------- time & attendance ---------- */
.hr-heat-wrap { overflow-x: auto; margin: 0 -4px; }
.hr-heat { width: 100%; border-collapse: separate; border-spacing: 3px; font-size: .78rem; font-variant-numeric: tabular-nums; }
.hr-heat thead th { font-size: .66rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); text-align: center; padding: 4px 2px 6px; }
.hr-heat thead th small { display: block; font-size: .78rem; letter-spacing: 0; color: var(--ink-2); }
.hr-heat thead th.today small { color: var(--accent); }
.hr-heat thead th:first-child { text-align: left; }
.hr-heat thead th.n, .hr-heat td.n { text-align: right; padding-right: 6px; }
.hr-heat tbody th { text-align: left; font-weight: 500; padding: 2px 10px 2px 0; min-width: 190px; max-width: 240px; }
/* the name column stays put while the days scroll sideways (phones) */
.hr-heat thead th:first-child, .hr-heat tbody th { position: sticky; left: 0; z-index: 1; background: var(--surface); }
.hr-fix { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; align-items: start; }
.hr-fix > div:only-child { grid-column: 1 / -1; }
.hr-heat td { text-align: center; height: 34px; min-width: 46px; border-radius: 6px; background: var(--surface-2); color: var(--muted); }
.hr-heat td.h1 { background: color-mix(in srgb, var(--series-1) 16%, var(--surface)); color: var(--ink); }
.hr-heat td.h2 { background: color-mix(in srgb, var(--series-1) 34%, var(--surface)); color: var(--ink); }
.hr-heat td.h3 { background: color-mix(in srgb, var(--series-1) 58%, var(--surface)); color: #fff; font-weight: 600; }
.hr-heat td.h4 { background: color-mix(in srgb, var(--series-1) 85%, var(--navy)); color: #fff; font-weight: 700; }
.hr-heat td.lv { background: repeating-linear-gradient(135deg, color-mix(in srgb, var(--series-4) 22%, var(--surface)) 0 5px, var(--surface) 5px 9px); color: var(--ink-2); font-size: .66rem; font-weight: 700; }
.hr-heat td.fut { background: transparent; border: 1px dashed var(--line); }
.hr-heat td.n { background: none; min-width: 90px; color: var(--ink); }
.hr-heat td.n > span { display: inline-flex; flex-direction: column; align-items: flex-end; line-height: 1.15; }
.hr-ot { font-size: .66rem; font-weight: 700; color: var(--series-2); }
.hr-exc { display: flex; flex-direction: column; gap: 6px; max-height: 440px; overflow: auto; }
.hr-exc-r { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; text-align: left; font: inherit; color: inherit; border: 1px solid var(--line); background: var(--surface); border-radius: 9px; padding: 8px 10px; cursor: pointer; }
.hr-exc-r:hover { border-color: var(--teal); }
.hr-exc-t { display: flex; flex-direction: column; min-width: 0; }
.hr-exc-t b { font-size: .82rem; font-weight: 600; }
.hr-exc-t small { font-size: .7rem; color: var(--muted); }

/* ---------- drawer ---------- */
.hr-scrim { position: fixed; inset: 0; background: rgba(6, 33, 65, .32); z-index: 39; backdrop-filter: blur(1px); }
.hr-drawer { width: min(560px, 100%); }
.hr-dhead { padding: 22px 22px 14px; border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 12px; }
.hr-hero { display: flex; gap: 16px; align-items: flex-start; }
.hr-hero .hr-av { box-shadow: 0 0 0 3px var(--surface), 0 0 0 4px var(--line-strong); }
.hr-hero-t { flex: 1; min-width: 0; padding-top: 4px; }
.hr-hero-t h2 { margin: 0; font-size: 1.2rem; font-weight: 700; letter-spacing: -.01em; }
.hr-hero-ti { color: var(--ink-2); font-size: .86rem; margin-top: 2px; }
.hr-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 9px; }
.hr-chip { font-size: .72rem; font-weight: 600; background: var(--surface-2); border: 1px solid var(--line); color: var(--ink-2); border-radius: 6px; padding: 1px 8px; }
.hr-chips .pill { font-size: .68rem; }
.hr-x { flex: none; }
.hr-shotctl { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.hr-shotctl .hr-muted { font-size: .7rem; }
.hr-dbody { padding: 6px 22px 28px; gap: 0; }
.hr-dsec { padding: 16px 0; border-bottom: 1px solid var(--line); }
.hr-dsec:last-child { border-bottom: 0; }
.hr-dsec h3 { margin: 0 0 10px; font-size: .68rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); display: flex; align-items: center; gap: 8px; }
.hr-kvs { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 18px; margin: 0; }
.hr-kv { min-width: 0; }
.hr-kv dt { font-size: .68rem; color: var(--muted); font-weight: 600; margin-bottom: 2px; }
.hr-kv dd { margin: 0; font-size: .84rem; overflow-wrap: anywhere; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.hr-kv dd a { color: var(--accent); }
.hr-plink { display: inline-flex; align-items: center; gap: 7px; border: 0; background: none; padding: 0; font: inherit; font-size: .84rem; color: var(--accent); font-weight: 600; cursor: pointer; }
.hr-plink:hover { text-decoration: underline; }
.hr-plink .hr-av { box-shadow: none; }
.hr-direct { margin-top: 14px; }
.hr-plinks { display: flex; flex-wrap: wrap; gap: 8px 14px; }
.hr-mini { display: grid; gap: 4px; align-items: end; }
.hr-mini-c { display: flex; flex-direction: column; align-items: center; gap: 3px; }
.hr-mini-b { width: 100%; max-width: 30px; height: 70px; display: flex; flex-direction: column-reverse; background: var(--surface-2); border-radius: 4px; overflow: hidden; }
.hr-mini-b i { display: block; width: 100%; }
.hr-mini-b i.rg { background: var(--series-1); }
.hr-mini-b i.ot { background: var(--series-2); }
.hr-mini-b i.lv { background: var(--series-4); }
.hr-mini-c span { font-size: .72rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.hr-mini-c small { font-size: .62rem; color: var(--muted); white-space: nowrap; }
.hr-dsec .hr-legend { margin: 10px 0 6px; font-size: .7rem; }
.hr-owner { background: var(--surface-2); border: 1px dashed var(--line-strong); border-radius: 12px; padding: 14px 16px; margin-top: 14px; }
.hr-lock { font-size: .64rem; letter-spacing: .02em; text-transform: none; font-weight: 600; color: var(--ink-2); background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 1px 8px; }
.hr-paynow { display: flex; flex-direction: column; gap: 2px; margin-bottom: 8px; }
.hr-paynow b { font-size: 1.15rem; }
.hr-payform { display: flex; flex-direction: column; gap: 10px; margin-top: 10px; }
.hr-payform label { display: flex; flex-direction: column; gap: 4px; font-size: .7rem; font-weight: 600; color: var(--muted); }
.hr-payform input, .hr-payform select { background: var(--surface); border: 1px solid var(--line-strong); border-radius: 8px; padding: 8px 10px; font: inherit; font-size: .84rem; color: var(--ink); min-width: 0; }
.hr-payform input:focus, .hr-payform select:focus { outline: none; border-color: var(--teal); box-shadow: 0 0 0 3px color-mix(in srgb, var(--teal) 18%, transparent); }
.hr-payrow { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; }
.hr-payrow label { flex: 1 1 120px; }
.hr-payrow label[hidden] { display: none; }

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
  .hr-row2, .hr-row2.wide, .hr-fix { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 700px) {
  .hr { gap: 12px; }
  .hr-titles h1 { font-size: 1.3rem; }
  .hr-head { align-items: flex-start; }
  .hr-titles p { font-size: .8rem; margin-top: 6px; }
  .hr-head-r { width: 100%; justify-content: space-between; }
  /* compact tiles: two across, short labels, sub-lines clamped so a row stays one height */
  .hr-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .hr-kpi { padding: 10px 11px 9px; border-radius: 10px; }
  .hr-kpi .k { font-size: .56rem; letter-spacing: .08em; }
  .hr-kpi .v { font-size: 1.2rem; margin: 2px 0 1px; }
  .hr-kpis > .hr-kpi:last-child:nth-child(odd) { grid-column: 1 / -1; }
  .hr-kpi .s { font-size: .66rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  .hr-filter { padding: 10px; gap: 8px; }
  .hr-toolbar { gap: 8px; }
  .hr-selpair { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); width: 100%; gap: 8px; }
  .hr-selpair .hr-sel > span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .hr-selpair .hr-sel select { width: 100%; max-width: none; }
  .hr-flagrow { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 0 -10px; padding: 0 10px 2px; }
  .hr-flagrow::-webkit-scrollbar { display: none; }
  .hr-flagrow > * { flex: none; }
  .hr-card { padding: 14px; }
  .hr-card.hr-flush > .hr-card-h { padding: 14px 14px 0; }
  .hr-search { max-width: none; flex-basis: 100%; }
  .hr-search input, .hr-sel select, .hr-payform input, .hr-payform select { font-size: 16px; }
  .hr-sp { display: none; }
  .hr-pgrid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 8px; }
  .hr-pcard { padding: 12px; }
  .hr-pcard .hr-av { --sz: 46px !important; }
  .hr-pcard-m { flex-direction: column; gap: 1px; }
  .hr-ogrid { grid-template-columns: minmax(0, 1fr); }
  .hr-tl-m { grid-template-columns: minmax(0, 1fr); gap: 6px; }
  .hr-tl-h { position: static; flex-direction: row; gap: 8px; align-items: baseline; }
  .hr-tl-items { grid-template-columns: minmax(0, 1fr); }
  .hr-comp-grid { grid-template-columns: minmax(0, 1fr); }
  .hr-cols { height: 160px; gap: 6px; }
  .hr-col small { font-size: .6rem; }
  .hr-exc { max-height: none; overflow: visible; }
  .hr-heat { border-spacing: 2px; font-size: .72rem; }
  .hr-heat tbody th { min-width: 108px; max-width: 120px; padding-right: 6px; }
  .hr-heat tbody th small, .hr-heat tbody th .hr-av { display: none; }
  .hr-heat tbody th b { font-size: .76rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
  .hr-heat td { min-width: 36px; height: 30px; }
  .hr-heat td.n { min-width: 64px; }
  .hr-ol-row { padding-left: calc(var(--d) * 16px); }
  .hr-ol-row::before { left: calc(var(--d) * 16px - 9px); }
  .hr-ol-main > span:not(.hr-av):not(.pill) { display: none; }
  .hr-kvs { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px 12px; }
  .hr-kv dd { font-size: .8rem; }
  .hr-shotctl .hr-muted { display: none; }
  .hr-dhead { padding: 18px 16px 12px; }
  .hr-dbody { padding: 4px 16px 24px; }
  .hr-bar { grid-template-columns: minmax(0, 1fr) auto; row-gap: 3px; }
  .hr-bar .t { grid-column: 1 / -1; grid-row: 2; }
  .hr-weekpick > span { min-width: 110px; }
}
.hr-none { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.hr-none .hr-plink { color: var(--ink-2); font-weight: 500; }
.hr-addbox { margin-top: 12px; border-top: 1px dashed var(--line); padding-top: 10px; }
.hr-addbox summary { cursor: pointer; font-size: .78rem; font-weight: 600; color: var(--accent); list-style: none; }
.hr-addbox summary::-webkit-details-marker { display: none; }
.hr-payform .hr-seg { align-self: flex-start; }
.hr-payform optgroup { font-weight: 600; }
.hr-payform button[disabled] { opacity: .45; cursor: not-allowed; }

/* ---------- org chart: tree (hrOrgTree) ---------- */
.hr-tree { padding: 0; overflow: hidden; display: flex; flex-direction: column; }
.hr-tree-ctl { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.hr-tree-zoom { display: inline-flex; align-items: center; gap: 4px; }
.hr-tree-zoom .ghost { min-width: 32px; }
.hr-tree-zl { font-size: .72rem; font-weight: 700; color: var(--muted); min-width: 42px; text-align: center; font-variant-numeric: tabular-nums; }
.hr-tree-own { display: inline-flex; gap: 14px; align-items: center; }
.hr-chk { display: inline-flex; gap: 6px; align-items: center; font-size: .76rem; font-weight: 600; color: var(--ink-2); cursor: pointer; }
.hr-tree-vp { position: relative; height: clamp(440px, 70vh, 860px); overflow: hidden; cursor: grab; touch-action: none; user-select: none;
  background: radial-gradient(circle at 1px 1px, var(--line) 1px, transparent 0) 0 0 / 22px 22px, var(--surface-2); }
.hr-tree-vp.grabbing { cursor: grabbing; }
.hr-tree-stage { position: absolute; left: 0; top: 0; transform-origin: 0 0; }
.hr-tree-lines { position: absolute; left: 0; top: 0; overflow: visible; pointer-events: none; }
.hr-tree-lines path { fill: none; stroke: var(--line-strong); stroke-width: 1.6; }
.hr-tnode { position: absolute; transform-origin: 0 0; display: flex; gap: 10px; align-items: flex-start; text-align: left; font: inherit; color: inherit;
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); padding: 11px 12px; cursor: pointer; overflow: hidden; }
.hr-tnode::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 3px; background: var(--gradient); }
.hr-tnode:hover { border-color: var(--teal); box-shadow: var(--shadow-hover); }
.hr-tnode.vacant { background: transparent; border-style: dashed; box-shadow: none; }
.hr-tnode.vacant::before, .hr-tnode.left::before { display: none; }
.hr-tnode.left { opacity: .7; }
.hr-tnode.hl { border-color: var(--teal); box-shadow: 0 0 0 3px color-mix(in srgb, var(--teal) 40%, transparent); }
.hr-tnode .hr-av { flex: none; }
.hr-tnode-t { display: flex; flex-direction: column; min-width: 0; gap: 1px; line-height: 1.25; }
.hr-tnode-t b { font-size: .84rem; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hr-tnode.vacant .hr-tnode-t b { font-style: italic; color: var(--muted); font-weight: 600; }
.hr-tnode-t > span:not(.pill) { font-size: .72rem; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hr-tnode-t em { font-style: normal; font-size: .76rem; font-weight: 700; color: var(--accent); font-variant-numeric: tabular-nums; }
.hr-tnode-t em.com { color: var(--muted); font-weight: 600; }
.hr-tnode-t small { font-size: .66rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hr-tnode-f { margin-top: 2px; font-weight: 600; }
.hr-tree-leg { margin: 0; padding: 8px 14px 10px; font-size: .72rem; color: var(--muted); border-top: 1px solid var(--line); }
/* full screen: the chart fills the window (the drawer, z 40, still opens above it) */
.hr-tree.max { position: fixed; inset: 0; z-index: 38; border-radius: 0; border: 0; margin: 0; }
.hr-tree.max .hr-tree-vp { height: auto; flex: 1; }
body.hr-noscroll { overflow: hidden; }
@media (max-width: 700px) {
  .hr-tree-ctl { padding: 8px 10px; gap: 8px; }
  .hr-tree-vp { height: 62vh; }
  .hr-tree-leg { display: none; }
  .hr-tree.max .hr-tree-leg { display: none; }
}

/* ---------- payroll over time (Workforce, owner only) ---------- */
.hr-owner-card { border-style: dashed; border-color: var(--line-strong); }
.hr-paykpis { display: flex; gap: 28px; flex-wrap: wrap; margin: 2px 0 10px; }
.hr-paykpis > div { display: flex; flex-direction: column; gap: 1px; }
.hr-paykpis small { font-size: .62rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.hr-paykpis b { font-size: 1.35rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.hr-paykpis span { font-size: .72rem; color: var(--muted); }
.hr-paych { margin-top: 14px; border-top: 1px solid var(--line); padding-top: 12px; display: flex; flex-direction: column; gap: 10px; }
.hr-paych-h { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.hr-paych-h b { font-size: .92rem; }
.hr-paych-h > span { font-size: .78rem; color: var(--muted); }
.hr-paych-nav { margin-left: auto; display: inline-flex; gap: 4px; }
.hr-teamdot { width: 10px; height: 10px; border-radius: 3px; flex: none; display: inline-block; }
@media (max-width: 700px) {
  .hr-paykpis { gap: 16px; }
  .hr-paykpis b { font-size: 1.1rem; }
}
/* joined/left: annual-pay effect (owner only) */
.hr-tl-r { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; }
.hr-tl-d { font-size: .74rem; font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; white-space: nowrap; }
.hr-tl-h .hr-tl-pay { color: var(--ink-2); font-weight: 700; }
/* payroll team legend: a summary per team that also filters the chart */
.hr-payteams { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 8px; margin-top: 10px; }
.hr-payteam { display: grid; grid-template-columns: auto 1fr; column-gap: 8px; row-gap: 1px; align-items: center; text-align: left; font: inherit; color: inherit;
  background: var(--surface); border: 1px solid var(--line); border-radius: 9px; padding: 8px 10px; cursor: pointer; }
.hr-payteam:hover { border-color: var(--teal); }
.hr-payteam[aria-pressed="true"] { border-color: var(--teal); box-shadow: 0 0 0 2px color-mix(in srgb, var(--teal) 35%, transparent); }
.hr-payteam i { width: 10px; height: 10px; border-radius: 3px; grid-row: 1; }
.hr-payteam .n { font-size: .74rem; font-weight: 600; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hr-payteam b { grid-column: 2; font-size: 1rem; font-variant-numeric: tabular-nums; }
.hr-payteam small { grid-column: 2; font-size: .68rem; color: var(--muted); }
@media (max-width: 700px) { .hr-payteams { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
