/* The HR workspace: a desktop shell (sidebar, top bar with search, page) drawn from the MedPanel v2 HR and benefits wireframes.
   It reuses the tokens and the card, chip, bar and field styles from styles.css and patient.css. */
.hr { position:fixed; inset:0; display:grid; grid-template-columns:240px minmax(0,1fr); background:var(--bg); color:var(--ink); font-family:var(--font); font-size:14px; line-height:1.45; }
.hr[hidden] { display:none; }
.hr :focus-visible { outline:2px solid var(--brand); outline-offset:2px; }
.hr button { font:inherit; color:inherit; cursor:pointer; }
.hr-side { background:var(--surface); border-inline-end:1px solid var(--line); padding:16px 12px; display:flex; flex-direction:column; gap:12px; overflow-y:auto; }
.hr-brand { display:flex; align-items:center; gap:10px; font-size:18px; font-weight:700; padding:4px 8px; }
.hr-org { min-height:42px; border:1px solid var(--line); border-radius:10px; background:var(--surface); color:var(--ink); font:inherit; padding:0 8px; }
.hr-org[hidden] { display:none; }
.hr-nav { display:flex; flex-direction:column; gap:2px; flex:1; }
.hr-nav-group { margin:14px 8px 4px; font-size:11px; font-weight:700; letter-spacing:.06em; text-transform:uppercase; color:var(--muted); }
.hr-nav-item { display:flex; align-items:center; gap:10px; min-height:40px; padding:0 10px; border:0; border-radius:9px; background:none; text-align:start; }
.hr-nav-item svg { width:18px; height:18px; flex:none; }
.hr-nav-item:hover { background:var(--sunken); }
.hr-nav-item.is-active { background:var(--brand-soft); color:var(--brand-ink); font-weight:650; }
.hr-signout { margin-top:auto; color:var(--muted); }
.hr-body { display:flex; flex-direction:column; min-width:0; min-height:0; }
.hr-top { display:flex; align-items:center; gap:12px; padding:10px 24px; background:var(--surface); border-bottom:1px solid var(--line); }
.hr-search { flex:1; max-width:560px; }
.hr-search input, .hr-filters input, .hr-filters select, .hr-form input, .hr-form select, .hr-csv { font:inherit; min-height:42px; padding:8px 12px; border:1px solid var(--line-strong); border-radius:10px; background:var(--surface); color:var(--ink); box-sizing:border-box; }
.hr-search input { width:100%; }
.hr-main { flex:1; overflow-y:auto; padding:24px 28px 40px; display:flex; flex-direction:column; gap:16px; outline:none; }
.hr-main > * { flex:none; max-width:1180px; width:100%; box-sizing:border-box; }
.hr-head { display:flex; align-items:flex-start; justify-content:space-between; gap:16px; flex-wrap:wrap; }
.hr-head h1 { margin:0 0 2px; font-size:24px; letter-spacing:-.01em; display:flex; align-items:center; gap:10px; flex-wrap:wrap; }
.hr-head p { margin:0; }
.hr-actions { display:flex; gap:8px; flex-wrap:wrap; }
.hr-actions .p-primary, .hr-actions .p-secondary { min-height:40px; gap:8px; }
.hr-actions svg { width:16px; height:16px; }
.hr-crumbs { display:flex; gap:8px; align-items:center; color:var(--muted); font-size:13px; }
.hr-crumbs .p-link { padding:0; }
.hr-stats { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:14px; }
.hr-stats.is-three { grid-template-columns:repeat(3,minmax(0,1fr)); }
.hr-stat { gap:4px; position:relative; }
.hr-stat > svg { position:absolute; top:14px; inset-inline-end:14px; width:18px; height:18px; color:var(--muted); }
.hr-grid { display:grid; grid-template-columns:minmax(0,2fr) minmax(0,1fr); gap:16px; align-items:start; }
.hr-grid.is-form { grid-template-columns:minmax(0,2fr) minmax(260px,1fr); }
.hr-col { display:flex; flex-direction:column; gap:16px; min-width:0; }
.hr-bar-row { display:grid; grid-template-columns:120px 1fr 90px; gap:12px; align-items:center; }
.hr-bar-row b { text-align:end; font-variant-numeric:tabular-nums; }
.hr-chart { width:100%; height:auto; } .hr-axis { fill:var(--muted); font-size:11px; }
.hr-filters { display:flex; gap:10px; flex-wrap:wrap; } .hr-filters input { flex:1; min-width:240px; }
.hr-selection { display:flex; gap:12px; align-items:center; padding:10px 14px; border-radius:12px; background:var(--brand-soft); } .hr-selection[hidden] { display:none; }
.p-count { margin-inline-start:6px; font-size:11px; color:var(--muted); background:var(--sunken); border-radius:999px; padding:0 7px; }
.hr-table-wrap { background:var(--surface); border:1px solid var(--line); border-radius:12px; overflow:auto; }
.hr-table { width:100%; border-collapse:collapse; }
.hr-table th { text-align:start; font-size:12px; font-weight:600; color:var(--muted); padding:10px 14px; background:var(--surface-2); border-bottom:1px solid var(--line); white-space:nowrap; }
.hr-table td { padding:11px 14px; border-bottom:1px solid var(--line); vertical-align:middle; }
.hr-table tr:last-child td { border-bottom:0; }
.hr-table tr.is-clickable { cursor:pointer; } .hr-table tr.is-clickable:hover { background:var(--surface-2); }
.hr-person { display:flex; align-items:center; gap:10px; }
.hr-usage { display:flex; flex-direction:column; gap:4px; min-width:110px; }
.hr-pager { display:flex; align-items:center; justify-content:flex-end; gap:12px; }
.hr-pager span { margin-inline-end:auto; }
.hr-tabs { display:flex; gap:4px; border-bottom:1px solid var(--line); }
.hr-tab { border:0; background:none; padding:10px 14px; color:var(--muted); font-weight:600; border-bottom:2px solid transparent; margin-bottom:-1px; }
.hr-tab.is-active { color:var(--brand-ink); border-bottom-color:var(--brand); }
.hr-plans { display:grid; grid-template-columns:repeat(auto-fill,minmax(260px,1fr)); gap:16px; }
.hr-plan h2 { margin:0; }
.hr-steps { display:flex; gap:16px; list-style:none; margin:0 0 8px; padding:0; flex-wrap:wrap; }
.hr-steps li { display:flex; align-items:center; gap:8px; color:var(--muted); font-weight:600; }
.hr-step-dot { width:24px; height:24px; border-radius:50%; border:1.5px solid var(--line-strong); display:inline-flex; align-items:center; justify-content:center; font-size:12px; }
.hr-steps .is-current { color:var(--ink); } .hr-steps .is-current .hr-step-dot { background:var(--brand); border-color:var(--brand); color:var(--on-brand); }
.hr-steps .is-done .hr-step-dot { background:var(--brand-soft); border-color:var(--brand); color:var(--brand-ink); }
.hr-two { display:grid; grid-template-columns:1fr 1fr; gap:14px; }
.hr-form-actions { display:flex; justify-content:flex-end; gap:10px; margin-top:8px; }
.hr-problems[hidden] { display:none; }
.p-field input, .p-field select, .p-field textarea { font:inherit; min-height:42px; padding:8px 12px; border:1px solid var(--line-strong); border-radius:10px; background:var(--surface); color:var(--ink); box-sizing:border-box; width:100%; }
.p-field.has-error input, .p-field.has-error select { border-color:var(--bad-ink); }
.hr-csv { width:100%; font-family:var(--mono); font-size:13px; resize:vertical; }
.hr-chips { display:flex; gap:8px; flex-wrap:wrap; }
.hr-chip { display:inline-flex; align-items:center; gap:6px; padding:4px 6px 4px 12px; border-radius:999px; background:var(--brand-soft); color:var(--brand-ink); font-weight:600; }
.hr-chip button { border:0; background:none; width:22px; height:22px; border-radius:50%; }
.hr-check { display:flex; align-items:center; gap:10px; font-weight:600; }
.hr-options { display:grid; grid-template-columns:repeat(auto-fit,minmax(220px,1fr)); gap:12px; }
.hr-option { display:flex; flex-direction:column; gap:4px; padding:12px 14px; border:1px solid var(--line); border-radius:12px; }
.hr-form { max-width:760px; }
.hr-drawer { position:fixed; inset-block:0; inset-inline-start:auto; inset-inline-end:0; margin:0; margin-inline-start:auto; height:100vh; max-height:none; width:min(440px,100vw); border:0; padding:20px; background:var(--surface); color:var(--ink); box-shadow:var(--shadow-lg); overflow-y:auto; }
.hr-drawer::backdrop { background:var(--scrim); }
.hr-drawer-head { display:flex; justify-content:space-between; gap:12px; margin-bottom:16px; } .hr-drawer-head h2 { margin:0; font-size:18px; }
.hr .p-bar-track { min-width:60px; }
@media (max-width:899px) {
  .hr { grid-template-columns:1fr; grid-template-rows:auto minmax(0,1fr); }
  .hr-side { flex-direction:row; align-items:center; gap:8px; overflow-x:auto; padding:8px 12px; border-inline-end:0; border-bottom:1px solid var(--line); }
  .hr-brand { display:none; } .hr-nav { flex-direction:row; align-items:center; flex:none; } .hr-nav-group { display:none; } .hr-nav-item { white-space:nowrap; flex:none; } .hr-signout { margin-top:0; }
  .hr-top { padding:8px 12px; } .hr-main { padding:16px 14px 32px; }
  .hr-stats, .hr-stats.is-three { grid-template-columns:1fr 1fr; } .hr-grid, .hr-grid.is-form, .hr-two { grid-template-columns:1fr; }
  .hr-bar-row { grid-template-columns:90px 1fr 70px; }
}

