/* InnoLab Access Hub � Users table + module modal (ported from profile-deployment demo) */

.access-hub-card {
  padding: 0;
  overflow: hidden;
}

.access-hub-head {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 1rem 1.15rem 0.5rem;
  border-bottom: 1px solid var(--line, rgba(28, 26, 23, 0.1));
}

.access-hub-admin-tag {
  background: rgba(26, 107, 74, 0.12);
  color: #1a5c40;
  font-size: 0.68rem;
  letter-spacing: 0.06em;
}

.access-hub-head h3 {
  margin: 0;
  font-size: 1.15rem;
}

.access-hub-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  padding: 0.75rem 1.15rem;
  border-bottom: 1px solid var(--line, rgba(28, 26, 23, 0.08));
}

.access-hub-toolbar-l,
.access-hub-toolbar-r {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
}

.access-hub-search {
  min-width: 200px;
  padding: 0.45rem 0.65rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 0.88rem;
}

.access-hub-filter {
  padding: 0.45rem 0.55rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 0.85rem;
}

.access-hub-stats {
  font-size: 0.82rem;
  color: var(--muted, #6b6560);
}

.access-hub-split {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  position: relative;
  min-height: 320px;
}

.access-hub-split.is-preview-open {
  grid-template-columns: minmax(0, 1fr) minmax(300px, 38%);
}

.access-hub-table-wrap {
  overflow: auto;
  max-height: min(62vh, 640px);
}

.access-hub-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.86rem;
}

.access-hub-table th,
.access-hub-table td {
  padding: 0.55rem 0.65rem;
  border-bottom: 1px solid rgba(28, 26, 23, 0.08);
  text-align: left;
  vertical-align: middle;
}

.access-hub-table th {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  background: rgba(248, 247, 244, 0.9);
  position: sticky;
  top: 0;
  z-index: 1;
}

.access-hub-table tbody tr {
  cursor: pointer;
}

.access-hub-table tbody tr:hover {
  background: rgba(26, 107, 74, 0.04);
}

.access-hub-table tbody tr.is-selected {
  background: rgba(26, 107, 74, 0.08);
}

.access-hub-user-ident {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.access-hub-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #1a3d2e;
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.82rem;
  font-weight: 600;
  flex-shrink: 0;
}

.access-hub-user-open {
  border: 0;
  background: none;
  padding: 0;
  font: inherit;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  color: inherit;
}

.access-hub-user-open em {
  font-style: normal;
  font-weight: 500;
  color: var(--muted);
  font-size: 0.82em;
}

.access-hub-user-ident span {
  display: block;
  font-size: 0.78rem;
  color: var(--muted);
}

