.os-auth-matrix-wrap {
  max-height: 28rem;
  overflow: auto;
  border: 1px solid var(--os-color-border, #d7dde5);
  border-radius: 0.5rem;
}

.os-auth-matrix {
  min-width: 52rem;
  margin: 0;
}

.os-auth-matrix th,
.os-auth-matrix td {
  white-space: nowrap;
  vertical-align: middle;
}

.os-auth-matrix__module {
  position: sticky;
  inset-inline-start: 0;
  z-index: 1;
  background: var(--os-surface, #fff);
}

.os-auth-matrix__group td {
  font-weight: 650;
  letter-spacing: 0.02em;
}

.os-auth-matrix__group--farms td { background: color-mix(in srgb, #2e7d4f 16%, var(--os-surface, #fff)); }
.os-auth-matrix__group--facility td { background: color-mix(in srgb, #4f8fbf 16%, var(--os-surface, #fff)); }
.os-auth-matrix__group--quality td { background: color-mix(in srgb, #5b8a6a 14%, var(--os-surface, #fff)); }
.os-auth-matrix__group--settings td { background: color-mix(in srgb, #c4a35a 18%, var(--os-surface, #fff)); }
.os-auth-matrix__group--export td { background: color-mix(in srgb, #6b7c93 14%, var(--os-surface, #fff)); }
.os-auth-matrix__group--ai td { background: color-mix(in srgb, #7a6bb3 14%, var(--os-surface, #fff)); }
.os-auth-matrix__group--reports td { background: color-mix(in srgb, #6d8b74 14%, var(--os-surface, #fff)); }

html[data-theme="dark"] .os-auth-matrix__module,
html.os-theme-dark .os-auth-matrix__module,
body.os-theme-dark .os-auth-matrix__module {
  background: var(--os-surface, #1c2128);
}

.os-auth-matrix-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  margin-bottom: 0.75rem;
}

.os-auth-matrix-toolbar input[type="search"] {
  min-width: min(100%, 16rem);
  min-height: 2.25rem;
}

.os-auth-matrix-toolbar .btn {
  min-height: 2.25rem;
}

@media (max-width: 768px) {
  .os-auth-matrix-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
}