.hr .p-primary { background:var(--brand); color:var(--on-brand); border-color:var(--brand); }
.hr .p-secondary { background:var(--surface); color:var(--ink); border-color:var(--line-strong); }
.hr .p-primary:disabled, .hr .p-secondary:disabled { opacity:.55; cursor:not-allowed; }
.hr .p-link { border:0; background:none; color:var(--brand-ink); font-weight:600; padding:4px; text-decoration:underline; }
.hr .p-inline-actions { display:flex; gap:12px; align-items:center; }
.hr .hr-bar-row .p-bar-fill, .hr .hr-usage .p-bar-fill.is-high { background:var(--brand); }
.hr .hr-usage .p-bar-fill.is-high { background:var(--bad-ink); }
.hr-filters select { width:auto; flex:0 0 auto; min-width:170px; }
.hr-orgcard { display:flex; flex-direction:column; gap:2px; padding:10px 12px; border:1px solid var(--line); border-radius:12px; }
.hr-orgcard strong { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; } .hr-orgcard span { color:var(--muted); font-size:12px; }
.hr-chip button { color:inherit; }

.hr-card-head { display:flex; align-items:center; justify-content:space-between; gap:12px; } .hr-card-head h2 { margin:0; }
.hr-checklist { list-style:none; margin:0 0 8px; padding:0; display:flex; flex-direction:column; gap:12px; }
.hr-checklist li { display:flex; gap:12px; align-items:flex-start; } .hr-checklist .hr-step-dot { flex:none; margin-top:2px; }
.hr-checklist .is-done .hr-step-dot { background:var(--brand); border-color:var(--brand); color:var(--on-brand); }
.p-ok { color:var(--ok-ink); margin:0; }
.hr-versions { list-style:none; margin:0; padding:0; display:flex; flex-direction:column; gap:16px; }
.hr-versions li { padding-bottom:14px; border-bottom:1px solid var(--line); } .hr-versions li:last-child { border-bottom:0; }
.hr-version-head { display:flex; align-items:center; gap:10px; flex-wrap:wrap; }
.hr-version-head span:last-child { margin-inline-start:auto; }
.hr-changes { margin:6px 0 0; padding-inline-start:18px; color:var(--ink-2); }
.hr-identity { display:flex; flex-direction:column; gap:10px; }
.hr-nav-item { justify-content:flex-start; }
.hr-table input[type=checkbox] { width:18px; height:18px; min-height:0; padding:0; accent-color:var(--brand); }
.hr-actions .p-primary[disabled] { cursor:not-allowed; }
.hr-rx { display:flex; flex-direction:column; gap:10px; padding:12px 0; border-top:1px solid var(--line); }
.hr-rx-items { display:flex; flex-direction:column; gap:10px; }
.hr-rx-row { grid-template-columns:1fr; border:1px solid var(--line); border-radius:12px; padding:10px; }
.hr-letter { max-width:720px; gap:8px; padding:28px; background:#fff; }
.hr .hr-form textarea, .hr-drawer textarea { width:100%; box-sizing:border-box; font:inherit; padding:8px 12px; border:1px solid var(--line-strong); border-radius:10px; background:var(--surface); color:var(--ink); }
@media print { .hr-side, .hr-top, .hr-head .hr-actions, .hr-crumbs { display:none !important; } .hr { position:static; display:block; } .hr-main { overflow:visible; } }
