/* Data table, bulk bar, worklist rows, activity feed ---------------------- */

.pw-table { font-size: var(--text-md); }
.pw-table th {
  padding: 14px var(--space-3);
  text-align: left;
  font-size: var(--text-xs); font-weight: 600;
  letter-spacing: .05em; text-transform: uppercase;
  color: var(--ink-3);
  white-space: nowrap;
}
.pw-table td { padding: var(--space-3); border-top: 1px solid var(--line); vertical-align: middle; }
.pw-table th:first-child, .pw-table td:first-child { padding-left: var(--space-5); }
.pw-table th:last-child, .pw-table td:last-child { padding-right: var(--space-5); }
.pw-table tbody tr { transition: background var(--dur-fast) var(--ease); }
.pw-table tbody tr:hover { background: var(--surface-2); }
.pw-table tbody tr.is-selected { background: var(--brand-soft); }
.pw-table__check { width: 52px; }
.pw-table__empty td { padding: var(--space-8); text-align: center; color: var(--ink-3); }

.pw-checkbox { width: 18px; height: 18px; margin: 0; accent-color: var(--brand); cursor: pointer; }

/* Person cell */
.pw-person { display: flex; align-items: center; gap: var(--space-3); min-width: 0; }
.pw-person__text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.pw-person__name { display: flex; align-items: center; gap: var(--space-2); font-weight: 600; color: var(--ink); }
.pw-person__name a { color: inherit; }
.pw-person__sub { font-size: var(--text-sm); color: var(--ink-3); }

/* Inline progress (data captured) */
.pw-meter { display: flex; align-items: center; gap: 10px; }
.pw-meter__track { width: 84px; height: 6px; border-radius: var(--radius-pill); background: var(--surface-2); overflow: hidden; }
.pw-meter__fill { display: block; height: 100%; border-radius: inherit; background: var(--brand); }
.pw-meter__label { font-family: var(--font-mono); font-size: var(--text-xs); color: var(--ink-2); }

.pw-progress { height: 8px; border-radius: var(--radius-pill); background: var(--surface-2); overflow: hidden; }
.pw-progress--thin { height: 6px; }
.pw-progress__fill { display: block; height: 100%; border-radius: inherit; background: var(--brand); }

.pw-stack-bar { display: flex; height: 8px; gap: 2px; border-radius: var(--radius-pill); overflow: hidden; }
.pw-stack-bar > span { background: var(--chart-1); }
.pw-stack-bar > span:nth-child(2) { background: var(--chart-2); }
.pw-stack-bar > span:nth-child(3) { background: var(--chart-3); }
.pw-stack-bar > span:nth-child(n+4) { background: var(--chart-4); }

/* ---- Bulk action bar --------------------------------------------- */
.pw-bulkbar {
  display: flex; align-items: center; gap: var(--space-3);
  padding: 10px var(--space-4) 10px var(--space-5);
  background: var(--brand-soft); color: var(--brand-text);
  border-bottom: 1px solid var(--line);
}
.pw-bulkbar__count { font-weight: 700; }
.pw-bulkbar__divider { width: 1px; height: 20px; background: currentColor; opacity: .3; }

