/*
 * nos-data-table.css — estilos do componente NosTable compartilhado.
 *
 * Usa variáveis CSS com fallbacks para funcionar em qualquer contexto:
 *   nos-events UI (--bg-card, --border, --text-muted, --accent)
 *   bridge admin  (--color-surface, --color-border-muted, --color-text-muted, --color-accent)
 *   Qualquer tema que defina as vars acima.
 */

.nos-table-shell {
  overflow-x: auto;
}

.nos-data-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 420px;
}

.nos-data-table th {
  text-align: left;
  padding: 0;
  border-bottom: 1px solid var(--border, var(--color-border-muted, #30363d));
  vertical-align: middle;
  white-space: nowrap;
  position: relative;
}

/* Resize handle — borda direita arrastável */
.nos-resize-handle {
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 6px;
  cursor: col-resize;
  user-select: none;
  z-index: 1;
}
.nos-resize-handle::after {
  content: '';
  position: absolute;
  right: 1px;
  top: 20%;
  bottom: 20%;
  width: 1px;
  background: var(--border, var(--color-border-muted, #30363d));
  opacity: 0;
  transition: opacity 0.15s;
}
.nos-data-table th:hover .nos-resize-handle::after,
.nos-is-resizing .nos-resize-handle::after {
  opacity: 1;
}
.nos-table-shell.nos-is-resizing {
  cursor: col-resize;
  user-select: none;
}

.nos-data-table td {
  padding: 9px 10px;
  border-bottom: 1px solid var(--border, var(--color-border-muted, #30363d));
  font-size: 13px;
  vertical-align: top;
}

.nos-data-table tr:hover td {
  background: rgba(255, 255, 255, 0.03);
}

/* Sort button */
.nos-sort-btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  background: transparent;
  border: none;
  color: var(--text-muted, var(--color-text-muted, #7d8590));
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 8px 10px;
  cursor: pointer;
  white-space: nowrap;
  outline: none;
  transition: color 0.15s;
}

.nos-sort-btn:hover {
  color: var(--text, var(--color-white, #e6edf3));
}

.nos-sort-btn.is-active {
  color: var(--accent, var(--color-accent, #58a6ff));
}

.nos-sort-arrow {
  margin-left: 4px;
  font-size: 11px;
}

/* Empty state */
.nos-table-empty-row td {
  padding: 0;
  border: none;
}

.nos-table-empty {
  padding: 32px 16px;
  text-align: center;
}

.nos-table-empty p {
  color: var(--text-muted, var(--color-text-muted, #7d8590));
  font-size: 13px;
}

/* Pagination */
.nos-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 4px;
  gap: 8px;
  flex-wrap: wrap;
}

.nos-pagination-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nos-pagination-btn {
  appearance: none;
  background: var(--bg-card, var(--color-surface, #161b22));
  border: 1px solid var(--border, var(--color-border-muted, #30363d));
  border-radius: 6px;
  color: var(--text, var(--color-white, #e6edf3));
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  padding: 5px 10px;
  transition: background 0.15s;
}

.nos-pagination-btn:hover:not(:disabled) {
  background: var(--bg-input, var(--color-surface-hover, #1c2128));
}

.nos-pagination-btn:disabled {
  opacity: 0.4;
  cursor: default;
}

.nos-pagination-info {
  color: var(--text-muted, var(--color-text-muted, #7d8590));
  font-size: 13px;
  min-width: 60px;
  text-align: center;
}

.nos-pagination-total {
  font-size: 12px;
  opacity: 0.7;
}

.nos-pagination-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nos-pagination-size {
  background: var(--bg-input, var(--color-surface, #1c2128));
  border: 1px solid var(--border, var(--color-border-muted, #30363d));
  border-radius: 6px;
  color: var(--text, var(--color-white, #e6edf3));
  font-size: 12px;
  padding: 4px 8px;
  outline: none;
}

/* Default cell alignment */
.nos-col-default {
  font-family: var(--font-mono, monospace);
}

/* ── Tab bar ── */
.nos-tabs {
  background: var(--bg-card, var(--color-surface, #161b22));
  border-bottom: 1px solid var(--border, var(--color-border-muted, #30363d));
  display: flex;
  padding: 0 16px;
}

.nos-tab-btn {
  appearance: none;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-muted, var(--color-text-muted, #7d8590));
  cursor: pointer;
  font-size: 14px;
  margin-bottom: -1px;
  padding: 12px 16px;
  transition: color 0.15s;
}

.nos-tab-btn:hover { color: var(--text, var(--color-white, #e6edf3)); }
.nos-tab-btn.active {
  border-bottom-color: var(--accent, var(--color-accent, #58a6ff));
  color: var(--accent, var(--color-accent, #58a6ff));
}
