.backfill-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  z-index: 6000;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.backfill-overlay.open { display: flex; }

.backfill-panel {
  background: #fff;
  border-radius: 14px;
  width: min(1100px, 100%);
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.25);
  overflow: hidden;
}

.backfill-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  padding: 18px 24px 14px 24px;
  border-bottom: 1px solid #e5e7eb;
}
.backfill-title { font-size: 18px; font-weight: 600; color: #0f172a; }
.backfill-sub { font-size: 13px; color: #64748b; margin-top: 2px; }
.backfill-header-actions { display: flex; gap: 8px; align-items: center; }

.backfill-tabs {
  display: flex;
  gap: 6px;
  padding: 10px 24px;
  border-bottom: 1px solid #e5e7eb;
  overflow-x: auto;
  flex-wrap: nowrap;
}
.backfill-tab {
  padding: 6px 12px;
  border: 1px solid #e5e7eb;
  background: #fff;
  border-radius: 999px;
  font-size: 13px;
  color: #475569;
  cursor: pointer;
  white-space: nowrap;
}
.backfill-tab:hover { background: #f8fafc; }
.backfill-tab.active { background: #0f172a; color: #fff; border-color: #0f172a; }

.backfill-body {
  padding: 16px 24px 24px 24px;
  overflow-y: auto;
  flex: 1;
}
.backfill-empty {
  text-align: center;
  padding: 40px 20px;
  color: #64748b;
  font-size: 14px;
}

.backfill-group { margin-bottom: 24px; }
.backfill-group-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}
.backfill-group-title { font-size: 15px; font-weight: 600; color: #0f172a; }
.backfill-count {
  display: inline-block;
  background: #f1f5f9;
  color: #475569;
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 12px;
  margin-left: 6px;
  font-weight: 500;
}

.backfill-card {
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 14px 16px;
  margin-bottom: 10px;
  background: #fff;
}
.backfill-card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  gap: 12px;
}
.backfill-card-title { font-weight: 600; color: #0f172a; font-size: 14px; }
.backfill-source { color: #94a3b8; font-size: 11px; font-family: monospace; }

.backfill-fields {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
  margin-bottom: 10px;
}
.backfill-field label {
  display: block;
  font-size: 11px;
  color: #64748b;
  font-weight: 500;
  margin-bottom: 3px;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}
.backfill-field input {
  width: 100%;
  padding: 7px 10px;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  font-size: 13px;
  color: #0f172a;
  background: #fff;
}
.backfill-field input:focus { outline: none; border-color: #6366f1; box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.15); }
.backfill-field input[readonly] { background: #f8fafc; color: #64748b; }

.backfill-card-note {
  background: #fef3c7;
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 12px;
  color: #78350f;
  margin-bottom: 10px;
}

.backfill-card-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}
.backfill-btn-approve, .backfill-btn-reject, .backfill-btn-save, .backfill-btn-ghost {
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid transparent;
}
.backfill-btn-approve { background: #16a34a; color: #fff; }
.backfill-btn-approve:hover { background: #15803d; }
.backfill-btn-reject { background: #fff; color: #b91c1c; border-color: #fecaca; }
.backfill-btn-reject:hover { background: #fef2f2; }
.backfill-btn-save { background: #fff; color: #475569; border-color: #cbd5e1; }
.backfill-btn-save:hover { background: #f8fafc; }
.backfill-btn-ghost { background: #fff; color: #475569; border-color: #cbd5e1; }
.backfill-btn-ghost:hover { background: #f8fafc; }

.backfill-btn-close {
  background: transparent;
  border: none;
  font-size: 18px;
  color: #64748b;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
}
.backfill-btn-close:hover { background: #f1f5f9; color: #0f172a; }
