.filters {
  display: flex;
  gap: 1rem;
  align-items: center;
  padding: 1rem 1.5rem;
  background: #fafafa;
  border-bottom: 1px solid #ddd;
  flex-wrap: wrap;
}
.filters input[type="search"] { flex: 1; min-width: 220px; padding: 0.4rem 0.6rem; }
.filters select { padding: 0.35rem 0.5rem; }
.count { color: #666; font-size: 0.9rem; margin-left: auto; }

.nav-link { text-decoration: none; color: #0366d6; margin-right: 1rem; }

.rules-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}
.rules-table th,
.rules-table td {
  border-bottom: 1px solid #eee;
  padding: 0.45rem 0.6rem;
  text-align: left;
  vertical-align: middle;
}
.rules-table th {
  background: #f4f4f4;
  position: sticky;
  top: 0;
  z-index: 1;
}
.rules-table tr:hover td { background: #fbfcff; }
.rules-table td.num { text-align: right; font-variant-numeric: tabular-nums; }
.rules-table input[type="checkbox"] { transform: scale(1.1); }

.row-actions button { padding: 0.25rem 0.55rem; margin-left: 0.3rem; }
.badge {
  display: inline-block;
  padding: 0 0.4rem;
  border-radius: 999px;
  background: #eef;
  color: #335;
  font-size: 0.78rem;
}
.badge.partner { background: #fee; color: #833; }
.badge.regex { background: #efe; color: #363; }
.badge.amount_range { background: #fef; color: #636; }

#edit-dialog {
  border: none;
  border-radius: 8px;
  padding: 1.5rem 1.75rem;
  max-width: 720px;
  width: 90vw;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}
#edit-dialog h2 { margin: 0 0 1rem; font-size: 1.15rem; }
#edit-dialog .grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem 1rem;
}
#edit-dialog label {
  display: flex;
  flex-direction: column;
  font-size: 0.85rem;
  color: #444;
}
#edit-dialog label input,
#edit-dialog label select,
#edit-dialog label textarea {
  margin-top: 0.2rem;
  padding: 0.4rem 0.55rem;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 0.92rem;
}
#edit-dialog label.full { grid-column: 1 / -1; flex-direction: row; align-items: center; gap: 0.4rem; }
#edit-dialog .actions { display: flex; gap: 0.7rem; justify-content: flex-end; margin-top: 1.2rem; }
.primary { background: #0366d6; color: white; border: none; padding: 0.45rem 1rem; border-radius: 4px; cursor: pointer; }
.primary:hover { background: #024ea1; }
button { cursor: pointer; }

.dry-run {
  margin: 1rem 1.5rem 0;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  padding: 0.3rem 1rem;
  background: #fcfcff;
}
.dry-run summary {
  cursor: pointer;
  padding: 0.5rem 0;
  font-weight: 600;
  color: #335;
}
.dry-run-body { padding: 0.5rem 0 1rem; }
.dry-run-body .grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 0.7rem;
}
.dry-run-body label { display: flex; flex-direction: column; font-size: 0.82rem; color: #444; }
.dry-run-body input, .dry-run-body textarea {
  padding: 0.35rem 0.5rem;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-family: inherit;
  margin-top: 0.2rem;
}
.dry-actions { display: flex; align-items: center; gap: 0.7rem; padding: 0.6rem 0; }
.dry-table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
.dry-table th, .dry-table td {
  border-bottom: 1px solid #eee;
  padding: 0.35rem 0.5rem;
  text-align: left;
}
.dry-table th { background: #f5f5f9; }
.dry-table tr.top-hit td { background: #f3fbf3; font-weight: 600; }
.score-bar {
  display: inline-block;
  width: 60px;
  height: 0.55rem;
  background: #eee;
  border-radius: 3px;
  vertical-align: middle;
}
.score-bar > span { display: inline-block; height: 100%; background: #2e7d32; border-radius: 3px; }
