/* ========================================================================
   Unity Catalog Native permissions tables

   Used by:
     docs/source-datastore/datastore/native/unity-catalog/deep-dive/permissions.md

   Reference tables (grants, network access): the first two columns never
   wrap and the explanation column takes the remaining width, never less
   than 16rem, so narrow screens scroll the table sideways instead of
   squeezing the text.

   Permission matrices (user roles, team permissions): the Action column
   never wraps and takes the remaining width, and the icon columns stay
   narrow and centered. On narrow screens the table scrolls sideways
   instead of squeezing the action text.
   ======================================================================== */

.unity-catalog-permissions-reference-table table,
.unity-catalog-permissions-matrix-table table {
  width: 100%;
}

.unity-catalog-permissions-reference-table table th,
.unity-catalog-permissions-reference-table table td,
.unity-catalog-permissions-matrix-table table th,
.unity-catalog-permissions-matrix-table table td {
  vertical-align: top;
}

.unity-catalog-permissions-reference-table table th:nth-child(1),
.unity-catalog-permissions-reference-table table td:nth-child(1),
.unity-catalog-permissions-reference-table table th:nth-child(2),
.unity-catalog-permissions-reference-table table td:nth-child(2) {
  white-space: nowrap;
}

.unity-catalog-permissions-reference-table table th:nth-child(3),
.unity-catalog-permissions-reference-table table td:nth-child(3) {
  width: 100%;
  min-width: 16rem;
}

.unity-catalog-permissions-matrix-table table th:nth-child(1),
.unity-catalog-permissions-matrix-table table td:nth-child(1) {
  white-space: nowrap;
  width: 100%;
  padding-right: 1.5rem;
}

.unity-catalog-permissions-matrix-table table th:not(:nth-child(1)),
.unity-catalog-permissions-matrix-table table td:not(:nth-child(1)) {
  white-space: nowrap;
  text-align: center;
  min-width: 6rem;
  padding-left: 0.5rem;
  padding-right: 0.5rem;
}
