/* Keep account, access and card configuration as focused matrices. Narrow
   windows scroll each table instead of crushing status and date values. */
.page-users {
  max-width: 1600px;
}

.sidebar button {
  white-space: nowrap;
}

.users-table-wrap {
  max-width: 100%;
  overscroll-behavior-inline: contain;
  scrollbar-gutter: stable;
}

.users-table-wrap .users-table {
  width: 100%;
  table-layout: fixed;
}

.account-table { min-width: 960px; }
.account-table .user-column { width: 150px; }
.account-table .status-column { width: 92px; }
.account-table .devices-column { width: 82px; }
.account-table .expiry-column { width: 165px; }
.account-table .login-column { width: 165px; }
.account-table .actions-column { width: 230px; }

.access-table { min-width: 960px; }
.access-table .access-user-column { width: 12%; }
.access-table .access-status-column { width: 8%; }
.access-table .access-group-column { width: 10%; }
.access-table .access-permissions-column { width: 35%; }
.access-table .access-expiry-column { width: 13%; }
.access-table .access-actions-column { width: 22%; }

.budget-table { min-width: 720px; }
.budget-table th:nth-child(1) { width: 170px; }
.budget-table th:nth-child(2) { width: 110px; }
.budget-table th:nth-child(4) { width: 150px; }

.tencent-mapping-table { min-width: 760px; }
.tencent-mapping-table th:nth-child(1) { width: 190px; }
.tencent-mapping-table th:nth-child(2) { width: 120px; }
.tencent-mapping-table th:nth-child(3) { width: 260px; }
.tencent-mapping-table th:nth-child(4) { width: 110px; }
.tencent-mapping-table th:nth-child(5) { width: 110px; }
.tencent-mapping-table select {
  width: 100%;
  height: 40px;
  padding: 0 11px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  font: inherit;
}

.tencent-sync-status {
  display: grid;
  grid-template-columns: repeat(4, minmax(140px, 1fr));
  gap: 12px;
  margin: 0 0 16px;
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.tencent-sync-status > div {
  display: grid;
  align-content: center;
  min-height: 76px;
  gap: 7px;
  padding: 14px 16px;
  background: #fff;
  border: 1px solid #dbe4f0;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(15, 31, 56, .045);
}

.tencent-sync-status span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

.tencent-sync-status strong {
  overflow-wrap: anywhere;
  font-size: 15px;
  line-height: 1.35;
}

.tencent-sync-status .sync-good { color: #15803d; }
.tencent-sync-status .sync-waiting { color: #b45309; }

.tencent-sync-status p {
  grid-column: 1 / -1;
  margin: 0;
  padding: 11px 14px;
  border: 1px solid #fecaca;
  border-radius: 8px;
  background: #fff1f2;
  color: #b91c1c;
}

.users-table th,
.users-table td {
  vertical-align: middle;
}

.users-table th {
  white-space: nowrap;
}

.users-table .user-cell {
  white-space: nowrap;
}

.users-table .user-cell strong {
  display: block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.users-table .user-cell .role-badge {
  display: inline-flex;
  margin-top: 7px;
}

.users-table .role-badge {
  padding: 0;
  background: transparent;
  color: var(--text);
  border-radius: 0;
}

.users-table .account-state,
.users-table .device-count,
.users-table .date-cell {
  white-space: nowrap;
}

.users-table .budget-cell {
  overflow-wrap: anywhere;
}

.users-table .cell-stack {
  display: grid;
  justify-items: start;
  gap: 10px;
}

.users-table .permission-badges {
  align-content: flex-start;
  align-items: center;
}

.users-table .row-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: start;
  gap: 8px;
}

.users-table .row-actions button {
  white-space: nowrap;
}

.users-table .compact-action {
  padding: 5px 8px;
  font-size: 12px;
  white-space: nowrap;
}

.users-table .access-actions {
  flex-wrap: wrap;
  align-content: flex-start;
}

.users-table tbody tr:hover td {
  background: #f8fbff;
}

@media (max-width: 850px) {
  .sidebar button {
    flex: 0 0 auto;
  }
  .account-table { min-width: 900px; }
  .access-table { min-width: 960px; }
  .tencent-sync-status { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