.access-hub-badge {
  display: inline-block;
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.access-hub-badge--active { background: rgba(26, 107, 74, 0.15); color: #1a5c40; }
.access-hub-badge--invited { background: rgba(59, 130, 246, 0.12); color: #1d4ed8; }
.access-hub-badge--inactive { background: rgba(107, 101, 96, 0.12); color: #6b6560; }
.access-hub-badge--expired,
.access-hub-badge--offboarding,
.access-hub-badge--revoked { background: rgba(193, 117, 35, 0.15); color: #8a4b12; }
.access-hub-badge--admin { background: rgba(26, 107, 74, 0.12); color: #1a5c40; }
.access-hub-badge--none { background: rgba(220, 38, 38, 0.1); color: #b91c1c; }

.access-hub-acl-hint {
  display: block;
  font-size: 0.72rem;
  color: var(--muted);
  margin-top: 0.15rem;
}

.access-hub-row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
}

.access-hub-preview-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(20, 18, 16, 0.25);
  z-index: 2;
  cursor: pointer;
}

.access-hub-preview {
  border-left: 1px solid var(--line);
  background: #fff;
  display: flex;
  flex-direction: column;
  max-height: min(62vh, 640px);
  overflow: hidden;
  z-index: 3;
}

.access-hub-preview-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--line);
}

.access-hub-preview-sec {
  padding: 0.75rem 1rem;
  overflow: auto;
  flex: 1;
}

.access-hub-perm-tabs {
  display: flex;
  gap: 0.25rem;
  margin-bottom: 0.75rem;
}

.access-hub-perm-tab {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 8px;
  padding: 0.35rem 0.65rem;
  font-size: 0.8rem;
  cursor: pointer;
}

.access-hub-perm-tab.is-on {
  background: #1a3d2e;
  border-color: #1a3d2e;
  color: #fff;
}

.access-hub-perm-pane { display: none; }
.access-hub-perm-pane.is-on { display: block; }

.access-hub-module-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.45rem 0;
  border-bottom: 1px solid rgba(28, 26, 23, 0.06);
}

.access-hub-module-name {
  font-weight: 600;
  font-size: 0.86rem;
}

.access-hub-module-level {
  display: block;
  font-size: 0.76rem;
  color: var(--muted);
}

.access-hub-preview-foot {
  display: flex;
  justify-content: flex-end;
  gap: 0.45rem;
  padding: 0.75rem 1rem;
  border-top: 1px solid var(--line);
}

.access-hub-invite-drawer {
  border-top: 1px solid var(--line);
  padding: 1rem 1.15rem;
  background: rgba(248, 247, 244, 0.6);
}

.access-hub-invite-drawer[hidden] { display: none; }

.access-hub-invite-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem;
}

.access-hub-invite-grid .span-2 { grid-column: 1 / -1; }

.access-hub-modal {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.access-hub-modal[hidden] { display: none; }

.access-hub-modal.is-open { display: flex; }

.access-hub-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(20, 18, 16, 0.45);
  border: 0;
}

.access-hub-modal-panel {
  position: relative;
  width: min(520px, 100%);
  max-height: min(88vh, 720px);
  overflow: auto;
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 24px 64px rgba(20, 18, 16, 0.2);
}

.access-hub-modal-panel--wide {
  width: min(640px, 100%);
}

.access-hub-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.15rem;
  border-bottom: 1px solid var(--line);
}

.access-hub-modal-head h2 {
  margin: 0;
  font-size: 1.05rem;
}

.access-hub-modal-body {
  padding: 1rem 1.15rem;
}

.access-hub-modal-foot {
  display: flex;
  justify-content: flex-end;
  gap: 0.45rem;
  padding: 0.85rem 1.15rem;
  border-top: 1px solid var(--line);
}

.access-hub-level-opt {
  display: flex;
  gap: 0.65rem;
  padding: 0.55rem 0;
  border-bottom: 1px solid rgba(28, 26, 23, 0.06);
  cursor: pointer;
}

.access-hub-level-opt.is-on strong { color: #1a5c40; }

.access-hub-level-copy strong {
  display: block;
  font-size: 0.88rem;
}

.access-hub-level-copy em {
  display: block;
  font-size: 0.78rem;
  color: var(--muted);
  font-style: normal;
}

.access-hub-detail-group {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--line);
}

.access-hub-detail-group-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.45rem;
}

.access-hub-detail-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.4rem 0;
}

.access-hub-toggle {
  display: inline-flex;
  align-items: center;
  cursor: pointer;
}

.access-hub-toggle input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.access-hub-toggle-ui {
  width: 36px;
  height: 20px;
  border-radius: 999px;
  background: #d5d0c5;
  position: relative;
  transition: background 0.15s;
}

.access-hub-toggle-ui::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.15s;
}

.access-hub-toggle input:checked + .access-hub-toggle-ui {
  background: #1a6b4a;
}

.access-hub-toggle input:checked + .access-hub-toggle-ui::after {
  transform: translateX(16px);
}

@media (max-width: 960px) {
  .access-hub-split.is-preview-open {
    grid-template-columns: 1fr;
  }
  .access-hub-preview {
    position: relative;
    right: auto;
    top: auto;
    bottom: auto;
    width: 100%;
    max-height: none;
  }
  .access-hub-invite-grid {
    grid-template-columns: 1fr;
  }
  .access-hub-table-wrap {
    max-height: none;
  }
  .access-hub-table {
    min-width: 520px;
  }
}
