.container {
  display: flex;
  flex-direction: column;
  position: absolute;
  inset: 0;
  overflow: hidden;
}

/* State screens (loading, error, empty) */
.stateContainer {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: absolute;
  inset: 0;
  gap: var(--space-2);
  color: var(--text-tertiary);
  text-align: center;
  padding: 24px;
}

.stateText {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  margin: 0;
}

.stateSubtext {
  font-size: var(--text-xs);
  color: var(--text-tertiary);
  margin: 0;
}

.spinner {
  animation: spin 1s linear infinite;
  color: var(--accent-primary);
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.errorIcon {
  color: var(--status-error);
}

.emptyIcon {
  color: var(--text-tertiary);
}

/* Table */
.tableWrapper {
  flex: 1;
  overflow: auto;
  min-height: 0;
}

.table {
  min-width: 700px;
  width: 100%;
  border-collapse: collapse;
}

.th {
  position: sticky;
  top: 0;
  background: var(--bg-tertiary);
  z-index: 1;
  padding: var(--space-2) var(--space-3);
  text-align: left;
  font-size: var(--text-xs);
  font-weight: var(--font-semibold);
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--border-default);
  white-space: nowrap;
  user-select: none;
}

.th:first-child {
  width: 40px;
}

.thContent {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  cursor: pointer;
}

.sortIcon {
  color: var(--text-tertiary);
  display: flex;
  align-items: center;
}

.tr {
  transition: background 0.1s ease;
}

.tr:hover {
  background: var(--bg-hover);
}

.tr:nth-child(even) {
  background: rgba(255, 255, 255, 0.015);
}

.tr:nth-child(even):hover {
  background: var(--bg-hover);
}

.trExpanded {
  background: var(--bg-secondary) !important;
}

.trExpandedDetail {
  background: none !important;
}

.td {
  padding: var(--space-1-5) var(--space-3);
  font-size: var(--text-xs);
  color: var(--text-primary);
  border-bottom: 1px solid var(--border-subtle);
  overflow: hidden;
  text-overflow: ellipsis;
}

.tdExpanded {
  padding: 0;
  border-bottom: 1px solid var(--border-default);
}

/* Cell content styles */
.expandBtn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  background: transparent;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  color: var(--text-tertiary);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.expandBtn:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.typeBadge {
  display: inline-flex;
  align-items: center;
  padding: 2px var(--space-2);
  border-radius: var(--radius-full);
  font-size: 10px;
  font-weight: var(--font-semibold);
  color: #fff;
  white-space: nowrap;
}

.nameCell {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

a.nameCell {
  color: var(--accent-primary);
  text-decoration: none;
}

a.nameCell:hover {
  text-decoration: underline;
}

.connBadge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  padding: 1px var(--space-1-5);
  background: var(--bg-tertiary);
  border-radius: var(--radius-full);
  font-size: 10px;
  font-weight: var(--font-semibold);
  color: var(--text-secondary);
}

.connEmpty {
  color: var(--text-tertiary);
  font-size: 10px;
}

/* Pagination */
.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-2) var(--space-4);
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-default);
  flex-shrink: 0;
}

.paginationInfo {
  font-size: var(--text-xs);
  color: var(--text-tertiary);
}

.paginationRows {
  margin-left: var(--space-1);
  color: var(--text-tertiary);
}

.paginationControls {
  display: flex;
  align-items: center;
  gap: var(--space-1);
}

.pageBtn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.pageBtn:hover:not(:disabled) {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.pageBtn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.pageSizeSelect {
  display: flex;
  align-items: center;
}

.select {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-size: var(--text-xs);
  padding: var(--space-1) var(--space-2);
  cursor: pointer;
}

.select:focus {
  outline: 2px solid var(--border-focus);
  outline-offset: -1px;
}

/* ---- Column filters ----------------------------------------------------- */

.filterBar {
  display: flex;
  align-items: center;
  gap: 8px;
  /* Matches the toolbar padding on the other tables so the control lines up on
     the same vertical edge when switching views. */
  padding: 6px 12px;
  border-bottom: 1px solid var(--border-primary);
  flex-shrink: 0;
}

/* Takes the slack so the button is flush right regardless of chip count. */
.filterBarChips {
  flex: 1;
  min-width: 0;
}