/* ---- Worklist (needs attention) ---------------------------------- */
.pw-worklist { margin: 0; padding: 0; list-style: none; }
.pw-worklist__item {
  display: flex; align-items: center; gap: var(--space-4);
  padding: var(--space-4) var(--space-6);
  border-top: 1px solid var(--line);
  transition: background var(--dur-fast) var(--ease);
}
.pw-worklist__item:hover { background: var(--surface-2); }
.pw-worklist__body { flex-grow: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.pw-worklist__line { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.pw-worklist__name { font-weight: 600; font-size: var(--text-base); color: var(--ink); }
.pw-worklist__id { font-family: var(--font-mono); font-size: var(--text-xs); color: var(--ink-3); }
.pw-worklist__detail { color: var(--ink-2); }
.pw-worklist__when { width: 72px; text-align: right; font-size: var(--text-sm); color: var(--ink-3); white-space: nowrap; }
.pw-worklist__action { width: 132px; }
.pw-worklist__empty { padding: var(--space-8) var(--space-6); border-top: 1px solid var(--line); color: var(--ink-3); }
.pw-worklist__item.is-done { opacity: .5; }
.pw-worklist__item.is-done .pw-worklist__name { text-decoration: line-through; }

/* ---- Activity / timeline feed ------------------------------------ */
.pw-feed { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 14px; }
.pw-feed__item { display: flex; gap: var(--space-3); }
.pw-feed__item .pw-dot { margin-top: 7px; }
.pw-feed__text { display: flex; flex-direction: column; gap: 2px; }
.pw-feed__when { font-size: var(--text-xs); color: var(--ink-3); }

/* ---- Simple bar rows (cohorts) ----------------------------------- */
.pw-bar-row { display: flex; flex-direction: column; gap: var(--space-2); color: inherit; }
.pw-bar-row:hover { text-decoration: none; color: inherit; }
.pw-bar-row:hover .pw-bar-row__name { text-decoration: underline; }
.pw-bar-row__top { display: flex; justify-content: space-between; gap: var(--space-3); }
.pw-bar-row__name { font-weight: 600; }
.pw-bar-row__meta { font-size: var(--text-xs); color: var(--ink-3); }

/* ---- Key/value rows ---------------------------------------------- */
.pw-rows { display: flex; flex-direction: column; }
.pw-rows__item { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-3) 0; border-top: 1px solid var(--line); }

.pw-dl { margin: 0; display: grid; grid-template-columns: 96px minmax(0, 1fr); row-gap: 10px; column-gap: var(--space-3); }
.pw-dl dt { color: var(--ink-3); }
.pw-dl dd { margin: 0; font-weight: 600; }

/* ---- Sortable headers -------------------------------------------- */
.pw-sort {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 0; border: 0; background: transparent;
  font: inherit; letter-spacing: inherit; text-transform: inherit; color: inherit;
}
.pw-sort:hover { color: var(--ink); }
.pw-sort::after { content: ''; width: 0; height: 0; border: 4px solid transparent; opacity: .35; border-top-color: currentColor; margin-top: 4px; }
th[aria-sort] .pw-sort { color: var(--ink); }
th[aria-sort] .pw-sort::after { opacity: 1; }
th[aria-sort="ascending"] .pw-sort::after { border-top-color: transparent; border-bottom-color: currentColor; margin-top: -4px; }

.pw-row-actions { display: inline-flex; gap: var(--space-2); justify-content: flex-end; }

/* Multi-column sort rank badge */
.pw-sort__rank {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 16px; height: 16px; padding: 0 4px;
  border-radius: var(--radius-pill);
  background: var(--brand); color: var(--brand-ink);
  font: 700 10px/1 var(--font-body); letter-spacing: 0;
}
.pw-sort-summary { display: inline-flex; align-items: center; gap: var(--space-2); }
.pw-footer-meta { display: inline-flex; align-items: center; gap: var(--space-5); flex-wrap: wrap; }
.pw-link-btn { border: 0; background: none; padding: 0; color: var(--brand-text); font: 600 var(--text-sm)/1 var(--font-body); cursor: pointer; }
.pw-link-btn:hover { text-decoration: underline; }

/* Empty states carry the PeopleWith helix (secondary brand icon) */
.pw-table__empty td::before,
.pw-worklist__empty::before {
  content: '';
  display: block;
  width: 72px; height: 52px;
  margin: 0 auto var(--space-3);
  background: url('../../img/brand/peoplewith-helix.svg') center / contain no-repeat;
  opacity: .55;
}
.pw-worklist__empty { text-align: center; }
[data-theme="dark"] .pw-table__empty td::before,
[data-theme="dark"] .pw-worklist__empty::before { background-image: url('../../img/brand/peoplewith-helix-inverse.svg'); }
