  :root {
    --ink: #222;
    --muted: #666;
    --line: #ddd;
    --accent: #2557a7;
    --ok: #1e7e34;
    --err: #b02a2a;

    /* shell tokens (NBCRM-73, from dashboard-example-v1) */
    --canvas: #fafafa;
    --surface: #fff;
    --thead: #f2f2f2;
    --tint: #eef2fa;
    --sidebar: #222;
    --sidebar-hover: #333;
    --sidebar-text: #c4c4c4;
    --sidebar-label: #8a8a8a;
    --topbar-h: 48px;
    --sidebar-w: 220px;
  }

  * {
    box-sizing: border-box;
  }

  body {
    font: 15px/1.5 system-ui, sans-serif;
    color: var(--ink);
    margin: 0;
    background: #fafafa;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
  }

  header {
    background: #fff;
    border-bottom: 1px solid var(--line);
    padding: 10px 24px;
    display: flex;
    gap: 16px;
    align-items: center;
  }

  header .brand {
    font-weight: 600;
  }

  header form {
    margin: 0;
  }

  main {
    max-width: 960px;
    margin: 24px auto;
    padding: 0 24px;
    flex: 1;
    width: 100%;
  }

  h1 {
    font-size: 22px;
  }

  table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
  }

  th,
  td {
    text-align: left;
    padding: 8px 10px;
    border-bottom: 1px solid var(--line);
  }

  th {
    background: #f2f2f2;
  }

  .flash {
    padding: 10px 14px;
    border-radius: 6px;
    margin-bottom: 16px;
  }

  .flash.success {
    background: #e6f4ea;
    color: var(--ok);
  }

  .flash.error {
    background: #fbeaea;
    color: var(--err);
  }

  form.inline {
    display: inline;
  }

  .btn {
    display: inline-block;
    padding: 7px 14px;
    border-radius: 6px;
    border: 1px solid var(--line);
    background: #fff;
    color: var(--ink);
    text-decoration: none;
    cursor: pointer;
    font-size: 14px;
  }

  .btn.primary {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
  }

  .btn.danger {
    color: var(--err);
    border-color: var(--err);
  }

  .btn-full {
    width: 100%;
    text-align: center;
  }

  label {
    display: block;
    margin: 10px 0 4px;
    font-weight: 600;
    font-size: 14px;
  }

  input,
  select {
    width: 100%;
    max-width: 420px;
    padding: 7px 10px;
    border: 1px solid var(--line);
    border-radius: 6px;
    font-size: 14px;
  }

  .meta {
    color: var(--muted);
    font-size: 13px;
  }

  td.meta.created {
    font-size: 10px;
    white-space: break-spaces;
  }

  td.meta.json {
    font-size: 12px;
    max-width: 340px;
    overflow: auto;
  }

  .badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    background: #eef2fa;
    color: var(--accent);
    font-size: 12px;
    margin-right: 4px;
  }

  /* username availability hint (NBCRM-78 piece 2) */
  .username-hint {
    margin-top: 4px;
  }

  .suggestion-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 6px;
  }

  .suggestion-chip {
    border: 1px solid var(--line);
    background: var(--surface);
    border-radius: 12px;
    padding: 3px 10px;
    font-size: 12px;
    cursor: pointer;
  }

  .suggestion-chip:hover {
    border-color: var(--accent);
    color: var(--accent);
  }

  .status {
    font-weight: 600;
  }

  .status.ACTIVE {
    color: var(--ok);
  }

  .status.DELETED {
    color: var(--err);
  }

  .status.PENDING_VERIFICATION {
    color: #b8860b;
  }

  /* --- shell (NBCRM-73): topbar / sidebar / breadcrumbs / cards --- */
  :focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
  }

  /* topbar */
  body.shell header.topbar {
    position: fixed;
    inset: 0 0 auto 0;
    height: var(--topbar-h);
    z-index: 30;
    padding: 0 16px;
  }

  body.shell .brand {
    font-weight: 600;
    width: calc(var(--sidebar-w) - 16px);
    color: var(--ink);
    text-decoration: none;
  }

  .menu-btn {
    display: none;
    width: 32px;
    height: 32px;
    padding: 0;
    cursor: pointer;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #fff;
  }

  .menu-btn span,
  .menu-btn span::before,
  .menu-btn span::after {
    content: "";
    display: block;
    position: relative;
    width: 14px;
    height: 1.5px;
    background: var(--ink);
    margin: 0 auto;
  }

  .menu-btn span::before {
    top: -4px;
  }

  .menu-btn span::after {
    top: 2.5px;
  }

  .topbar-right {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 6px;
  }

  /* profile dropdown */
  .profile {
    position: relative;
  }

  .profile-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    padding: 3px 8px 3px 3px;
    font: inherit;
    font-size: 14px;
    color: var(--ink);
    background: transparent;
    border: 1px solid transparent;
    border-radius: 20px;
  }

  .profile-btn:hover {
    border-color: var(--line);
    background: #fff;
  }

  .avatar {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: var(--accent);
    color: #fff;
    display: grid;
    place-items: center;
    font-size: 12px;
    font-weight: 600;
  }

  .caret {
    color: var(--muted);
    font-size: 10px;
  }

  .dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    display: none;
    min-width: 190px;
    padding: 5px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 6px;
    box-shadow: 0 6px 20px rgba(34, 34, 34, .12);
  }

  .dropdown[data-open="true"] {
    display: block;
  }

  .dropdown-head {
    padding: 7px 9px 9px;
    border-bottom: 1px solid var(--line);
    margin-bottom: 5px;
  }

  .dropdown-head strong {
    display: block;
    font-size: 14px;
  }

  .dropdown a,
  .dropdown .dropdown-item {
    display: block;
    width: 100%;
    padding: 6px 9px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: var(--ink);
    font-family: inherit;
    font-size: 14px;
    text-align: left;
    cursor: pointer;
  }

  .dropdown a:hover,
  .dropdown .dropdown-item:hover {
    background: var(--canvas);
  }

  .dropdown a.danger,
  .dropdown .dropdown-item.danger {
    color: var(--err);
  }

  /* sidebar */
  .sidebar {
    position: fixed;
    top: var(--topbar-h);
    bottom: 0;
    left: 0;
    z-index: 20;
    width: var(--sidebar-w);
    padding: 14px 10px 24px;
    background: var(--sidebar);
    overflow-y: auto;
  }

  .nav-group {
    margin-bottom: 18px;
  }

  .nav-label {
    padding: 0 10px 6px;
    color: var(--sidebar-label);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .08em;
    text-transform: uppercase;
  }

  .nav-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 7px 10px;
    margin-bottom: 1px;
    border-radius: 6px;
    border-left: 2px solid transparent;
    color: var(--sidebar-text);
    font-size: 14px;
    text-decoration: none;
  }

  .nav-link:hover {
    background: var(--sidebar-hover);
    color: #fff;
  }

  .nav-link.is-active {
    background: var(--sidebar-hover);
    color: #fff;
    font-weight: 600;
    border-left-color: var(--accent);
  }

  .scrim {
    position: fixed;
    inset: var(--topbar-h) 0 0 0;
    z-index: 15;
    display: none;
    background: rgba(34, 34, 34, .45);
  }

  /* breadcrumbs */
  .crumbs {
    margin-bottom: 16px;
  }

  .crumbs ol {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 0;
    padding: 0;
    font-size: 13px;
  }

  .crumbs li+li::before {
    content: "›";
    color: var(--muted);
    margin-right: 6px;
  }

  .crumbs a {
    color: var(--muted);
  }

  .crumbs a:hover {
    color: var(--ink);
    text-decoration: underline;
  }

  /* page head + cards */
  .page-head {
    display: flex;
    align-items: flex-end;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 20px;
  }

  .page-head .meta {
    margin-top: 3px;
  }

  .page-actions {
    margin-left: auto;
    display: flex;
    gap: 8px;
    align-items: center;
  }

  .page-actions form {
    display: flex;
    gap: 8px;
    align-items: center;
    margin: 0;
  }

  .page-actions form input {
    max-width: 300px;
  }

  .cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 24px;
  }

  .card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 6px;
  }

  .card.pad {
    padding: 14px 16px;
  }

  .card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    border-bottom: 1px solid var(--line);
  }

  .card-head h2 {
    margin: 0;
    font-size: 15px;
  }

  .card-head a {
    font-size: 13px;
  }

  .card-body {
    padding: 14px 16px;
  }

  .stat {
    font-size: 26px;
    font-weight: 600;
    margin-top: 2px;
  }

  /* two-column layout (NBCRM-75): main content + aside rail */
  .cols {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 300px;
    gap: 24px;
    align-items: start;
  }

  .cols aside {
    display: grid;
    gap: 16px;
    align-content: start;
  }

  .flex-row {
    display: flex;
    align-items: center;
    gap: 8px;
  }

  .flex-col {
    display: flex;
    flex-direction: column;
  }

  .flex-col>* {
    margin: 0;
    width: 100%;
  }

  .actions-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
  }

  .actions-row:first-child {
    margin-top: 0;
  }

  .pager {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    margin-top: 14px;
  }

  .pager .pager-group {
    display: flex;
    gap: 8px;
  }

  .rail-item {
    padding: 10px 0;
    border-bottom: 1px solid var(--line);
  }

  .rail-item:last-child {
    border-bottom: 0;
  }

  .rail-item p {
    margin: 0 0 4px;
  }

  /* main + footer within the shell */
  body.shell main {
    padding: calc(var(--topbar-h) + 24px) 24px 48px calc(var(--sidebar-w) + 24px);
    max-width: 1200px;
    margin: 0;
    width: 100%;
    flex: 1;
  }

  footer.site {
    padding: 14px 24px;
    color: var(--muted);
    font-size: 12px;
    border-top: 1px solid var(--line);
    margin-top: 32px;
  }

  body.shell footer.site {
    margin-top: 0;
    padding-left: calc(var(--sidebar-w) + 24px);
  }

  /* mobile: hamburger + drawer + scrim */
  @media (max-width: 900px) {
    .menu-btn {
      display: block;
    }

    body.shell .brand {
      width: auto;
    }

    body.shell main,
    body.shell footer.site {
      padding-left: 24px;
    }

    .cards {
      grid-template-columns: 1fr;
    }

    .cols {
      grid-template-columns: 1fr;
    }

    .sidebar {
      transform: translateX(-100%);
      transition: transform .18s ease;
    }

    body[data-nav="open"] .sidebar {
      transform: none;
    }

    body[data-nav="open"] .scrim {
      display: block;
    }
  }

  @media (prefers-reduced-motion: reduce) {
    * {
      transition: none !important;
    }
  }
  /* --- dataTable component (NBCRM-93): toolbar, sortable headers, pager --- */
  .dt-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 16px;
  }

  .dt-toolbar form {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin: 0;
  }

  .dt-toolbar form input[type="search"] {
    max-width: 280px;
  }

  .dt-toolbar form select {
    max-width: 220px;
  }

  .dt-info {
    margin: 0 0 8px;
  }

  .dt-sort {
    color: var(--ink);
    text-decoration: none;
    white-space: nowrap;
  }

  .dt-sort:hover {
    color: var(--accent);
  }

  .dt-ind {
    font-size: 12px;
  }

  .dt-hint {
    font-size: 12px;
    color: var(--muted);
    opacity: 0;
  }

  .dt-sort:hover .dt-hint {
    opacity: .7;
  }

  .dt-shift {
    opacity: 0;
    margin-left: 4px;
    font-size: 12px;
    color: var(--muted);
    text-decoration: none;
  }

  th:hover .dt-shift {
    opacity: .7;
  }

  .dt-shift:hover {
    opacity: 1;
    color: var(--accent);
  }

  .dt-pager {
    flex-wrap: wrap;
  }

  .dt-per-page {
    margin-left: 10px;
    white-space: nowrap;
  }

  .dt-per-page a {
    color: var(--accent);
    text-decoration: none;
    margin: 0 2px;
  }

  .dt-per-page strong {
    margin: 0 2px;
  }

  /* --- column-info tooltips (NBCRM-105, adr/260827a) + row-UUID copy
     box (NBCRM-106, adr/260827b) ---
     Column-info tooltips stay pure CSS ::after + attr() — display-only
     info, no copy need. The row-UUID tooltip is JS-rendered in
     authed.js (.uuid-tip): a pseudo-element's content cannot be
     selected or copied, so the row UUID renders as a real box with a
     Copy button. The data-uuid attributes on the tr + first cell
     (260827a) are the JS hook and stay untouched. */
  th[data-info] {
    position: relative;
  }

  th[data-info]::after {
    position: absolute;
    bottom: calc(100% + 8px);
    left: 0;
    z-index: 20;
    max-width: 320px;
    padding: 4px 8px;
    border: 1px solid var(--line);
    border-radius: 4px;
    background: #fff;
    color: var(--ink);
    font-size: 12px;
    font-weight: 400;
    line-height: 1.4;
    box-shadow: 0 2px 6px rgba(0, 0, 0, .12);
    opacity: 0;
    pointer-events: none;
    transition: opacity .15s ease;
    content: attr(data-info);
  }

  th[data-info]:hover::after {
    opacity: 1;
  }

  /* JS-rendered row-UUID box: one reusable element appended to body by
     authed.js, fixed at the first cell's position (top: rect.top + 4,
     left: rect.left), z-index above the page chrome (topbar is 30).
     The whole box is interactive — the pointer is captured as soon as
     it enters the box, before it can cross into the next row's band
     where the row hover would reposition it (adr/260827c). */
  .uuid-tip {
    position: fixed;
    z-index: 200;
    max-width: 360px;
    padding: 5px 8px;
    display: flex;
    align-items: center;
    gap: 8px;
    border: 1px solid var(--line);
    border-radius: 4px;
    background: #fff;
    box-shadow: 0 2px 6px rgba(0, 0, 0, .12);
  }

  .uuid-tip code {
    font-size: 12px;
    line-height: 1.4;
    color: var(--ink);
    word-break: break-all;
    user-select: text;
    cursor: text;
  }

  .uuid-tip .btn {
    padding: 3px 10px;
    font-size: 12px;
    white-space: nowrap;
  }

  /* --- lookup component (plan 260827a, adr/260827f): typeahead + suggestions --- */
  .lookup {
    position: relative;
    max-width: 520px;
  }

  .lookup-input {
    width: 100%;
    max-width: none; /* the .lookup container caps the width, not the base input rule */
    padding-right: 32px; /* room for the clear (×) button inside the field */
  }

  .lookup-clear {
    position: absolute;
    top: 50%;
    right: 8px;
    transform: translateY(-50%);
    width: 22px;
    height: 22px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--muted);
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .lookup-clear:hover {
    background: var(--tint);
    color: var(--ink);
  }

  .lookup-results {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    z-index: 40; /* above table rows and the page chrome */
    max-height: 240px;
    overflow-y: auto;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 6px;
    box-shadow: 0 6px 20px rgba(34, 34, 34, .12);
  }

  .lookup-option {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px;
    width: 100%;
    padding: 7px 10px;
    border: 0;
    background: transparent;
    color: var(--ink);
    font: inherit;
    font-size: 14px;
    text-align: left;
    cursor: pointer;
  }

  .lookup-option:hover,
  .lookup-option.active {
    background: var(--tint);
  }

  .lookup-hint {
    color: var(--muted);
    font-size: 12px;
    white-space: nowrap;
  }
