/* Access administration: compact lists, explicit edits and a single scroll owner. */
.access-workspace { min-width:0; color:var(--ui-fg); font-size:14px; }
.access-workspace, .access-sheet { --access-muted:var(--ui-secondary,#526175); accent-color:var(--fusion-accent); caret-color:var(--fusion-accent); }
.access-workspace [hidden], .access-sheet [hidden] { display:none !important; }
.access-workspace ::selection, .access-sheet ::selection { background:var(--fusion-accent); color:white; }
.access-workspace :focus-visible, .access-sheet :focus-visible { outline:2px solid var(--fusion-accent); outline-offset:3px; }
.access-workspace :is(input,select), .access-sheet :is(input,select,textarea) { box-sizing:border-box; width:100%; min-width:0; min-height:40px; max-width:100%; border:1px solid var(--ui-line); border-radius:6px; padding:8px 10px; background:var(--ui-bg); color:var(--ui-fg); font:inherit; }
.access-workspace input::placeholder, .access-sheet input::placeholder { color:var(--access-muted); opacity:1; }
.access-workspace label, .access-sheet label { display:grid; grid-template-columns:minmax(0,1fr); gap:6px; font-size:13px; font-weight:500; min-width:0; }
.access-workspace .btn, .access-sheet .btn { min-height:38px; padding:8px 12px; font-size:13px; white-space:normal; }
.access-page-actions { display:flex; justify-content:space-between; align-items:center; gap:20px; margin-bottom:20px; }
.access-page-actions > .access-note { margin:0; }
.access-page-actions > .btn { flex-shrink:0; }
.access-row-actions { display:flex; gap:8px; align-items:center; flex-wrap:wrap; }
.access-toolbar { display:flex; flex-wrap:wrap; gap:12px; align-items:end; margin-bottom:20px; }
.access-toolbar .access-search { flex:1 1 260px; }
.access-toolbar > label { flex:0 1 160px; }
.access-toolbar :is(input,select) { text-overflow:ellipsis; }
.access-toolbar-users { display:grid; grid-template-columns:minmax(180px,1fr) minmax(140px,180px) auto auto; align-items:center; gap:12px; margin:0; padding:16px; border:1px solid var(--ui-line); border-bottom:0; border-radius:10px 10px 0 0; background:var(--ui-bg); }
.access-toolbar-users .access-search { grid-column:1; grid-row:1; }
.access-toolbar-users .access-sort { grid-column:2; grid-row:1; }
.access-toolbar-users [data-reset] { grid-column:4; grid-row:1; }
.access-filters { display:contents; }
.access-filters > summary { display:flex; align-items:center; justify-content:center; gap:8px; grid-column:3; grid-row:1; min-height:40px; box-sizing:border-box; padding:8px 12px; border:1px solid var(--ui-line); border-radius:6px; color:var(--ui-fg); cursor:pointer; font-size:13px; font-weight:500; list-style:none; }
.access-filters > summary::-webkit-details-marker { display:none; }
.access-filters > summary::after { content:''; width:6px; height:6px; border-right:1.5px solid currentColor; border-bottom:1.5px solid currentColor; transform:rotate(45deg); margin:-3px 0 0 4px; }
.access-filters[open] > summary { background:var(--ui-muted); }
.access-filters[open] > summary::after { transform:rotate(225deg); margin-top:3px; }
.access-filter-fields { grid-column:1/-1; display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:12px; padding:4px 0; }
.access-result-count { grid-column:1/-1; margin:0; color:var(--access-muted); font-size:12px; }
.access-status-tabs { display:flex; flex-wrap:wrap; gap:4px; }
.access-status-tabs button { border:0; border-radius:6px; padding:8px 12px; min-height:38px; background:transparent; color:var(--access-muted); font:inherit; font-size:13px; font-weight:500; cursor:pointer; }
.access-status-tabs button:hover { background:var(--ui-bg); color:var(--ui-fg); }
.access-status-tabs button[aria-pressed=true] { color:var(--ui-fg); background:var(--ui-bg); box-shadow:0 1px 3px #0001; }
.access-users-heading { margin-bottom:16px; }
.access-users-heading > .access-row-actions { gap:8px; }
.access-users-workspace .access-table-wrap { border-radius:0 0 10px 10px; }
.access-count { color:var(--access-muted); font-size:12px; font-variant-numeric:tabular-nums; }
.access-table-wrap { overflow:auto; border:1px solid var(--ui-line); border-radius:10px; background:var(--ui-bg); }
.access-table { border-collapse:collapse; width:100%; text-align:left; font-variant-numeric:tabular-nums; }
.access-table th { background:var(--ui-bg-soft,var(--ui-bg)); color:var(--access-muted); font-size:12px; font-weight:600; }
.access-table :is(th,td) { padding:14px 16px; border-bottom:1px solid var(--ui-line); vertical-align:middle; }
.access-table td { line-height:1.5; overflow-wrap:anywhere; }
.access-table tr:last-child td { border-bottom:0; }
.access-table tbody tr:hover { background:color-mix(in srgb,var(--fusion-accent) 4%,var(--ui-bg)); }
body.admin-workspace .access-table [data-sort] { border:0; background:transparent; padding:0; min-height:28px; color:inherit; }
.access-users-table { table-layout:fixed; min-width:760px; }
.access-users-table th:nth-child(1) { width:32%; }
.access-users-table th:nth-child(2) { width:24%; }
.access-users-table th:nth-child(3) { width:22%; }
.access-users-table th:nth-child(4) { width:14%; }
.access-users-table th:nth-child(5) { width:8%; }
body.admin-workspace .access-users-table :is(th,td) { padding:12px 16px; }
.access-users-table tbody tr { cursor:pointer; }
.access-users-table tbody tr:focus-within { background:color-mix(in srgb,var(--fusion-accent) 5%,var(--ui-bg)); }
.access-person-trigger { display:flex; align-items:center; gap:12px; width:100%; min-height:40px; border:0; border-radius:4px; padding:0; background:transparent; color:inherit; text-align:left; font:inherit; cursor:pointer; }
.access-person-trigger .access-person strong { font-size:14px; font-weight:600; line-height:1.4; }
.access-person-trigger:hover .access-person strong { text-decoration:underline; text-underline-offset:3px; }
.access-avatar { display:inline-flex; align-items:center; justify-content:center; width:34px; height:34px; flex:0 0 34px; border-radius:50%; background:var(--ui-muted); color:var(--ui-fg); font-size:12px; font-weight:600; letter-spacing:.02em; }
.access-role-line { display:flex; align-items:center; gap:6px; min-width:0; }
.access-role-tag { display:inline-block; padding:3px 8px; border-radius:5px; background:var(--ui-muted); color:var(--ui-fg); font-size:12px; line-height:18px; }
.access-role-line .access-role-tag { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; max-width:100%; }
.access-inline-chevron { display:inline-block; width:6px; height:6px; flex:0 0 6px; border-top:1.5px solid currentColor; border-right:1.5px solid currentColor; transform:rotate(45deg); color:var(--access-muted); margin-right:3px; }
.access-user-row-actions { display:flex; justify-content:flex-end; }
.access-users-workspace .access-user-row-actions .btn { border:0; padding:8px; background:transparent; color:var(--access-muted); min-width:44px; }
.access-users-workspace .access-user-row-actions .btn:hover { background:var(--ui-muted); color:var(--ui-fg); }
.access-person-overview { display:flex; align-items:center; gap:16px; padding-bottom:24px; border-bottom:1px solid var(--ui-line); }
.access-person-overview .access-avatar { width:48px; height:48px; flex-basis:48px; font-size:16px; }
.access-person-overview h3 { font-size:20px; line-height:1.3; margin:0 0 8px; overflow-wrap:anywhere; }
.access-person-fields { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:20px; margin:24px 0; }
.access-person-fields dt { font-size:12px; color:var(--access-muted); margin-bottom:4px; }
.access-person-fields dd { margin:0; font-size:14px; line-height:1.5; overflow-wrap:anywhere; }
.access-person-section { padding:20px 0; border-top:1px solid var(--ui-line); }
.access-person-section h3 { margin:0 0 12px; font-size:14px; font-weight:600; }
.access-tag-list { display:flex; flex-wrap:wrap; gap:8px; }
.access-module-tag { font-size:13px; line-height:20px; }
.access-module-tag + .access-module-tag::before { content:'·'; margin-right:8px; color:var(--access-muted); }
.access-person-more { padding-top:20px; border-top:1px solid var(--ui-line); }
.access-person-more > summary { cursor:pointer; font-weight:500; }
.access-person-actions { display:grid; gap:8px; padding-top:12px; }
.access-person-actions .btn { text-align:left; }
.access-person-actions [data-person-action=disable] { color:var(--danger,#b42318); }
.theme-dark .access-person-actions [data-person-action=disable] { color:#ffaaa3; }
.access-person { display:grid; gap:4px; min-width:0; }
.access-workspace .access-person-name, .access-sheet .access-person-name { appearance:none; border:0; border-radius:3px; padding:0; background:transparent; color:var(--ui-fg); text-align:left; font:inherit; font-weight:600; line-height:1.45; cursor:pointer; overflow-wrap:anywhere; }
.access-person-name:hover { text-decoration:underline; text-underline-offset:3px; }
.access-person > span, .access-note, .access-sheet small { color:var(--access-muted); font-size:13px; }
.access-person-access { display:flex; align-items:center; justify-content:space-between; gap:8px; width:100%; box-sizing:border-box; min-height:44px; padding:4px; margin-left:-4px; border:0; border-radius:5px; background:transparent; color:var(--ui-fg); text-align:left; font:inherit; }
button.access-person-access { cursor:pointer; }
button.access-person-access:hover { background:var(--ui-muted); }
.access-person-access > span:first-child { min-width:0; display:grid; gap:4px; }
.access-person-access:disabled { cursor:wait; opacity:.6; }
.access-module-summary { color:var(--access-muted); font-size:12px; }
.access-module-summary .access-compact-list { display:inline; }
.access-compact-list > summary { cursor:pointer; }
.access-compact-list ul { margin:6px 0 0; padding-left:16px; }
.access-compact-list li + li { margin-top:4px; }
.access-status { display:inline-flex; align-items:center; gap:7px; white-space:nowrap; font-size:12px; font-weight:500; padding:3px 8px; border-radius:5px; background:var(--ui-muted); }
.access-status::before { content:''; width:6px; height:6px; border-radius:50%; background:currentColor; flex-shrink:0; }
.access-status[data-active=true] { color:#16734d; }
.theme-dark .access-status[data-active=true] { color:#66d9a8; }
.access-status[data-active=false] { color:var(--access-muted); }
.access-pagination { display:flex; align-items:center; justify-content:space-between; gap:12px; padding:16px 0; color:var(--access-muted); font-size:13px; }
.access-pagination > div, .access-pagination > label { display:flex; align-items:center; gap:10px; }
.access-pagination select { width:auto; }
.access-empty { padding:36px 20px; text-align:center; color:var(--access-muted); }
.access-empty h2 { margin:0 0 8px; font-size:18px; color:var(--ui-fg); }
.access-empty p { margin:0 auto 18px; max-width:55ch; line-height:1.6; }
.access-error { color:#b42318; line-height:1.5; }
.theme-dark .access-error { color:#ffaaa3; }
.access-note { line-height:1.6; max-width:72ch; }
.access-guidance { border-top:1px solid var(--ui-line); padding-top:16px; margin-top:0; max-width:none; }
.access-catalog-search { width:min(100%,440px); margin-bottom:20px; }
.access-role-list { border:1px solid var(--ui-line); border-radius:10px; background:var(--ui-bg); overflow:hidden; }
.access-role { padding:20px; border-bottom:1px solid var(--ui-line); display:grid; grid-template-columns:minmax(170px,1fr) 2fr auto; gap:24px; align-items:start; }
.access-role:last-child { border-bottom:0; }
.access-role-actions { justify-items:end; }
.access-role-actions .access-row-actions { justify-content:flex-end; }

.access-role > div { display:grid; gap:6px; }
.access-role > p { margin:0; color:var(--access-muted); line-height:1.6; }
body.admin-workspace .access-units-table .access-child-unit { padding-left:32px; }
.access-mobile-label { display:none; }
.access-units-table { min-width:560px; }
.access-audit-table { min-width:700px; }
.access-audit-table time { font-size:12px; white-space:nowrap; }
.access-sheet { position:fixed; inset:0 0 0 auto; margin:0; width:min(680px,100vw); max-width:100vw; height:100dvh; max-height:100dvh; overflow:hidden; box-sizing:border-box; padding:0; border:0; border-left:1px solid var(--ui-line); border-radius:0; color:var(--ui-fg); background:var(--ui-bg); font:inherit; }
.access-sheet[open] { display:flex; flex-direction:column; }
.access-sheet::backdrop { background:rgb(6 18 35 / .46); }
.access-sheet > header { display:flex; align-items:start; justify-content:space-between; gap:16px; padding:24px; border-bottom:1px solid var(--ui-line); flex-shrink:0; }
.access-sheet h2 { margin:0; font-size:22px; letter-spacing:-.02em; }
.access-sheet h3 { margin:0 0 12px; font-size:16px; }
.access-sheet header p { margin:6px 0 0; overflow-wrap:anywhere; }
.access-sheet form { display:flex; flex-direction:column; min-height:0; flex:1; }
.access-sheet-body { overflow:auto; padding:24px; min-height:0; flex:1; scrollbar-width:thin; scrollbar-color:var(--access-muted) transparent; }
.access-sheet footer { padding:16px 24px; border-top:1px solid var(--ui-line); background:var(--ui-bg); flex-shrink:0; }
.access-sheet footer .access-row-actions { justify-content:flex-end; }
.access-sheet footer [role=alert]:empty { display:none; }
.access-sheet fieldset { padding:0; margin:0 0 24px; border:0; min-width:0; }
.access-sheet legend { font-size:16px; font-weight:600; margin-bottom:12px; padding:0; }
.access-sheet-body > label + label { margin-top:18px; }
.access-field-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:16px; margin-bottom:20px; }
.access-check-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px 16px; }
.access-sheet .access-check { display:flex; align-items:center; gap:10px; font-size:14px; font-weight:400; min-height:40px; }
.access-sheet input[type=checkbox] { width:18px; min-width:18px; min-height:18px; height:18px; margin:0; flex:none; }
.access-form-section { padding-block:24px !important; border-top:1px solid var(--ui-line) !important; margin:24px 0 !important; }
.access-form-section legend { float:left; width:100%; }
.access-form-section legend + * { clear:both; }
.access-assignment { border-bottom:1px solid var(--ui-line); }
.access-assignment:first-child { border-top:1px solid var(--ui-line); }
.access-assignment > summary { padding:14px 0; cursor:pointer; }
.access-assignment > summary > span { display:block; padding-left:16px; margin-top:4px; color:var(--access-muted); font-size:13px; }
.access-assignment-fields { padding:4px 0 20px; }
.access-assignment .access-field-grid { margin:16px 0; }
.access-assignment-head { display:flex; align-items:end; justify-content:space-between; gap:12px; }
.access-assignment-head label { flex:1; }
.access-assignment + [data-add-role] { margin-top:12px; }
[data-add-role] { margin-top:12px; }
.access-effective, .access-danger { margin:24px 0; padding:16px 0; border-block:1px solid var(--ui-line); }
.access-effective summary, .access-danger summary { cursor:pointer; font-weight:500; }
.access-effective ul, .access-preview ul { padding-left:20px; line-height:1.7; }
.access-effective li + li, .access-preview li + li { margin-top:8px; }
.access-sheet textarea { width:100%; min-height:88px; resize:vertical; }
.access-sheet pre { white-space:pre-wrap; overflow-wrap:anywhere; font-size:12px; }
.access-unsaved { padding:12px 24px; border-bottom:1px solid var(--ui-line); background:var(--ui-bg); }
.access-unsaved p { margin:0 0 8px; }
.access-steps { display:flex; gap:24px; padding:0 0 16px; margin:0 0 20px; list-style:none; border-bottom:1px solid var(--ui-line); color:var(--access-muted); font-size:13px; }
.access-steps [aria-current=step] { color:var(--fusion-accent); font-weight:600; }
.theme-dark .access-steps [aria-current=step] { color:var(--ui-fg); }
.access-preview { padding-top:12px; }
.access-action-list { display:grid; gap:12px; }
.access-action-list .btn { text-align:left; }
.access-company-list { margin-top:24px; border-top:1px solid var(--ui-line); }
.access-company-list > div { display:grid; gap:6px; padding:18px 0; border-bottom:1px solid var(--ui-line); }
.access-event-meta { display:grid; gap:16px; margin:0 0 24px; }
.access-event-meta > div { display:grid; grid-template-columns:110px minmax(0,1fr); gap:12px; }
.access-event-meta dt { color:var(--access-muted); font-size:13px; }
.access-event-meta dd { margin:0; overflow-wrap:anywhere; }
.access-audit-changes > section { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px 24px; padding:20px 0; border-top:1px solid var(--ui-line); }
.access-audit-changes h3 { grid-column:1/-1; margin:0; }
.access-audit-changes .access-note { margin:0 0 8px; }
.access-audit-changes > section > div { overflow-wrap:anywhere; }
.access-audit-values { margin:0; padding-left:18px; }
.access-audit-values li + li { margin-top:10px; }
.access-subnav { display:grid; gap:2px; padding-left:26px; }
.access-subnav .sidebar-nav-item { font-size:13px; }
@media (max-width:1100px) {
  .access-filter-fields { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .access-toolbar-users { grid-template-columns:minmax(180px,1fr) minmax(140px,180px) auto; }
  .access-toolbar-users [data-reset] { grid-row:auto; grid-column:3; }
  .access-page-actions { align-items:start; }
  .access-page-actions > .access-row-actions { justify-content:flex-end; }
}
@media (max-width:760px) {
  .access-toolbar-users { grid-template-columns:minmax(0,1fr) auto; padding:12px; gap:10px; }
  .access-toolbar-users .access-search { grid-column:1/-1; }
  .access-toolbar-users .access-sort { grid-column:1; grid-row:2; }
  .access-filters > summary { grid-column:2; grid-row:2; }
  .access-toolbar-users [data-reset] { grid-column:2; }
  .access-status-tabs { width:100%; }
  .access-status-tabs button { flex:1; min-height:44px; }
  .access-users-table .access-person-trigger { min-height:44px; }
  body.admin-workspace .access-users-workspace .access-users-table tbody tr { grid-template-columns:minmax(0,1fr) auto; gap:12px; }
  body.admin-workspace .access-users-table td:nth-child(1) { grid-column:1; grid-row:1; }
  body.admin-workspace .access-users-table td:nth-child(5) { grid-column:2; grid-row:1; }
  body.admin-workspace .access-users-table td:nth-child(2) { grid-column:1/-1; grid-row:2; }
  body.admin-workspace .access-users-table td:nth-child(3) { grid-column:1; grid-row:3; }
  body.admin-workspace .access-users-table td:nth-child(4) { grid-column:2; grid-row:3; justify-self:end; }
  .access-person-fields { grid-template-columns:minmax(0,1fr); gap:16px; }
  .access-page-actions { flex-direction:column; gap:12px; }
  .access-page-actions > .access-row-actions { justify-content:flex-start; }
  .access-role { grid-template-columns:1fr auto; gap:12px; padding:16px; }
  .access-role > p { grid-column:1/-1; grid-row:2; }
  .access-role > .access-role-actions { grid-column:1/-1; grid-row:3; display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:12px; }

  .access-sheet > header, .access-sheet-body { padding:20px; }
  .access-sheet footer { padding:12px 20px; }
  .access-field-grid, .access-check-grid { grid-template-columns:minmax(0,1fr); }
  body.admin-workspace .access-workspace .access-table { display:block; min-width:0; table-layout:auto; }
  body.admin-workspace .access-workspace .access-table thead { position:absolute; width:1px; height:1px; padding:0; overflow:hidden; clip-path:inset(50%); }
  .access-table tbody { display:block; }
  .access-table tbody tr { display:grid; grid-template-columns:minmax(0,1fr) auto; gap:10px 16px; padding:16px; border-bottom:1px solid var(--ui-line); }
  .access-table tbody tr:last-child { border-bottom:0; }
  body.admin-workspace .access-workspace .access-table tbody td { padding:0; border:0; }
  .access-users-table td:nth-child(1), .access-users-table td:nth-child(2), .access-users-table td:nth-child(5),
  .access-units-table td:nth-child(1), .access-units-table td:nth-child(2),
  .access-audit-table td:nth-child(1), .access-audit-table td:nth-child(2), .access-audit-table td:nth-child(5) { grid-column:1/-1; }
  .access-audit-table tbody tr { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .access-audit-table td:nth-child(2) { grid-row:1; }
  .access-mobile-label { display:block; margin-bottom:3px; color:var(--access-muted); font-size:12px; }
  body.admin-workspace :is(.access-workspace,.access-sheet) .btn,
  body.admin-workspace .access-workspace :is(input,select), body.admin-workspace .access-sheet :is(input:not([type=checkbox]),select),
  .access-sheet .access-check { min-height:44px; }
  .access-person-name { font-size:14px; }
  .access-unit-cell { color:var(--access-muted); font-size:13px; }
  .access-audit-changes > section { grid-template-columns:minmax(0,1fr); }
}
@media (max-width:440px) {
  .access-filter-fields { grid-template-columns:minmax(0,1fr); }
  .access-page-actions .btn { flex:1 1 auto; }
  .access-page-actions > .access-row-actions { width:100%; }
  .access-event-meta > div { grid-template-columns:minmax(0,1fr); gap:4px; }
}
@media (prefers-reduced-motion:no-preference) {
  .access-sheet[open] { animation:access-open .18s cubic-bezier(.16,1,.3,1); }
  @keyframes access-open { from { translate:24px 0; } to { translate:0 0; } }
}
