{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "admin-dashboard",
  "type": "registry:component",
  "title": "Admin Dashboard",
  "description": "A users admin page with search, role and status filters, a sortable table, row selection with a bulk action bar, pagination and a slide-in detail panel.",
  "author": "Hyperblur <hello@hyperblur.dev>",
  "dependencies": [],
  "registryDependencies": [],
  "categories": [
    "dashboards",
    "dashboard",
    "admin",
    "users",
    "table",
    "bulk actions",
    "detail panel"
  ],
  "docs": "https://hyperblur.dev/effects/admin-dashboard",
  "files": [
    {
      "path": "registry/hyperblur/admin-dashboard.tsx",
      "type": "registry:component",
      "target": "components/hyperblur/admin-dashboard.tsx",
      "content": "\"use client\";\n\nimport * as React from \"react\";\n\nexport type AdminRole = \"Admin\" | \"Editor\" | \"Viewer\" | \"Billing\";\nexport type AdminStatus = \"Active\" | \"Pending\" | \"Suspended\";\n\nexport interface AdminUser {\n  id: string;\n  name: string;\n  email: string;\n  role: AdminRole;\n  status: AdminStatus;\n  lastActive: number;\n  team: string;\n  location: string;\n  joined: string;\n  twoFactor: boolean;\n}\n\nexport interface AdminDashboardProps extends React.HTMLAttributes<HTMLDivElement> {\n  accent?: string;\n  brand?: string;\n  user?: string;\n  workspace?: string;\n  users?: AdminUser[];\n  pageSize?: number;\n  defaultSelected?: string[];\n  onSelectionChange?: (ids: string[]) => void;\n}\n\nconst css = `\n.hb-dad {\n  --a: #2f7bff;\n  container: hb-dad / inline-size;\n  box-sizing: border-box;\n  width: 100%;\n  border: 1px solid #262626;\n  border-radius: 16px;\n  background: #0a0a0a;\n  color: #ededed;\n  font-family: inherit;\n  font-size: 13px;\n  line-height: 1.4;\n  overflow: hidden;\n  position: relative;\n  -webkit-font-smoothing: antialiased;\n}\n.hb-dad *, .hb-dad *::before, .hb-dad *::after { box-sizing: border-box; }\n.hb-dad button, .hb-dad input, .hb-dad select { font: inherit; color: inherit; }\n.hb-dad button:focus-visible, .hb-dad input:focus-visible, .hb-dad select:focus-visible, .hb-dad [tabindex]:focus-visible {\n  outline: 2px solid var(--a);\n  outline-offset: 2px;\n}\n.hb-dad-app { display: grid; grid-template-columns: 220px minmax(0, 1fr); min-height: 640px; }\n.hb-dad-side {\n  display: flex;\n  flex-direction: column;\n  gap: 24px;\n  min-width: 0;\n  padding: 20px 12px 16px;\n  border-right: 1px solid #1f1f1f;\n  background: #0d0d0d;\n}\n.hb-dad-brand { display: flex; align-items: center; gap: 10px; padding: 0 8px; font-size: 14px; font-weight: 600; letter-spacing: -.01em; }\n.hb-dad-mark {\n  display: grid;\n  place-items: center;\n  flex: none;\n  width: 24px;\n  height: 24px;\n  border-radius: 7px;\n  background: linear-gradient(135deg, var(--a), color-mix(in srgb, var(--a) 45%, #ffffff));\n  color: #ffffff;\n}\n.hb-dad-nav { display: flex; flex-direction: column; gap: 2px; margin: 0; padding: 0; list-style: none; }\n.hb-dad-nav-label { padding: 12px 8px 6px; color: #6b6b6b; font-size: 11px; font-weight: 500; letter-spacing: .06em; text-transform: uppercase; }\n.hb-dad-link {\n  display: flex;\n  align-items: center;\n  gap: 10px;\n  width: 100%;\n  height: 34px;\n  padding: 0 8px;\n  border: 0;\n  border-radius: 8px;\n  background: transparent;\n  color: #a1a1a1;\n  font-size: 13px;\n  text-align: left;\n  cursor: pointer;\n  transition: background .15s ease, color .15s ease;\n}\n.hb-dad-link:hover { background: #161616; color: #ededed; }\n.hb-dad-link[aria-current=\"page\"] { background: #1b1b1b; color: #ffffff; }\n.hb-dad-link[aria-current=\"page\"] .hb-dad-ico { color: var(--a); }\n.hb-dad-link-n {\n  margin-left: auto;\n  padding: 1px 7px;\n  border-radius: 999px;\n  background: #1f1f1f;\n  color: #a1a1a1;\n  font-size: 11px;\n  font-variant-numeric: tabular-nums;\n}\n.hb-dad-side-foot { margin-top: auto; }\n.hb-dad-main { display: flex; flex-direction: column; min-width: 0; }\n.hb-dad-top { display: flex; align-items: center; gap: 12px; height: 60px; padding: 0 24px; border-bottom: 1px solid #1f1f1f; }\n.hb-dad-crumb { min-width: 0; overflow: hidden; color: #8f8f8f; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }\n.hb-dad-crumb strong { color: #ededed; font-weight: 500; }\n.hb-dad-search { position: relative; width: 260px; margin-left: auto; color: #6b6b6b; }\n.hb-dad-search .hb-dad-ico { position: absolute; top: 50%; left: 10px; width: 15px; height: 15px; transform: translateY(-50%); pointer-events: none; }\n.hb-dad-search input {\n  width: 100%;\n  height: 34px;\n  padding: 0 40px 0 32px;\n  border: 1px solid #242424;\n  border-radius: 8px;\n  background: #111111;\n  color: #ededed;\n  font-size: 13px;\n  transition: border-color .15s ease, background .15s ease;\n}\n.hb-dad-search input::placeholder { color: #6b6b6b; }\n.hb-dad-search input:hover { border-color: #333333; }\n.hb-dad-search input:focus-visible { border-color: var(--a); outline-offset: 0; }\n.hb-dad-kbd {\n  position: absolute;\n  top: 50%;\n  right: 8px;\n  padding: 1px 6px;\n  border: 1px solid #2a2a2a;\n  border-radius: 5px;\n  background: #171717;\n  color: #8f8f8f;\n  font-size: 11px;\n  transform: translateY(-50%);\n  pointer-events: none;\n}\n.hb-dad-iconbtn {\n  position: relative;\n  display: grid;\n  place-items: center;\n  flex: none;\n  width: 34px;\n  height: 34px;\n  border: 1px solid #242424;\n  border-radius: 8px;\n  background: #111111;\n  color: #a1a1a1;\n  cursor: pointer;\n  transition: background .15s ease, color .15s ease, border-color .15s ease;\n}\n.hb-dad-iconbtn:hover { border-color: #333333; background: #171717; color: #ededed; }\n.hb-dad-dot { position: absolute; top: 8px; right: 9px; width: 7px; height: 7px; border: 2px solid #111111; border-radius: 50%; background: var(--a); box-sizing: content-box; margin: -2px; }\n.hb-dad-av {\n  display: grid;\n  place-items: center;\n  flex: none;\n  width: 28px;\n  height: 28px;\n  border-radius: 50%;\n  color: #ffffff;\n  font-size: 11px;\n  font-weight: 600;\n  letter-spacing: .01em;\n}\n.hb-dad-content { display: flex; flex-direction: column; gap: 20px; min-width: 0; padding: 24px; }\n.hb-dad-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; }\n.hb-dad-title { margin: 0; font-size: 22px; font-weight: 600; letter-spacing: -.02em; line-height: 1.2; }\n.hb-dad-sub { margin: 4px 0 0; color: #8f8f8f; font-size: 13px; }\n.hb-dad-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }\n.hb-dad-card {\n  min-width: 0;\n  padding: 16px;\n  border: 1px solid #232323;\n  border-radius: 12px;\n  background: #111111;\n  animation: hb-dad-rise .55s cubic-bezier(.2, .7, .2, 1) both;\n  animation-delay: calc(var(--d, 0) * 60ms);\n}\n.hb-dad-card-h { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }\n.hb-dad-card-t { margin: 0; font-size: 13px; font-weight: 600; letter-spacing: -.005em; }\n.hb-dad-card-s { margin: 2px 0 0; color: #8f8f8f; font-size: 12px; }\n.hb-dad-seg { display: inline-flex; padding: 2px; border: 1px solid #262626; border-radius: 8px; background: #0d0d0d; }\n.hb-dad-seg button {\n  height: 26px;\n  padding: 0 10px;\n  border: 0;\n  border-radius: 6px;\n  background: transparent;\n  color: #8f8f8f;\n  font-size: 12px;\n  font-weight: 500;\n  cursor: pointer;\n  transition: background .15s ease, color .15s ease;\n}\n.hb-dad-seg button:hover { color: #ededed; }\n.hb-dad-seg button[aria-pressed=\"true\"] { background: #232323; color: #ffffff; }\n.hb-dad-btn {\n  display: inline-flex;\n  align-items: center;\n  justify-content: center;\n  gap: 6px;\n  height: 32px;\n  padding: 0 12px;\n  border: 1px solid #2a2a2a;\n  border-radius: 8px;\n  background: #151515;\n  color: #ededed;\n  font-size: 12.5px;\n  font-weight: 500;\n  white-space: nowrap;\n  cursor: pointer;\n  transition: background .15s ease, border-color .15s ease, transform .15s ease;\n}\n.hb-dad-btn:hover { border-color: #3a3a3a; background: #1c1c1c; }\n.hb-dad-btn:active { transform: translateY(1px); }\n.hb-dad-btn[data-p=\"true\"] { border-color: var(--a); background: var(--a); color: #ffffff; }\n.hb-dad-btn[data-p=\"true\"]:hover { background: color-mix(in srgb, var(--a) 85%, #ffffff); }\n.hb-dad-btn .hb-dad-ico { width: 14px; height: 14px; }\n.hb-dad-ico { display: block; flex: none; width: 16px; height: 16px; }\n.hb-dad-pill {\n  display: inline-flex;\n  align-items: center;\n  gap: 3px;\n  height: 20px;\n  padding: 0 7px;\n  border-radius: 999px;\n  font-size: 11px;\n  font-weight: 600;\n  font-variant-numeric: tabular-nums;\n  white-space: nowrap;\n}\n.hb-dad-pill .hb-dad-ico { width: 11px; height: 11px; stroke-width: 2.4; }\n.hb-dad-pill[data-t=\"up\"] { background: rgba(74, 222, 128, .12); color: #4ade80; }\n.hb-dad-pill[data-t=\"down\"] { background: rgba(248, 113, 113, .12); color: #f87171; }\n.hb-dad-pill[data-t=\"flat\"] { background: #1f1f1f; color: #a1a1a1; }\n.hb-dad-spark { display: block; width: 100%; height: 36px; color: var(--a); animation: hb-dad-wipe .9s .15s cubic-bezier(.3, .7, .2, 1) both; }\n.hb-dad-spark-l { fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; }\n.hb-dad-tt {\n  position: absolute;\n  z-index: 3;\n  padding: 7px 10px;\n  border: 1px solid #2c2c2c;\n  border-radius: 8px;\n  background: rgba(22, 22, 22, .96);\n  box-shadow: 0 12px 32px -8px rgba(0, 0, 0, .7);\n  color: #ededed;\n  font-size: 12px;\n  line-height: 1.5;\n  white-space: nowrap;\n  pointer-events: none;\n}\n.hb-dad-tt b { font-weight: 600; font-variant-numeric: tabular-nums; }\n.hb-dad-tt-d { color: #8f8f8f; font-size: 11px; }\n@keyframes hb-dad-rise { from { opacity: 0; transform: translate3d(0, 8px, 0); } to { opacity: 1; transform: none; } }\n@keyframes hb-dad-wipe { from { clip-path: inset(-6px 100% -6px -6px); } to { clip-path: inset(-6px -6px -6px -6px); } }\n@keyframes hb-dad-grow { from { transform: scaleY(0); } to { transform: scaleY(1); } }\n@keyframes hb-dad-fade { from { opacity: 0; } to { opacity: 1; } }\n@keyframes hb-dad-pulse { 0% { box-shadow: 0 0 0 0 rgba(74, 222, 128, .55); } 100% { box-shadow: 0 0 0 8px rgba(74, 222, 128, 0); } }\n@keyframes hb-dad-arc { from { stroke-dasharray: 0 100; } }\n@container hb-dad (max-width: 759px) {\n  .hb-dad-app { grid-template-columns: minmax(0, 1fr); min-height: 0; }\n  .hb-dad-side { flex-direction: row; align-items: center; gap: 8px; padding: 10px 12px; border-right: 0; border-bottom: 1px solid #1f1f1f; overflow-x: auto; }\n  .hb-dad-brand { padding: 0; }\n  .hb-dad-brand span:last-child, .hb-dad-nav-label, .hb-dad-link-t, .hb-dad-link-n, .hb-dad-side-foot, .hb-dad-kbd { display: none; }\n  .hb-dad-nav { flex-direction: row; flex: 1; gap: 4px; }\n  .hb-dad-link { justify-content: center; width: 36px; padding: 0; }\n  .hb-dad-top { gap: 8px; padding: 0 16px; }\n  .hb-dad-crumb { display: none; }\n  .hb-dad-search { flex: 1; width: auto; margin-left: 0; }\n  .hb-dad-content { gap: 16px; padding: 16px; }\n  .hb-dad-title { font-size: 19px; }\n}\n@media (prefers-reduced-motion: reduce) {\n  .hb-dad *, .hb-dad *::before, .hb-dad *::after { animation: none !important; transition: none !important; }\n}\n.hb-dad-plan { padding: 12px; border: 1px solid #232323; border-radius: 10px; background: #111111; }\n.hb-dad-plan strong { display: block; font-size: 12.5px; font-weight: 500; }\n.hb-dad-plan span { display: block; margin: 2px 0 10px; color: #8f8f8f; font-size: 11.5px; }\n.hb-dad-plan-b { height: 5px; border-radius: 999px; background: #1b1b1b; overflow: hidden; }\n.hb-dad-plan-b i { display: block; width: var(--w); height: 100%; border-radius: 999px; background: var(--a); transform-origin: left; animation: hb-dad-bar .9s cubic-bezier(.3, .7, .2, 1) both; }\n.hb-dad-ucard { padding: 0; overflow: hidden; }\n.hb-dad-bar-t { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid #1d1d1d; }\n.hb-dad-find { position: relative; flex: 1 1 200px; max-width: 300px; color: #6b6b6b; }\n.hb-dad-find .hb-dad-ico { position: absolute; top: 50%; left: 10px; width: 15px; height: 15px; transform: translateY(-50%); pointer-events: none; }\n.hb-dad-find input, .hb-dad-sel select {\n  width: 100%;\n  height: 34px;\n  border: 1px solid #242424;\n  border-radius: 8px;\n  background: #0d0d0d;\n  color: #ededed;\n  font-size: 13px;\n  transition: border-color .15s ease;\n}\n.hb-dad-find input { padding: 0 12px 0 32px; }\n.hb-dad-find input::placeholder { color: #6b6b6b; }\n.hb-dad-find input:hover, .hb-dad-sel select:hover { border-color: #333333; }\n.hb-dad-find input:focus-visible, .hb-dad-sel select:focus-visible { border-color: var(--a); outline-offset: 0; }\n.hb-dad-sel { position: relative; flex: none; color: #8f8f8f; }\n.hb-dad-sel select { appearance: none; padding: 0 30px 0 12px; cursor: pointer; }\n.hb-dad-sel select option { background: #151515; color: #ededed; }\n.hb-dad-sel .hb-dad-ico { position: absolute; top: 50%; right: 10px; width: 14px; height: 14px; transform: translateY(-50%); pointer-events: none; }\n.hb-dad-fchips { display: flex; flex-wrap: wrap; gap: 6px; margin-left: auto; }\n.hb-dad-fchip {\n  display: inline-flex;\n  align-items: center;\n  gap: 6px;\n  height: 30px;\n  padding: 0 12px;\n  border: 1px solid #262626;\n  border-radius: 999px;\n  background: transparent;\n  color: #a1a1a1;\n  font-size: 12.5px;\n  cursor: pointer;\n  transition: background .15s ease, border-color .15s ease, color .15s ease;\n}\n.hb-dad-fchip span { color: #6b6b6b; font-size: 11px; font-variant-numeric: tabular-nums; }\n.hb-dad-fchip:hover { border-color: #3a3a3a; color: #ededed; }\n.hb-dad-fchip[aria-pressed=\"true\"] { border-color: color-mix(in srgb, var(--a) 55%, #262626); background: color-mix(in srgb, var(--a) 14%, transparent); color: #ffffff; }\n.hb-dad-fchip[aria-pressed=\"true\"] span { color: color-mix(in srgb, var(--a) 60%, #ffffff); }\n.hb-dad-bulk {\n  display: flex;\n  flex-wrap: wrap;\n  align-items: center;\n  gap: 10px;\n  padding: 10px 16px;\n  border-bottom: 1px solid color-mix(in srgb, var(--a) 30%, #1d1d1d);\n  background: color-mix(in srgb, var(--a) 11%, #0e0e0e);\n  animation: hb-dad-drop .28s cubic-bezier(.2, .8, .2, 1) both;\n}\n.hb-dad-bulk strong { margin-right: auto; font-size: 13px; font-weight: 500; }\n.hb-dad-bulk .hb-dad-sel select { width: auto; height: 32px; }\n.hb-dad-btn[data-d=\"true\"] { border-color: rgba(248, 113, 113, .35); color: #f87171; }\n.hb-dad-btn[data-d=\"true\"]:hover { border-color: rgba(248, 113, 113, .6); background: rgba(248, 113, 113, .1); }\n.hb-dad-tw { overflow-x: auto; }\n.hb-dad-ut { width: 100%; min-width: 580px; border-collapse: collapse; }\n.hb-dad-ut th {\n  height: 40px;\n  padding: 0 16px;\n  border-bottom: 1px solid #1d1d1d;\n  background: #0e0e0e;\n  color: #8f8f8f;\n  font-size: 11.5px;\n  font-weight: 500;\n  letter-spacing: .04em;\n  text-align: left;\n  text-transform: uppercase;\n  white-space: nowrap;\n}\n.hb-dad-th-b { display: inline-flex; align-items: center; gap: 4px; padding: 0; border: 0; background: none; font: inherit; letter-spacing: inherit; text-transform: inherit; color: inherit; cursor: pointer; transition: color .15s ease; }\n.hb-dad-th-b:hover { color: #ededed; }\n.hb-dad-th-b .hb-dad-ico { width: 12px; height: 12px; opacity: 0; }\n.hb-dad-ut th[aria-sort] .hb-dad-th-b { color: #ededed; }\n.hb-dad-ut th[aria-sort] .hb-dad-ico { opacity: 1; }\n.hb-dad-ut td { padding: 10px 16px; border-bottom: 1px solid #181818; vertical-align: middle; }\n.hb-dad-ut tbody tr { cursor: pointer; transition: background .15s ease; }\n.hb-dad-ut tbody tr:hover td { background: #151515; }\n.hb-dad-ut tbody tr[data-sel=\"true\"] td { background: color-mix(in srgb, var(--a) 8%, transparent); }\n.hb-dad-ut tbody tr[data-open=\"true\"] td { background: color-mix(in srgb, var(--a) 13%, transparent); }\n.hb-dad-ck { width: 44px; padding-right: 0 !important; }\n.hb-dad-ck input { display: block; width: 16px; height: 16px; margin: 0; accent-color: var(--a); cursor: pointer; }\n.hb-dad-ucell { display: flex; align-items: center; gap: 12px; min-width: 0; padding: 0; border: 0; background: none; text-align: left; cursor: pointer; }\n.hb-dad-ucell .hb-dad-av { width: 34px; height: 34px; }\n.hb-dad-ucell strong { display: block; font-size: 13px; font-weight: 500; white-space: nowrap; }\n.hb-dad-ucell div span { display: block; max-width: 220px; overflow: hidden; color: #6b6b6b; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }\n.hb-dad-role { display: inline-block; padding: 2px 8px; border-radius: 6px; background: color-mix(in srgb, var(--c) 14%, transparent); color: var(--c); font-size: 11.5px; font-weight: 500; }\n.hb-dad-st { display: inline-flex; align-items: center; gap: 7px; color: #cfcfcf; font-size: 12.5px; }\n.hb-dad-st i { width: 7px; height: 7px; border-radius: 50%; background: var(--c); box-shadow: 0 0 8px -1px var(--c); }\n.hb-dad-la { color: #8f8f8f; font-size: 12.5px; white-space: nowrap; }\n.hb-dad-rowbtn { display: grid; place-items: center; width: 30px; height: 30px; border: 0; border-radius: 7px; background: transparent; color: #8f8f8f; cursor: pointer; transition: background .15s ease, color .15s ease; }\n.hb-dad-rowbtn .hb-dad-ico { stroke-width: 3.4; }\n.hb-dad-rowbtn:hover { background: #1f1f1f; color: #ededed; }\n.hb-dad-empty { padding: 56px 16px; color: #8f8f8f; text-align: center; }\n.hb-dad-empty strong { display: block; margin-bottom: 4px; color: #ededed; font-size: 14px; font-weight: 500; }\n.hb-dad-pager { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; color: #8f8f8f; font-size: 12.5px; }\n.hb-dad-pgs { display: flex; align-items: center; gap: 4px; }\n.hb-dad-pg {\n  display: grid;\n  place-items: center;\n  min-width: 30px;\n  height: 30px;\n  padding: 0 8px;\n  border: 1px solid transparent;\n  border-radius: 8px;\n  background: transparent;\n  color: #a1a1a1;\n  font-size: 12.5px;\n  font-variant-numeric: tabular-nums;\n  cursor: pointer;\n  transition: background .15s ease, color .15s ease, border-color .15s ease;\n}\n.hb-dad-pg:hover:not(:disabled) { background: #181818; color: #ededed; }\n.hb-dad-pg[aria-current=\"page\"] { border-color: #2a2a2a; background: #1b1b1b; color: #ffffff; }\n.hb-dad-pg:disabled { opacity: .35; cursor: default; }\n.hb-dad-scrim { position: absolute; inset: 0; z-index: 5; background: rgba(0, 0, 0, .55); opacity: 0; pointer-events: none; transition: opacity .3s ease; }\n.hb-dad-scrim[data-open=\"true\"] { opacity: 1; pointer-events: auto; }\n.hb-dad-panel {\n  position: absolute;\n  top: 0;\n  right: 0;\n  bottom: 0;\n  z-index: 6;\n  display: flex;\n  flex-direction: column;\n  gap: 20px;\n  width: min(380px, 100%);\n  padding: 20px;\n  border-left: 1px solid #262626;\n  background: #0f0f0f;\n  box-shadow: -24px 0 48px -16px rgba(0, 0, 0, .7);\n  overflow-y: auto;\n  transform: translate3d(100%, 0, 0);\n  visibility: hidden;\n  transition: transform .38s cubic-bezier(.2, .8, .2, 1), visibility 0s linear .38s;\n}\n.hb-dad-panel[data-open=\"true\"] { transform: none; visibility: visible; transition-delay: 0s; }\n.hb-dad-pn-h { display: flex; align-items: center; justify-content: space-between; }\n.hb-dad-pn-h h3 { margin: 0; font-size: 13px; font-weight: 600; }\n.hb-dad-pn-id { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; }\n.hb-dad-pn-id .hb-dad-av { width: 64px; height: 64px; margin-bottom: 4px; font-size: 20px; }\n.hb-dad-pn-id strong { font-size: 17px; font-weight: 600; letter-spacing: -.01em; }\n.hb-dad-pn-id p { margin: 0; color: #8f8f8f; font-size: 12.5px; }\n.hb-dad-pn-tags { display: flex; justify-content: center; gap: 8px; margin-top: 6px; }\n.hb-dad-pn-act { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }\n.hb-dad-pn-act .hb-dad-btn { width: 100%; }\n.hb-dad-pn-s { margin: 0 0 10px; color: #6b6b6b; font-size: 11px; font-weight: 500; letter-spacing: .06em; text-transform: uppercase; }\n.hb-dad-kv { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 10px 16px; margin: 0; font-size: 12.5px; }\n.hb-dad-kv dt { color: #8f8f8f; }\n.hb-dad-kv dd { margin: 0; text-align: right; }\n.hb-dad-kv .hb-dad-sel { display: inline-block; width: 120px; }\n.hb-dad-kv .hb-dad-sel select { height: 28px; font-size: 12.5px; }\n.hb-dad-act { display: flex; flex-direction: column; gap: 14px; margin: 0; padding: 0; list-style: none; }\n.hb-dad-act li { position: relative; display: grid; grid-template-columns: 10px minmax(0, 1fr) auto; align-items: center; gap: 10px; font-size: 12.5px; }\n.hb-dad-act i { width: 7px; height: 7px; border-radius: 50%; background: #3a3a3a; }\n.hb-dad-act li:first-child i { background: var(--a); box-shadow: 0 0 8px -1px var(--a); }\n.hb-dad-act span { color: #6b6b6b; font-size: 12px; white-space: nowrap; }\n.hb-dad-pn-f { margin-top: auto; }\n.hb-dad-pn-f .hb-dad-btn { width: 100%; }\n@keyframes hb-dad-drop { from { opacity: 0; transform: translate3d(0, -6px, 0); } to { opacity: 1; transform: none; } }\n@keyframes hb-dad-bar { from { transform: scaleX(0); } to { transform: scaleX(1); } }\n@container hb-dad (max-width: 759px) {\n  .hb-dad-fchips { margin-left: 0; }\n  .hb-dad-find { max-width: none; }\n}\n@container hb-dad (max-width: 539px) {\n  .hb-dad-hide { display: none; }\n  .hb-dad-ut { min-width: 0; }\n  .hb-dad-ucell div span { max-width: 130px; }\n  .hb-dad-pn-act { grid-template-columns: minmax(0, 1fr); }\n}\n`;\n\nfunction hash(n: number) {\n  let x = Math.imul(n + 1, 2654435761) >>> 0;\n  x ^= x >>> 15;\n  x = Math.imul(x, 2246822519) >>> 0;\n  x ^= x >>> 13;\n  return (x >>> 0) / 4294967296;\n}\n\nfunction tone(name: string) {\n  let h = 0;\n  for (let i = 0; i < name.length; i++) h = (h * 31 + name.charCodeAt(i)) >>> 0;\n  const hue = h % 360;\n  return `linear-gradient(135deg, hsl(${hue} 62% 52%), hsl(${(hue + 48) % 360} 62% 36%))`;\n}\n\nfunction initials(name: string) {\n  return name\n    .split(\" \")\n    .map((w) => w[0])\n    .slice(0, 2)\n    .join(\"\")\n    .toUpperCase();\n}\n\nconst icons: Record<string, string[]> = {\n  grid: [\"M3 3h7v7H3zM14 3h7v7h-7zM14 14h7v7h-7zM3 14h7v7H3z\"],\n  users: [\"M17 21v-2a4 4 0 0 0-4-4H5a4 4 0 0 0-4 4v2\", \"M9 3a4 4 0 1 0 0 8 4 4 0 0 0 0-8z\", \"M23 21v-2a4 4 0 0 0-3-3.87M16 3.13a4 4 0 0 1 0 7.75\"],\n  file: [\"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z\", \"M14 2v6h6\"],\n  sliders: [\"M4 21v-7M4 10V3M12 21v-9M12 8V3M20 21v-5M20 12V3M1 14h6M9 8h6M17 16h6\"],\n  bell: [\"M18 8a6 6 0 0 0-12 0c0 7-3 9-3 9h18s-3-2-3-9\", \"M13.7 21a2 2 0 0 1-3.4 0\"],\n  search: [\"M11 3a8 8 0 1 0 0 16 8 8 0 0 0 0-16z\", \"M21 21l-4.3-4.3\"],\n  card: [\"M3 5h18a1 1 0 0 1 1 1v12a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V6a1 1 0 0 1 1-1z\", \"M2 10h20\"],\n  more: [\"M5 12h.01M12 12h.01M19 12h.01\"],\n  up: [\"M12 19V5M5 12l7-7 7 7\"],\n  down: [\"M12 5v14M19 12l-7 7-7-7\"],\n  chevd: [\"M6 9l6 6 6-6\"],\n  chevr: [\"M9 6l6 6-6 6\"],\n  chevl: [\"M15 6l-6 6 6 6\"],\n  x: [\"M18 6L6 18M6 6l12 12\"],\n  mail: [\"M3 5h18v14H3z\", \"M3 6l9 7 9-7\"],\n  download: [\"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4\", \"M7 10l5 5 5-5M12 15V3\"],\n  trash: [\"M3 6h18M8 6V4h8v2M19 6l-1 14H6L5 6\"],\n  shield: [\"M12 3l8 3v6c0 5-3.5 8-8 9-4.5-1-8-4-8-9V6z\"],\n  plus: [\"M12 5v14M5 12h14\"],\n  lock: [\"M5 11h14v10H5z\", \"M8 11V7a4 4 0 0 1 8 0v4\"],\n};\n\nfunction Ico({ n }: { n: string }) {\n  return (\n    <svg className=\"hb-dad-ico\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"1.8\" strokeLinecap=\"round\" strokeLinejoin=\"round\" aria-hidden=\"true\">\n      {(icons[n] ?? []).map((d, i) => (\n        <path key={i} d={d} />\n      ))}\n    </svg>\n  );\n}\n\ninterface NavItem {\n  id: string;\n  label: string;\n  icon: string;\n  count?: string;\n  section?: string;\n}\nfunction Shell({\n  brand,\n  nav,\n  defaultActive,\n  crumb,\n  placeholder,\n  user,\n  foot,\n  children,\n}: {\n  brand: string;\n  nav: NavItem[];\n  defaultActive: string;\n  crumb: [string, string];\n  placeholder: string;\n  user: string;\n  foot?: React.ReactNode;\n  children: React.ReactNode;\n}) {\n  const [active, setActive] = React.useState(defaultActive);\n  return (\n    <div className=\"hb-dad-app\">\n      <aside className=\"hb-dad-side\">\n        <div className=\"hb-dad-brand\">\n          <span className=\"hb-dad-mark\" aria-hidden=\"true\">\n            <svg width=\"14\" height=\"14\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"2.6\" strokeLinecap=\"round\" strokeLinejoin=\"round\">\n              <path d=\"M4 18L10 6l4 8 2-4 4 8\" />\n            </svg>\n          </span>\n          <span>{brand}</span>\n        </div>\n        <nav aria-label=\"Main\">\n          <ul className=\"hb-dad-nav\">\n            {nav.map((item) => (\n              <React.Fragment key={item.id}>\n                {item.section ? (\n                  <li className=\"hb-dad-nav-label\" aria-hidden=\"true\">\n                    {item.section}\n                  </li>\n                ) : null}\n                <li>\n                  <button type=\"button\" className=\"hb-dad-link\" aria-current={active === item.id ? \"page\" : undefined} aria-label={item.label} onClick={() => setActive(item.id)}>\n                    <Ico n={item.icon} />\n                    <span className=\"hb-dad-link-t\">{item.label}</span>\n                    {item.count ? <span className=\"hb-dad-link-n\">{item.count}</span> : null}\n                  </button>\n                </li>\n              </React.Fragment>\n            ))}\n          </ul>\n        </nav>\n        {foot ? <div className=\"hb-dad-side-foot\">{foot}</div> : null}\n      </aside>\n      <div className=\"hb-dad-main\">\n        <header className=\"hb-dad-top\">\n          <div className=\"hb-dad-crumb\">\n            {crumb[0]} / <strong>{crumb[1]}</strong>\n          </div>\n          <label className=\"hb-dad-search\">\n            <Ico n=\"search\" />\n            <input type=\"search\" placeholder={placeholder} aria-label={placeholder} />\n            <span className=\"hb-dad-kbd\">/</span>\n          </label>\n          <button type=\"button\" className=\"hb-dad-iconbtn\" aria-label=\"Notifications\">\n            <Ico n=\"bell\" />\n            <span className=\"hb-dad-dot\" />\n          </button>\n          <span className=\"hb-dad-av\" style={{ background: tone(user), width: 34, height: 34 }} title={user}>\n            {initials(user)}\n          </span>\n        </header>\n        <div className=\"hb-dad-content\">{children}</div>\n      </div>\n    </div>\n  );\n}\n\nconst ROLES: AdminRole[] = [\"Admin\", \"Editor\", \"Viewer\", \"Billing\"];\nconst STATUSES: AdminStatus[] = [\"Active\", \"Pending\", \"Suspended\"];\nconst ROLE_COLOR: Record<AdminRole, string> = { Admin: \"#a78bfa\", Editor: \"#7fb3ff\", Viewer: \"#a1a1a1\", Billing: \"#fbbf24\" };\nconst STATUS_COLOR: Record<AdminStatus, string> = { Active: \"#4ade80\", Pending: \"#fbbf24\", Suspended: \"#f87171\" };\nconst JOINED = [\"Feb 2023\", \"Jun 2023\", \"Sep 2023\", \"Jan 2024\", \"Apr 2024\", \"Aug 2024\", \"Nov 2024\", \"Mar 2025\"];\nconst ACTIVITY = [\"Signed in from Chrome on macOS\", \"Updated billing contacts\", \"Exported the audit log\", \"Invited two teammates\", \"Changed a dashboard filter\", \"Rotated an API key\"];\nconst WHEN = [\"Today\", \"Yesterday\", \"3 days ago\"];\n\ntype Row = [string, AdminRole, AdminStatus, number, string, string];\n\nconst ROWS: Row[] = [\n  [\"Amara Okafor\", \"Admin\", \"Active\", 4, \"Platform\", \"Lagos\"],\n  [\"Ben Hartley\", \"Editor\", \"Active\", 1500, \"Design\", \"Leeds\"],\n  [\"Chloe Tran\", \"Editor\", \"Active\", 95, \"Marketing\", \"Ho Chi Minh City\"],\n  [\"Dario Silva\", \"Viewer\", \"Pending\", -1, \"Sales\", \"Lisbon\"],\n  [\"Elin Berg\", \"Admin\", \"Active\", 8, \"Platform\", \"Stockholm\"],\n  [\"Farah Nasser\", \"Billing\", \"Active\", 1700, \"Finance\", \"Dubai\"],\n  [\"Gabe Moreau\", \"Viewer\", \"Suspended\", 12000, \"Support\", \"Montreal\"],\n  [\"Hana Ito\", \"Editor\", \"Active\", 40, \"Design\", \"Osaka\"],\n  [\"Idris Bello\", \"Viewer\", \"Active\", 300, \"Sales\", \"Accra\"],\n  [\"Jules Martin\", \"Editor\", \"Pending\", -1, \"Marketing\", \"Lyon\"],\n  [\"Kira Volkov\", \"Admin\", \"Active\", 61, \"Security\", \"Tallinn\"],\n  [\"Liam O'Connor\", \"Viewer\", \"Active\", 4300, \"Support\", \"Dublin\"],\n  [\"Mina Park\", \"Billing\", \"Active\", 2900, \"Finance\", \"Seoul\"],\n  [\"Noah Fischer\", \"Editor\", \"Active\", 15, \"Platform\", \"Berlin\"],\n  [\"Olu Adeyemi\", \"Viewer\", \"Suspended\", 21000, \"Sales\", \"Lagos\"],\n  [\"Priya Raman\", \"Editor\", \"Active\", 130, \"Data\", \"Bengaluru\"],\n  [\"Quinn Ellis\", \"Viewer\", \"Active\", 700, \"Support\", \"Austin\"],\n  [\"Rosa Mendes\", \"Editor\", \"Pending\", -1, \"Design\", \"Sao Paulo\"],\n  [\"Sven Larsen\", \"Admin\", \"Active\", 2, \"Platform\", \"Oslo\"],\n  [\"Tala Haddad\", \"Viewer\", \"Active\", 5100, \"Marketing\", \"Amman\"],\n  [\"Uma Patel\", \"Editor\", \"Active\", 18, \"Data\", \"Pune\"],\n  [\"Victor Nguyen\", \"Viewer\", \"Active\", 9800, \"Sales\", \"Hanoi\"],\n  [\"Wren Calloway\", \"Billing\", \"Active\", 360, \"Finance\", \"Denver\"],\n  [\"Yusuf Demir\", \"Editor\", \"Suspended\", 30000, \"Support\", \"Istanbul\"],\n];\n\nfunction slug(name: string) {\n  return name\n    .toLowerCase()\n    .replace(/[^a-z ]/g, \"\")\n    .trim()\n    .replace(/ +/g, \"-\");\n}\n\nconst DEFAULT_USERS: AdminUser[] = ROWS.map(([name, role, status, lastActive, team, location], i) => ({\n  id: slug(name),\n  name,\n  email: `${slug(name).replace(\"-\", \".\")}@northwind.io`,\n  role,\n  status,\n  lastActive,\n  team,\n  location,\n  joined: JOINED[i % JOINED.length],\n  twoFactor: hash(i + 31) > 0.35,\n}));\n\nconst NAV: NavItem[] = [\n  { id: \"dashboard\", label: \"Dashboard\", icon: \"grid\", section: \"Admin\" },\n  { id: \"users\", label: \"Users\", icon: \"users\", count: \"24\" },\n  { id: \"roles\", label: \"Roles\", icon: \"shield\" },\n  { id: \"billing\", label: \"Billing\", icon: \"card\" },\n  { id: \"audit\", label: \"Audit log\", icon: \"file\", section: \"Security\" },\n  { id: \"keys\", label: \"API keys\", icon: \"lock\" },\n  { id: \"settings\", label: \"Settings\", icon: \"sliders\" },\n];\n\ntype SortKey = \"name\" | \"role\" | \"status\" | \"lastActive\";\n\nfunction ago(m: number) {\n  if (m < 0) return \"Never\";\n  if (m < 5) return \"Just now\";\n  if (m < 60) return `${m} min ago`;\n  if (m < 1440) return `${Math.round(m / 60)} h ago`;\n  if (m < 2880) return \"Yesterday\";\n  return `${Math.round(m / 1440)} d ago`;\n}\n\nfunction sortValue(u: AdminUser, key: SortKey) {\n  if (key === \"lastActive\") return u.lastActive < 0 ? 1e9 : u.lastActive;\n  return u[key];\n}\n\nexport function AdminDashboard({\n  accent = \"#2f7bff\",\n  brand = \"Control\",\n  user = \"Amara Okafor\",\n  workspace = \"Northwind\",\n  users: usersProp,\n  pageSize = 8,\n  defaultSelected = [],\n  onSelectionChange,\n  onKeyDown,\n  className = \"\",\n  style,\n  ...rest\n}: AdminDashboardProps) {\n  const [users, setUsers] = React.useState<AdminUser[]>(usersProp ?? DEFAULT_USERS);\n  const [query, setQuery] = React.useState(\"\");\n  const [role, setRole] = React.useState<AdminRole | \"All\">(\"All\");\n  const [status, setStatus] = React.useState<AdminStatus | \"All\">(\"All\");\n  const [sort, setSort] = React.useState<{ key: SortKey; dir: 1 | -1 }>({ key: \"lastActive\", dir: 1 });\n  const [page, setPage] = React.useState(0);\n  const [selected, setSelected] = React.useState<string[]>(defaultSelected);\n  const [openId, setOpenId] = React.useState<string | null>(null);\n  const trigger = React.useRef<HTMLElement | null>(null);\n  const closeBtn = React.useRef<HTMLButtonElement>(null);\n\n  React.useEffect(() => {\n    if (openId) closeBtn.current?.focus();\n  }, [openId]);\n\n  const q = query.trim().toLowerCase();\n  const filtered = users\n    .filter((u) => (role === \"All\" || u.role === role) && (status === \"All\" || u.status === status) && (!q || u.name.toLowerCase().includes(q) || u.email.includes(q)))\n    .sort((a, b) => {\n      const x = sortValue(a, sort.key);\n      const y = sortValue(b, sort.key);\n      const cmp = typeof x === \"number\" && typeof y === \"number\" ? x - y : String(x).localeCompare(String(y));\n      return cmp * sort.dir || a.name.localeCompare(b.name);\n    });\n\n  const pageCount = Math.max(1, Math.ceil(filtered.length / pageSize));\n  const pageIdx = Math.min(page, pageCount - 1);\n  const rows = filtered.slice(pageIdx * pageSize, pageIdx * pageSize + pageSize);\n  const allOnPage = rows.length > 0 && rows.every((u) => selected.includes(u.id));\n  const someOnPage = rows.some((u) => selected.includes(u.id));\n  const counts = (s: AdminStatus | \"All\") => (s === \"All\" ? users.length : users.filter((u) => u.status === s).length);\n  const open = users.find((u) => u.id === openId) ?? null;\n\n  const commit = (next: string[]) => {\n    setSelected(next);\n    onSelectionChange?.(next);\n  };\n\n  const toggleRow = (id: string) => commit(selected.includes(id) ? selected.filter((x) => x !== id) : [...selected, id]);\n\n  const toggleAll = () => {\n    const ids = rows.map((u) => u.id);\n    commit(allOnPage ? selected.filter((x) => !ids.includes(x)) : [...selected, ...ids.filter((x) => !selected.includes(x))]);\n  };\n\n  const toggleSort = (key: SortKey) => setSort((s) => (s.key === key ? { key, dir: s.dir === 1 ? -1 : 1 } : { key, dir: 1 }));\n\n  const patch = (ids: string[], change: Partial<AdminUser>) => setUsers((list) => list.map((u) => (ids.includes(u.id) ? { ...u, ...change } : u)));\n\n  const remove = (ids: string[]) => {\n    setUsers((list) => list.filter((u) => !ids.includes(u.id)));\n    commit(selected.filter((x) => !ids.includes(x)));\n    if (openId && ids.includes(openId)) setOpenId(null);\n  };\n\n  const openUser = (id: string, el: HTMLElement | null) => {\n    trigger.current = el;\n    setOpenId(id);\n  };\n\n  const close = () => {\n    setOpenId(null);\n    trigger.current?.focus();\n  };\n\n  const th = (key: SortKey, label: string, cls?: string) => (\n    <th className={cls} aria-sort={sort.key === key ? (sort.dir === 1 ? \"ascending\" : \"descending\") : undefined}>\n      <button type=\"button\" className=\"hb-dad-th-b\" onClick={() => toggleSort(key)}>\n        {label}\n        <Ico n={sort.key === key && sort.dir === -1 ? \"down\" : \"up\"} />\n      </button>\n    </th>\n  );\n\n  const vars = { \"--a\": accent, ...style } as React.CSSProperties;\n  const activity = open\n    ? open.status === \"Pending\"\n      ? [[\"Invitation sent\", \"Waiting\"]]\n      : [0, 1, 2].map((k) => [ACTIVITY[Math.floor(hash(users.indexOf(open) * 7 + k) * ACTIVITY.length)], WHEN[k]])\n    : [];\n\n  return (\n    <div\n      className={`hb-dad ${className}`}\n      style={vars}\n      onKeyDown={(e) => {\n        onKeyDown?.(e);\n        if (e.key === \"Escape\" && openId) close();\n      }}\n      {...rest}\n    >\n      <style href=\"hb-admin-dashboard\" precedence=\"default\">\n        {css}\n      </style>\n      <Shell\n        brand={brand}\n        nav={NAV}\n        defaultActive=\"users\"\n        crumb={[workspace, \"Users\"]}\n        placeholder=\"Search anything\"\n        user={user}\n        foot={\n          <div className=\"hb-dad-plan\">\n            <strong>Team plan</strong>\n            <span>\n              {users.length} of 50 seats used\n            </span>\n            <div className=\"hb-dad-plan-b\">\n              <i style={{ \"--w\": `${Math.min((users.length / 50) * 100, 100).toFixed(0)}%` } as React.CSSProperties} />\n            </div>\n          </div>\n        }\n      >\n        <div className=\"hb-dad-head\">\n          <div>\n            <h2 className=\"hb-dad-title\">Users</h2>\n            <p className=\"hb-dad-sub\">\n              {users.length} members in the {workspace} workspace\n            </p>\n          </div>\n          <div className=\"hb-dad-tools\">\n            <button type=\"button\" className=\"hb-dad-btn\">\n              <Ico n=\"download\" />\n              Export\n            </button>\n            <button type=\"button\" className=\"hb-dad-btn\" data-p=\"true\">\n              <Ico n=\"plus\" />\n              Invite user\n            </button>\n          </div>\n        </div>\n\n        <div className=\"hb-dad-card hb-dad-ucard\" style={{ \"--d\": 0 } as React.CSSProperties}>\n          <div className=\"hb-dad-bar-t\">\n            <label className=\"hb-dad-find\">\n              <Ico n=\"search\" />\n              <input\n                type=\"search\"\n                placeholder=\"Search by name or email\"\n                aria-label=\"Search users\"\n                value={query}\n                onChange={(e) => {\n                  setQuery(e.target.value);\n                  setPage(0);\n                }}\n              />\n            </label>\n            <label className=\"hb-dad-sel\">\n              <select\n                aria-label=\"Filter by role\"\n                value={role}\n                onChange={(e) => {\n                  setRole(e.target.value as AdminRole | \"All\");\n                  setPage(0);\n                }}\n              >\n                <option value=\"All\">All roles</option>\n                {ROLES.map((r) => (\n                  <option key={r} value={r}>\n                    {r}\n                  </option>\n                ))}\n              </select>\n              <Ico n=\"chevd\" />\n            </label>\n            <div className=\"hb-dad-fchips\" role=\"group\" aria-label=\"Filter by status\">\n              {([\"All\", ...STATUSES] as const).map((s) => (\n                <button\n                  key={s}\n                  type=\"button\"\n                  className=\"hb-dad-fchip\"\n                  aria-pressed={status === s}\n                  onClick={() => {\n                    setStatus(s);\n                    setPage(0);\n                  }}\n                >\n                  {s}\n                  <span>{counts(s)}</span>\n                </button>\n              ))}\n            </div>\n          </div>\n\n          {selected.length > 0 ? (\n            <div className=\"hb-dad-bulk\" role=\"region\" aria-label=\"Bulk actions\">\n              <strong>{selected.length} selected</strong>\n              <label className=\"hb-dad-sel\">\n                <select\n                  aria-label=\"Set role for selected users\"\n                  value=\"\"\n                  onChange={(e) => {\n                    if (e.target.value) patch(selected, { role: e.target.value as AdminRole });\n                  }}\n                >\n                  <option value=\"\">Set role</option>\n                  {ROLES.map((r) => (\n                    <option key={r} value={r}>\n                      {r}\n                    </option>\n                  ))}\n                </select>\n                <Ico n=\"chevd\" />\n              </label>\n              <button type=\"button\" className=\"hb-dad-btn\" onClick={() => patch(selected, { status: \"Suspended\" })}>\n                <Ico n=\"lock\" />\n                Suspend\n              </button>\n              <button type=\"button\" className=\"hb-dad-btn\" data-d=\"true\" onClick={() => remove(selected)}>\n                <Ico n=\"trash\" />\n                Delete\n              </button>\n              <button type=\"button\" className=\"hb-dad-btn\" onClick={() => commit([])}>\n                Clear\n              </button>\n            </div>\n          ) : null}\n\n          {rows.length > 0 ? (\n            <div className=\"hb-dad-tw\">\n              <table className=\"hb-dad-ut\">\n                <thead>\n                  <tr>\n                    <th className=\"hb-dad-ck\">\n                      <input\n                        type=\"checkbox\"\n                        aria-label=\"Select all users on this page\"\n                        checked={allOnPage}\n                        ref={(el) => {\n                          if (el) el.indeterminate = someOnPage && !allOnPage;\n                        }}\n                        onChange={toggleAll}\n                      />\n                    </th>\n                    {th(\"name\", \"User\")}\n                    {th(\"role\", \"Role\", \"hb-dad-hide\")}\n                    {th(\"status\", \"Status\")}\n                    {th(\"lastActive\", \"Last active\", \"hb-dad-hide\")}\n                    <th aria-label=\"Actions\" style={{ width: 52 }} />\n                  </tr>\n                </thead>\n                <tbody>\n                  {rows.map((u) => (\n                    <tr key={u.id} data-sel={selected.includes(u.id)} data-open={openId === u.id} onClick={() => openUser(u.id, null)}>\n                      <td className=\"hb-dad-ck\" onClick={(e) => e.stopPropagation()}>\n                        <input type=\"checkbox\" aria-label={`Select ${u.name}`} checked={selected.includes(u.id)} onChange={() => toggleRow(u.id)} />\n                      </td>\n                      <td>\n                        <button\n                          type=\"button\"\n                          className=\"hb-dad-ucell\"\n                          onClick={(e) => {\n                            e.stopPropagation();\n                            openUser(u.id, e.currentTarget);\n                          }}\n                        >\n                          <span className=\"hb-dad-av\" style={{ background: tone(u.name) }}>\n                            {initials(u.name)}\n                          </span>\n                          <div>\n                            <strong>{u.name}</strong>\n                            <span>{u.email}</span>\n                          </div>\n                        </button>\n                      </td>\n                      <td className=\"hb-dad-hide\">\n                        <span className=\"hb-dad-role\" style={{ \"--c\": ROLE_COLOR[u.role] } as React.CSSProperties}>\n                          {u.role}\n                        </span>\n                      </td>\n                      <td>\n                        <span className=\"hb-dad-st\" style={{ \"--c\": STATUS_COLOR[u.status] } as React.CSSProperties}>\n                          <i />\n                          {u.status}\n                        </span>\n                      </td>\n                      <td className=\"hb-dad-hide hb-dad-la\">{ago(u.lastActive)}</td>\n                      <td onClick={(e) => e.stopPropagation()}>\n                        <button type=\"button\" className=\"hb-dad-rowbtn\" aria-label={`More actions for ${u.name}`} onClick={() => openUser(u.id, null)}>\n                          <Ico n=\"more\" />\n                        </button>\n                      </td>\n                    </tr>\n                  ))}\n                </tbody>\n              </table>\n            </div>\n          ) : (\n            <div className=\"hb-dad-empty\">\n              <strong>No users match</strong>\n              Try a different name or clear the filters.\n            </div>\n          )}\n\n          <div className=\"hb-dad-pager\">\n            <span>\n              {filtered.length === 0 ? \"No results\" : `Showing ${pageIdx * pageSize + 1}–${pageIdx * pageSize + rows.length} of ${filtered.length}`}\n            </span>\n            <div className=\"hb-dad-pgs\" role=\"navigation\" aria-label=\"Pagination\">\n              <button type=\"button\" className=\"hb-dad-pg\" aria-label=\"Previous page\" disabled={pageIdx === 0} onClick={() => setPage(pageIdx - 1)}>\n                <Ico n=\"chevl\" />\n              </button>\n              {Array.from({ length: pageCount }, (_, i) => (\n                <button key={i} type=\"button\" className=\"hb-dad-pg\" aria-current={i === pageIdx ? \"page\" : undefined} onClick={() => setPage(i)}>\n                  {i + 1}\n                </button>\n              ))}\n              <button type=\"button\" className=\"hb-dad-pg\" aria-label=\"Next page\" disabled={pageIdx >= pageCount - 1} onClick={() => setPage(pageIdx + 1)}>\n                <Ico n=\"chevr\" />\n              </button>\n            </div>\n          </div>\n        </div>\n      </Shell>\n\n      <div className=\"hb-dad-scrim\" data-open={open !== null} onClick={close} aria-hidden=\"true\" />\n      <aside className=\"hb-dad-panel\" data-open={open !== null} role=\"dialog\" aria-label=\"User details\" inert={open === null}>\n        {open ? (\n          <>\n            <div className=\"hb-dad-pn-h\">\n              <h3>User details</h3>\n              <button ref={closeBtn} type=\"button\" className=\"hb-dad-iconbtn\" aria-label=\"Close details\" onClick={close}>\n                <Ico n=\"x\" />\n              </button>\n            </div>\n            <div className=\"hb-dad-pn-id\">\n              <span className=\"hb-dad-av\" style={{ background: tone(open.name) }}>\n                {initials(open.name)}\n              </span>\n              <strong>{open.name}</strong>\n              <p>{open.email}</p>\n              <div className=\"hb-dad-pn-tags\">\n                <span className=\"hb-dad-role\" style={{ \"--c\": ROLE_COLOR[open.role] } as React.CSSProperties}>\n                  {open.role}\n                </span>\n                <span className=\"hb-dad-st\" style={{ \"--c\": STATUS_COLOR[open.status] } as React.CSSProperties}>\n                  <i />\n                  {open.status}\n                </span>\n              </div>\n            </div>\n            <div className=\"hb-dad-pn-act\">\n              <button type=\"button\" className=\"hb-dad-btn\">\n                <Ico n=\"mail\" />\n                Message\n              </button>\n              <button\n                type=\"button\"\n                className=\"hb-dad-btn\"\n                onClick={() => patch([open.id], { status: open.status === \"Suspended\" ? \"Active\" : \"Suspended\" })}\n              >\n                <Ico n=\"lock\" />\n                {open.status === \"Suspended\" ? \"Reactivate\" : \"Suspend\"}\n              </button>\n            </div>\n            <div>\n              <p className=\"hb-dad-pn-s\">Profile</p>\n              <dl className=\"hb-dad-kv\">\n                <dt>Role</dt>\n                <dd>\n                  <label className=\"hb-dad-sel\">\n                    <select aria-label=\"Role\" value={open.role} onChange={(e) => patch([open.id], { role: e.target.value as AdminRole })}>\n                      {ROLES.map((r) => (\n                        <option key={r} value={r}>\n                          {r}\n                        </option>\n                      ))}\n                    </select>\n                    <Ico n=\"chevd\" />\n                  </label>\n                </dd>\n                <dt>Team</dt>\n                <dd>{open.team}</dd>\n                <dt>Location</dt>\n                <dd>{open.location}</dd>\n                <dt>Joined</dt>\n                <dd>{open.joined}</dd>\n                <dt>Last active</dt>\n                <dd>{ago(open.lastActive)}</dd>\n                <dt>Two-factor</dt>\n                <dd>\n                  <span className=\"hb-dad-pill\" data-t={open.twoFactor ? \"up\" : \"down\"}>\n                    {open.twoFactor ? \"Enabled\" : \"Off\"}\n                  </span>\n                </dd>\n              </dl>\n            </div>\n            <div>\n              <p className=\"hb-dad-pn-s\">Recent activity</p>\n              <ul className=\"hb-dad-act\">\n                {activity.map(([text, when], i) => (\n                  <li key={i}>\n                    <i />\n                    {text}\n                    <span>{when}</span>\n                  </li>\n                ))}\n              </ul>\n            </div>\n            <div className=\"hb-dad-pn-f\">\n              <button type=\"button\" className=\"hb-dad-btn\" data-d=\"true\" onClick={() => remove([open.id])}>\n                <Ico n=\"trash\" />\n                Remove user\n              </button>\n            </div>\n          </>\n        ) : null}\n      </aside>\n    </div>\n  );\n}\n"
    }
  ]
}