/* DB Inspector — read-only database debug view */

.dbi-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 16px;
  align-items: start;
}

.dbi-tables {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  position: sticky;
  top: 16px;
  max-height: calc(100vh - var(--topbar-h) - 48px);
  display: flex;
  flex-direction: column;
}

.dbi-tables-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-subtle);
  font-weight: 600;
  font-size: 13px;
}

.dbi-table-list {
  overflow-y: auto;
  padding: 4px 0;
}

.dbi-table-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px;
  cursor: pointer;
  font-size: 13px;
}

.dbi-table-item:hover {
  background: var(--bg-hover);
}

.dbi-table-name {
  flex: 1;
  font-family: var(--font-mono);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dbi-table-count {
  color: var(--text-muted);
  font-size: 11px;
  font-family: var(--font-mono);
}

.dbi-grids {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}

.dbi-grid-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.dbi-grid-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-subtle);
}

.dbi-grid-title {
  font-weight: 600;
  font-family: var(--font-mono);
}

.dbi-grid-meta {
  flex: 1;
  color: var(--text-muted);
  font-size: 12px;
}

.dbi-grid-scroll {
  overflow-x: auto;
  max-height: 480px;
  overflow-y: auto;
}

.dbi-table-grid {
  border-collapse: collapse;
  width: 100%;
  font-size: 12px;
  font-family: var(--font-mono);
}

.dbi-table-grid th,
.dbi-table-grid td {
  border-bottom: 1px solid var(--border-subtle);
  padding: 5px 10px;
  text-align: left;
  white-space: nowrap;
  max-width: 360px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dbi-table-grid thead th {
  position: sticky;
  top: 0;
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  z-index: 1;
}

.dbi-table-grid tbody tr:hover {
  background: var(--bg-hover);
}

.dbi-null {
  color: var(--text-muted);
  font-style: italic;
}

.dbi-loading {
  padding: 16px;
  color: var(--text-muted);
  font-size: 13px;
}

/* DB Cleanup modal */
.dbc-section-label {
  font-weight: 600;
  font-size: 13px;
  margin: 4px 0;
}
.dbc-group {
  cursor: pointer;
}
.dbc-group input {
  margin-right: 6px;
}

.dbi-select-all {
  border-bottom: 1px solid var(--border);
  margin-bottom: 4px;
  padding-bottom: 6px;
}

.dbi-tables-actions {
  display: flex;
  gap: 6px;
}
